-
Notifications
You must be signed in to change notification settings - Fork 1
HSW12 Assembler Undocumented Features
hotwolf edited this page Sep 14, 2010
·
18 revisions
Here is a list of features that hasn’t made it into the project documentation, yet:
-
Automatic selection of long branch instructions, if a short branch is out of range → HC12, S12, S12X, S12XE
For example:
JOBSR LABEL
…produces the binary code: 27 32
DS 50
LABEL EQU *
BEQ LABEL
…produces the binary code: 18 27 01 F4
DS 500
LABEL EQU *
LBEQ LABEL
…also produces the binary code: 18 27 01 F4
DS 500
LABEL EQU *
This feature can be disabled with the help of the “<” modifier:
BEQ <LABEL
…results in a compile error
DS 500
LABEL EQU * -
For example:
JOB LABEL
…produces the binary code: 20 32
DS 50
LABEL EQU *
JOB LABEL
…produces the binary code: 06 01 F7
DS 500
LABEL EQU *
BRA LABEL
…also produces the binary code: 20 32
DS 50
LABEL EQU *
JMP LABEL
…also produces the binary code: 06 01 F7
DS 500
LABEL EQU * -
For example:
JOBSR LABEL
…produces the binary code: 07 32
DS 50
LABEL EQU *
JOBSR LABEL
…produces the binary code: 16 01 F7
DS 500
LABEL EQU *
BSR LABEL
…also produces the binary code: 07 32
DS 50
LABEL EQU *
JSR LABEL
…also produces the binary code: 16 01 F7
DS 500
LABEL EQU * -
The address mode will be converted into “16-Bit Constant Indirect Indexed Addressing”.
For example:
JMP [LABEL]
…are equivalent
JMP [LABEL-*,PC]