Neuron assembler, Neuron linker – Echelon Neuron C User Manual

Page 228

Advertising
background image

216

Neuron C Tools Stand-Alone Use

C:\>ncc –Imyincs -DOPTION1 myfile.nc

This command (assuming the compilation does not find errors) creates several
output files, all sharing the basename that was used for the Neuron C source file.

For the pure C example above, all generated files have a myfile base name, but

different extensions.

For a pure C compilation, all generated files except the assembly source file, .ns

extension, can be discarded. These files are required by other tools in case of a
Neuron C compilation, and cannot be discarded in such case.

Neuron Assembler

The Neuron assembler is named nas.exe. The Neuron assembler is only provided

for supporting the Neuron C compiler. It should not be used to generate Neuron
Assembly Language applications.
You can run the Neuron assembler from the command prompt to produce a

Neuron object file. The assembler command line contains the name of the
executable file, then one or more optional switches, and finally the file name to

assemble. The most useful assembler switch is the -l switch (the long form is - -

listing), which tells the assembler to produce a listing.

Continuing the example from the compiler section above, the following command

assembles the myfile.ns file to produce a myfile.nl listing file and a myfile.no

object file. After the object file is produced, you can delete the myfile.ns
intermediate assembly file to conserve disk space.

Example:
C:\>NAS -l myfile.ns

Neuron Linker

The Neuron Linker is named nld.exe. You can run the linker from the command

prompt to produce a Neuron executable file. The linker command line contains
the name of the executable file, then one or more switches, and finally the object

file name or names to link. Several switches must be used in combination to

produce a correct link.

The -a

(or - -appimage) switch should always be used when linking a Neuron C

application program.
The -t (or - -neurontype) switch should be used to specify the name of the Neuron
Chip or Smart Transceiver for which the application is being linked.

Example:
C:\>NLD -a -t3120E2 ....

When linking for a Neuron 3150 Chip or 3150 Smart Transceiver, the external

memory map must be specified using a set of switches. The switches specify the

beginning or end of the external RAM, EEPROM, and ROM areas. Each of these
switches is followed by a hex number corresponding to the first (last) page

number of the area. A page is 256 bytes, thus the page number is the upper two
hex digits of the four-digit byte address.
The -r and -R switches specify the first and last pages of external RAM,

respectively. The -e and -E switches specify the first and last pages of external

Advertising