Useful objasm macros |
I don't like the DCx version of allocating storage, I'm used to the EQUx method provided by the BASIC assembler...
; EQUB <value> MACRO EQUB $var DCB $var MEND
; EQUW <value> MACRO EQUW $var DCW $var MEND
; EQUD <value> MACRO EQUD $var DCD $var MEND
; EQUS "<value>" ; For 'EQUS "something", 13, 0' ; you will need use DCB directly. MACRO EQUS $var DCB "$var" MEND
You might like to try something such as:
; EQUSZ "<value>" MACRO EQUSZ $var DCB "$var", 0 MENDthough I've not tested this one.
stm_temp RLIST {R0-R3,R14} ldm_temp RLIST {R0-R3,PC} str_temp RLIST {R0-R3}Then, in your code, instead of:
STMFD R13!, {R0-R3, R14}
...
LDMFD R13!, {R0-R3, PC}
STMFD R13!, stm_temp
...
LDMFD R13!, ldm_temp
The 'str_temp' version is for when you want to store/load without messing with R14/PC. The same is used for both loading and storing.