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?
17 ; Exit with return code
44 ; Load an immediate value into a general register
45 ; TODO: use minimal sized insn
46 .macro mvi_h_gr val reg
50 ; Load an immediate value into a dedicated register
51 .macro mvi_h_dr val reg
56 ; Load a general register into another general register
57 .macro mvr_h_gr src targ
61 ; Store an immediate into a word in memory
62 .macro mvi_h_mem val addr
67 ; Store a register into a word in memory
68 .macro mvr_h_mem reg addr
72 ; Load a word value from memory
73 .macro ldmem_h_gr addr reg
77 ; Add 2 general registers
78 .macro add_h_gr reg1 reg2
82 ; Increment a register by and immediate
83 .macro inci_h_gr inc reg
88 ; Test the value of an immediate against a general register
89 .macro test_h_gr val reg
90 .if (\val >= 0) && (\val <= 15)
93 .if (\val < 0) && (\val >= -16)
105 ; compare two general registers
106 .macro testr_h_gr reg1 reg2
113 ; Test the value of an immediate against a dedicated register
114 .macro test_h_dr val reg
119 ; Test the value of an general register against a dedicated register
120 .macro testr_h_dr gr dr
125 ; Compare an immediate with word in memory
126 .macro test_h_mem val addr
131 ; Compare a general register with word in memory
132 .macro testr_h_mem reg addr
137 ; Set the condition codes
152 ; Test the condition codes
153 .macro test_cc N Z V C
180 ; Set the division bits
183 mvi_h_gr 0xfffff8ff,r4
193 ; Test the division bits
194 .macro test_dbits val
202 ; Save the return pointer
207 ; restore the return pointer