User manual

ST Assembler-Linker ST assembler
Doc ID 11392 Rev 4 25/89
Operator names longer than one character must be followed by a space character. For
example, '1 AND 2' is correct, '1AND2' is not.
Place curly braces { } around arithmetic expressions.
Always use curly braces at the top-level, when defining a numeric expression. Not doing so
may produce unexpected results.
Wrong syntax:
#define SIZE 128
DS.W SIZE+1 ; Wrong, syntax error
#IF SIZE eq 1 ; Wrong, same as #IF SIZE
#ENDIF
Correct syntax:
#define SIZE 128
DS.W {SIZE+1} ; OK
#IF {SIZE eq 1} ; OK
#ENDIF
4.3.7 Comments
Comments are preceded by a semicolon. Characters following a semicolon are ignored by
the assembler.
4.3.8 A source code example
Below is an example of a short source code.
st7/
; small example module showing source formats
ioport equ $8000 ; 8 bit I0 port A
handshake equ $9000 ; write xx here to strobe
segment 'program'
start ld a,#0 ; zero counter
loop ld ioport,x ; store into ioport
segment word at: FFFC 'code'
WORD start
end
Do not worry if some directives do not make sense yet; they will be covered soon. Also, take
special notice of the SEGMENT directive.
Table 9. Level 4 operators
Operation Result, level #4
a-b a minus b
a+b a plus b