beautypg.com

Radix (default radix) – Echelon Neuron User Manual

Page 164

background image

RADIX (Default Radix)

The RADIX directive sets the default radix (numeric base) used for constant

numeric expressions until another RADIX directive is encountered. The default

radix is DECIMAL.
However, if you include assembly source files into applications that are written in

Neuron C using the Neuron C compiler’s #pragma include_assembly_file

directive, the Neuron C compiler always sets the default radix to HEX, and an

included assembly file cannot change the Neuron C compiler’s default radix.
Recommendation: Because the Neuron Assembler does not provide a method

to save and restore the current default radix, and because an included file might

change the default radix, use the RADIX directive only when necessary.
Literal constants without a radix must begin with a numeric digit. For example,

if the default radix setting is hexadecimal (HEX), you must specify a leading zero

if the first non-zero digit of the hexadecimal constant is alphabetic. That is,

specify h’0abc rather than h’abc.

Syntax:
The RADIX directive requires an argument for the radix name. This directive

cannot have a label.

RADIX BINARY

RADIX OCTAL

RADIX DECIMAL

RADIX HEX

The radix name can be specified in either lower or upper case.

154

Neuron Assembler Directives