163/317
6 - STMicroelectronics Programming Tools
above is encountered in the program, the assembler replaces it with the figure 3;whenthe
identifier
RESULT is encountered, it is replaced with NumberOfApples. No other processing or
property is involved. The
#DEFINE statements are often put at the top of the source text, to
allow some constants to be changed globally in the program by only changing one line that is
easy to locate.
Once an identifier is defined, the
#IFDEF <identifier> conditional is true, even if the value
is an empty string. Example:
#IFNDEF THREE
#DEFINE THREE 3
#IFDEF THREE
#DEFINE THREE 4
The first line checks if THREE is not defined. Since it is not, it will be defined as 3. Then the third
line checks if
THREE is defined. Since it now is , it is redefined as 4.
6.1.8.3 Numbering syntax directives
The most popular chip makers have defined for their products a numbering syntax for non-
decimal numbers. Unfortunately, these are not all the same. The ST7 assembler offers the
choice of four different notations, so that the programmer may keep his habits or just choose
the syntax he prefers. These syntaxes are summarized in the following table.
Table 8. Table of the numbering radix notations
Note: Both upper and lower case letters are allowed.
To select one of these syntaxes, use the appropriate pseudo-op of the first line of the table at
the top of the source text. By default, the MOTOROLA style is used.
6.1.9 Object and listing files
Note:
For the invocation of the assembler and the command-line options, refer to the ST7
Software Tools User Manual, paragraph 4.6.
INTEL MOTOROLA TEXAS ZILOG
Binary numbers 1010B %1010 ?1010 %(2)1010
Octal numbers 175O or 175Q ~175 ~175 %(8)175
Hexadecimal numbers 4582H or
0FFFFH
$4582 or
$FFFF
>4582 or
>FFFF
%4582 or
%FFFF