Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - A question about the Gameboy instruction set
  
User name:
Password:
Reply:
 

UserPost
HyperLamer
Posts: 1075/8210
Hmm, you're right... but when I tried it in NO$GMB (without loading a cartridge, just type it in the debugger and hit F7) last night, it had all sorts of crazy effects. When A=$7F and C=0, it'd act as if A=$10 and C=8. It's working today though. (It does seem a bit odd that you can only use C for that though; I would have expected B, or they could just use instructions $D3, $DB, $DD, $E3, $E4, $EB and $EC.)
Parasyte
Posts: 84/514
This is one of those Gameboy-specific instructions. It replaces one of the jumps in the standard z80 instruction set.
Basically, it's used for 8-bit indexed zero-page loads. But yeah, you're kind of stuck using only registers A and C. My guess is they didn't include a billion more instructions like this for every register because they had to replace an instruction just to get this one in there. That, and only one is really even needed. (IE, if you need to keep the contents of A and\or C, either use a different instruction, or push those regs to the stack. Whichever method works best.)
HyperLamer
Posts: 1074/8210
I was just wondering... WTF does the instruction "LD ($FF00+c),A" do? I can't make heads or tails of it. My guess was either $FF00 + (register C) or $FF00 + (value of flag C; IE $FF00 if C is clear, else $FF01) but neither of those really make any sense, especially the first one when they don't have that for any other regs.
Acmlm's Board - I2 Archive - Programming - A question about the Gameboy instruction set


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.004 seconds.