User manual
ST assembler ST Assembler-Linker
22/89 Doc ID 11392 Rev 4
4.3.5 Opcodes
The Opcode field may serve three different purposes. It may contain:
● The opcode mnemonic for an assembly instruction.
● The name of a directive.
● The name of a macro to be invoked.
Opcodes must be separated from the preceding field (that is, label, if there is one) by a
space or a tab. A comprehensive Opcode description can be found in the ST programming
manual.
Macros are discussed in Section 4.5 on page 30.
Directives are discussed in Chapter 8: Librarian on page 51.
4.3.6 Operands
Operands may be any of the following:
● Numbers and addresses.
● String and character constants.
● Program counter references.
● Expressions.
The following paragraphs explain how to use these types of operands.
Number and address representation
By default, the representation of numbers and addresses follows the MOTOROLA syntax.
When you want to use hexadecimal number with instructions or labels, they must be
preceded by $. When nothing is specified, the default base is decimal.
For example:
lab03 equ 10 ; decimal 10
lab04 equ $10 ; hexadecimal 10
ld A,$ffff ; long addressing mode
ld A,#$cb ; immediate addressing mode
ld A,#100 ; decimal representation
You can change the Motorola format representation by using directives (.INTEL, .TEXAS) to
indicate the new setting format.
For more information, refer to Appendix A: Assembler directives on page 55.
Caution: Addresses for SEGMENT definition are always given in hexadecimal:
segment byte at: 100-1FF 'test'
The segment 'test' is defined within the 256-511 address range.
Numeric constants and radix
Constants may need special characters to define the radix of the given number.
The assembler supports the MOTOROLA format by default. INTEL, TEXAS, ZILOG formats
are also available if the format is forced by .INTEL .TEXAS or .ZILOG directives. Table 5 on
page 23 shows a summary of these formats.
Note: Decimal constants are always the default, and require no special characters.