beautypg.com

Displacements, Address expressions, Comments – Echelon Neuron User Manual

Page 24: Assembler directives, Interfacing with neuron c programs

background image

Displacements

A displacement is a relative address value. A displacement can be interpreted as

a signed or unsigned number, depending on the instruction with which the

displacement appears.
To compute the absolute address value, add the displacement (using either

signed or unsigned arithmetic, as appropriate) to the absolute address of the

instruction that contains the displacement.

Address Expressions

An address expression is an expression that specifies an address, and can be one

of the following types of expression: a literal constant, a symbol with an optional

offset expression, or the * special operator with an optional offset expression.

The optional offset expression is a general expression with a prefixed + (addition)

or - (subtraction) operator.
An address expression can consist of a mixture of locally defined and imported

symbols from the same or from multiple segments. However, symbols from other

segments must be exported, even if they are not used by other modules.

Comments

A comment is part of an assembly source line that provides useful information to

the code developer. The Neuron Assembler ignores comments. A comment starts

with a semicolon character (;) and ends with a newline or carriage-return

character.
Recommendation: Use comments to document changes to the data and return

stacks. See Documenting Changes to the Stack for a recommended method of

documenting stack changes.

Assembler Directives

An assembler directive provides information to the Neuron Assembler to control

or affect the processing of the remainder of the assembly file.
The directives have syntax analogous to the assembly instructions. Most

directives require arguments, which are similar to the operands of the assembly

instructions.
See Chapter 7, Neuron Assembler Directives, for more information about the

Neuron Assembler directives.

Interfacing with Neuron C Programs

Typically, you use Neuron assembly language to create utilities that can be used

with an application that is written in Neuron C. The Neuron C program code

might call functions defined in Neuron assembly, or a Neuron assembly function

might call a Neuron C function or program.
See Chapter 4, Interfacing with a Neuron C Application, for more information

about how Neuron assembly language functions and Neuron C program interact.

14

Introduction