|
In making a GameBoy emulator, I want to know if possible how to access 2 char variables as one? I have registers a,b,c,d,e,f,h,l. They are all unsigned chars right now, but they can be paired up to form af, bc, de, and hl. Those 4 pairs would need to be accessed as an unsigned short, where reading/writing to them would write to the individuals accordingly. For example, if I ran the code bc=$3589, then b should be $35 and c should be $89. similarly, reading from bc should return $3589 (or the dec value of that). This won't be necessary to get things going, but it would be nice for optimization.
|