Segments – Echelon Neuron User Manual
Page 35

•
POPPUSH to remove the TOS element of the data stack and place it
onto the top of the return stack
•
DROP [RSP] to drop the top of the return stack
•
PUSH RSP and PUSH [RSP] to copy the value from the top of the
return stack into the TOS element of the data stack
•
POP RSP to remove data from the TOS element of the data stack and
place it onto the top of the return stack
See Chapter 6, Neuron Assembly Language Instruction Statements, for more
information about these and other Neuron assembly instructions.
Segments
The assembler groups assembly instructions and data blocks into one or more
segments. A segment is a group of assembly instructions and data blocks that are
assembled into consecutive bytes of machine instructions and data, at
consecutive and ascending addresses. That is, when a segment is closed, it is
complete and can be assembled and written to the object output file.
The basic unit for the assembler is a statement, but the basic unit for the linker
is a segment. The linker relocates code and data on a segment-by-segment basis.
During assembly:
•
One segment of each type is always open.
•
Additional code and data can be added only to an open segment.
•
Only one of the open segments is the currently active segment.
•
The next assembly instruction or data statement encountered in the
assembly file is added to the active segment.
The segment type does not affect the assembly of the source lines within it, but
does affect the linking of the segment.
The Neuron Assembler supports the segment types listed in Table 8.
Table 8. Segment Types
Segment
Name
Usage
CODE
For general assembly code.
EECODE
For code and constant data that resides in on-chip or off-chip
EEPROM.
EEFAR
For data that resides in off-chip non-volatile memory.
EENEAR
For data that resides in on-chip EEPROM for Series 3100
devices or mandatory EEPROM for Series 5000 and 6000
devices. The size of the EENEAR segment is 256 bytes.
INITCODE
For initialization code. Used by the Neuron C compiler.
Neuron Assembly Language Reference
25