I've finally started with creating an M68000 emulator. This is a 32bit processor in many aspects and I want to use integeres for the registers (which are 32 bit).
Now here's the trouble; we don't have any unsigned datatypes in java (except for char) and Sun says it's not necessary to have them. (which sucks btw)
So, say the PC points to memory address 0xffffffff (memory is an array), how would I do that?
Obviously, doing something like
byte fetched = memory[PC];
would get me an ArrayOutOfBoundsException since PC is 0xffffffff, which is -1.
I don't want to revert to long because I feel that should not be necessary. Any thoughts?