User manual
Introduction ST Assembler-Linker
8/89 Doc ID 11392 Rev 4
1 Introduction
1.1 ST7 and STM8 incompatibilities
The new ST7/STM8 assembler development toolchain supports both the new STM8 core
and the old ST7 core. By placing a trigger (st7/ or stm8/) in the first line of your code, you
tell the assembler which set of rules to apply.
The STM8 assembler is not compatible with the ST7 assembler.
STM8 assembler (16-bit) features that are not compatible with the ST7 assembler (8-bit):
1. X and Y are 16 bits wide (ST7 is 8 bits):
ld A,X has been replaced by ld A,XL
ld X,A has been replaced by ld XL,A
ld A,Y has been replaced by ld A,YL
ld Y,A has been replaced by ld YL,A
2. Stack pointer (SP) is 16 bits wide (ST7 is 8 bits wide):
ld A,S and ld S,A instructions have been removed
ld X,S has been replaced by ldw X,SP
ld S,X has been replaced by ldw SP,X
ld Y,S has been replaced by ldw Y,SP
ld S,Y has been replaced by ldw SP,Y
3. more generally
ld is for an 8-bit transfer, for example: ld A,$5000
ldw is for 16-bit transfer, for example: ldw X,$5000 (instead of ld X,$5000)
4. RSP instruction has been removed
5. Some addressing modes have been removed, for example:
- short pointer to short data [pointer.b], for example:
ld A,[$10.b]
btjf [$11.b],#3,skip
- short pointer to short data X or Y indexed ([pointer.b],X) or ([pointer.b],Y), for example:
ld A,([$10.b],X)
ld ([$12.b],Y),A
- short pointer to short data relative [pointer.b], for example:
jreq [$13.b]
callr [$39.b]
6. Short bit operations have been replaced by long bit operations, for example:
btjf $1011,#2,jump (instead of btjf $11,#2,jump)
bset $1000,#1 (instead of bset $00,#1)
7. .h and .l suffixes are not supported, for example:
ld A,#mem.h can be replaced by ld A,#{high mem}
ld A,#mem.l can be replaced by ld A,#{low mem}