User manual
ST Assembler-Linker ST assembler
Doc ID 11392 Rev 4 23/89
String constants
String constants are strings of ASCII characters surrounded by double quotes.
For example:
“This is an ASCII string”
ASCII character constants
The assembler's arithmetic parser also handles ASCII characters in single quotes,
returning the ASCII of the given character(s). For example:
‘A’ $41
‘6’ $06
‘AB’ $4142
Up to 4 characters may be used within a single pair of quotes to give a long constant. The
following special sequences are used to denote special characters:
‘\b’ $7F backspace
‘\f’ $0C formfeed
‘\n’ $0A linefeed
‘\r’ $0D carriage return
‘\t’ $09 tabulation
‘\\’ $5C slash
‘\’ $27 single-quote
‘\0’ $00 null
‘\”’ $22 double-quote
Program counter reference
The current value of the program counter (PC) can be specified by an asterisk "*".
For example: lab05 jra *
Expressions and operators
Expressions are numeric values that may be made up from labels, constants, brackets and
operators.
Labels and constants have been discussed in previous paragraphs.
Arithmetic brackets are allowed up to 8 nested levels, the curly braces {} are used
instead of the common “()” because instructions may use a parenthesis to denote indexed
addressing modes.
Operators have 4 levels of precedence. Operators in level #1 (listed in Tabl e 6) take
precedence over operators in level #2 (listed in Table 7), and so on. In each level, operators
have same precedence, they are evaluated from left to right.
Table 5. Numeric constants and radix formats
Format Hex Binary Octal Current PC
Motorola $ABCD or &ABCD %100 ~665 *(use MULT for MULTIPLY)
Intel 0ABCDh 100b 665o or 665q $
Texas >ABCD ?100 ~665 $
Zilog %ABCD %(2)100 %(8)665 $