1 # r0, r4-r6 are used as tmps, consider them call clobbered by these macros.
12 ldi32 0x7fffc,sp ; TODO -- what's a good value for this?
14 mov r0,tbr ; defined in manual
19 ; Exit with return code
46 ; Load an immediate value into a general register
47 ; TODO: use minimal sized insn
48 .macro mvi_h_gr val reg
52 ; Load an immediate value into a dedicated register
53 .macro mvi_h_dr val reg
58 ; Load a general register into another general register
59 .macro mvr_h_gr src targ
63 ; Store an immediate into a word in memory
64 .macro mvi_h_mem val addr
69 ; Store a register into a word in memory
70 .macro mvr_h_mem reg addr
74 ; Store the current ps on the stack
79 ; Load a word value from memory
80 .macro ldmem_h_gr addr reg
84 ; Add 2 general registers
85 .macro add_h_gr reg1 reg2
89 ; Increment a register by and immediate
90 .macro inci_h_gr inc reg
95 ; Test the value of an immediate against a general register
96 .macro test_h_gr val reg
97 .if (\val >= 0) && (\val <= 15)
100 .if (\val < 0) && (\val >= -16)
112 ; compare two general registers
113 .macro testr_h_gr reg1 reg2
120 ; Test the value of an immediate against a dedicated register
121 .macro test_h_dr val reg
126 ; Test the value of an general register against a dedicated register
127 .macro testr_h_dr gr dr
132 ; Compare an immediate with word in memory
133 .macro test_h_mem val addr
138 ; Compare a general register with word in memory
139 .macro testr_h_mem reg addr
144 ; Set the condition codes
159 ; Test the stack mode
174 ; Set the interrupt bit
183 ; Test the stack mode
213 ; Test the condition codes
214 .macro test_cc N Z V C
241 ; Set the division bits
244 mvi_h_gr 0xfffff8ff,r4
254 ; Test the division bits
255 .macro test_dbits val
263 ; Save the return pointer
268 ; restore the return pointer
273 ; Ensure branch taken
274 .macro take_branch opcode
280 .macro take_branch_d opcode val
288 ; Ensure branch not taken
289 .macro no_branch opcode
297 .macro no_branch_d opcode val