In assembly, when they say “immediate data” is that signed or unsigned??
I’m writing a Gameboy emulator and am using the opcodes here:
http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html
Opcode 0xC6 for example is ADD A, d8.
My guess is that it’s unsigned else why would they need “SUB A, d8” but I thought that I’d ask just while I’m checking over my code…
It seems like it’s an unsigned int. Look at MAME’s LR35902 CPU emulator, they use UINT8 for the immediate.
Some relevant code:
Now, the routine for
LD HL,SP+n8isHere the immediate is cast to an signed 8-bit int
(INT8), so I imagine it’s otherwise unsigned.