beautypg.com

Linking the program, Debugging the program – Echelon Neuron User Manual

Page 54

background image

Copyright (c) Echelon Corporation 1992-2009

0 warning(s), 0 error(s)

The --listing option causes the Assembler to generate a listing file. The

Neuron Assembler creates two output files:

checksum.nl (the listing file)

checksum.no (the object file)

To add an object file to a Neuron library, use the Neuron Librarian command-line

tool (NLIB.EXE).
Example: To add the previously assembled checksum.no file to an existing

library named wwdc.lib, use the NLIB command as shown below:

C:\myDevice> nlib --add wwdc.lib checksum.no

Neuron C Librarian, version 5.00.21, build 0

Copyright (c) Echelon Corporation 1992-2009

0 warning(s), 0 error(s)

You can add multiple files to a library at once, or you can add each file separately

by running the NLIB command several times. You can use the --report option

to inspect an existing library and list its contents.
See Neuron C Compiler for Assembly Programming for more information about

compiling a Neuron C program that includes Neuron assembly code. See Neuron

Assembler Command Line Tool for more information about the NAS command.

See the Neuron C Programmer’s Guide for more information about the Neuron

Librarian.

Linking the Program

To link an assembled object file with a compiled Neuron C object file, refer to

your Neuron C development tool’s user’s guide. the IzoT NodeBuilder FX

Development Tool supports user-defined libraries, and a simple mechanism to

specify it.

Debugging the Program

Although the IzoT NodeBuilder FX Development Tool allows you to debug

Neuron C code, it does not provide support for debugging Neuron assembly code

directly. That is, you cannot set a breakpoint in assembly code, single-step

through assembly code, or watch variable or register values.
Thus, to debug a Neuron assembly function, you should create helper functions in

Neuron C to call and test the assembly function. For example, for a Checksum()

function written in Neuron assembly language, you should create a test function

that calls the assembly function and verifies its correctness, as shown below:

#pragma include_assembly_file “checksum.ns”

extern unsigned Checksum(unsigned, const char*);

void TestCall(void) {

unsigned cs;

cs = Checksum(8, “ABCDEFGH”);

44

Writing a Neuron Assembly Utility Function