User manual

ST Assembler-Linker Assembler directives
Doc ID 11392 Rev 4 73/89
Example
byte no alignment; can start on any byte boundaries
word aligned to next word boundaries if necessary, i.e., 8001=8002
para aligned to the next paragraph (=16 bytes) boundary, i.e., 8001=8010
64 aligned to the next 64-byte boundary, i.e., 8001=8040
128 aligned to the next 128-byte boundary, i.e., 8001=8080
page aligned to the next page (=256 bytes) boundary, i.e., 8001=8100
long aligned to the next long-word(=4 bytes) boundary, i.e., 8001=8004
1K aligned to next 1K boundaries, i.e., 8001=8400
4K aligned to next 4K boundaries, i.e., 8001=9000
See also
X[-Y] Introduces new class that starts from X and goes through to address Y.
Address Y is optional.
<none> Tack this code on the end of the last segment of this class.
common Put the segment at the same address than other common segments that
have the same name, and note the longest length segment.
The optional [cod] suffix is a number from 0 to 9 - it decides into which. COD file the
linker sends the contents of this class. 0 is the default and is chosen if the suffix is left
off. A suffix of 1-9 will cause the linker to open the [cod] suffix, and send the contents
of this class into the cod file instead of the default. This allows bank switching to be
supported directly at link level- different code areas at the same address can be
separated out into different .cod files.
Table 70. .SETDP
Purpose Set base address for direct page.
Format .SETDP <base address>
Description
If you have used an ST processor, you are aware of its 'zero-page' or 'direct'
addressing modes. These use addresses in the range 00..FF in shorter, faster
instructions than the more general 0000..FFFF versions. Other processors use the
same scheme, but with a twist: you can choose the 'base page' where the direct mode
does not have to be in range 0000 00FF but can be from nn00..nnFF where nn00 is
the 'base page', loaded into a register at run-time. Because the assembler cannot
track what's in the base page register at run-time, you need to fill it in about the current
'base page' with the .SETDP directive. At the start of the assembly, SETDP defaults to
0000.
Example
.SETDP $400
ld A,$401 ; direct mode chosen
See also
Table 71. SKIP
Purpose Inserts given number of bytes with an initialization value.
Format SKIP <number of bytes>,<value to fill>
Description
This directive leaves a message for the linker that you want X number of Y bytes to be
inserted into the object code at this point. Both the arguments must be absolute values
rather than external or relative values.
Example SKIP 100,$FF ; insert 100 bytes all $FF
See also
Table 69. SEGMENT