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?
15 ; Exit with return code
42 ; Load an immediate value into a general register
43 ; TODO: use minimal sized insn
44 .macro mvi_h_gr val reg
48 ; Load an immediate value into a dedicated register
49 .macro mvi_h_dr val reg
54 ; Load a general register into another general register
55 .macro mvr_h_gr src targ
59 ; Store an immediate into a word in memory
60 .macro mvi_h_mem val addr
65 ; Store a register into a word in memory
66 .macro mvr_h_mem reg addr
70 ; Load a word value from memory
71 .macro ldmem_h_gr addr reg
75 ; Add 2 general registers
76 .macro add_h_gr reg1 reg2
80 ; Increment a register by and immediate
81 .macro inci_h_gr inc reg
86 ; Test the value of an immediate against a general register
87 .macro test_h_gr val reg
88 .if (\val >= 0) && (\val <= 15)
91 .if (\val < 0) && (\val >= -16)
103 ; compare two general registers
104 .macro testr_h_gr reg1 reg2
111 ; Test the value of an immediate against a dedicated register
112 .macro test_h_dr val reg
117 ; Test the value of an general register against a dedicated register
118 .macro testr_h_dr gr dr
123 ; Compare an immediate with word in memory
124 .macro test_h_mem val addr
129 ; Compare a general register with word in memory
130 .macro testr_h_mem reg addr
135 ; Set the condition codes
150 ; Test the condition codes
151 .macro test_cc N Z V C
178 ; Set the division bits
181 mvi_h_gr 0xfffff8ff,r4
191 ; Test the division bits
192 .macro test_dbits val