Open nonarkitten opened 2 years ago
So yes they do. So right now, BCD opcodes look like this:
.global opcode_4803
.syntax unified
@ NBCD #,D3
opcode_4803:
push {lr}
ldrsb r0, [r5,#12]
bl handle_nbcd
strb r0, [r5,#12]
pop {pc}
The push and pop are now illegal for PJIT; what we'll have to do is do a plain branch to handle_nbcd and let it write-back the result. This may mean needing a unique handle_nbcd for each addressing mode.
Perhaps something like
opcode_4803:
add r1, r5,#12 @ precompure EA write-back
ldrsb r0, [r1]
b handle_nbcd_ea
Note that this is also used for the division routines.
Some opcodes like BCD may require the stack (check) and if so, will need to be rewritten.