Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - A question about the Gameboy instruction set | | | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
HyperLamer <||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people Sesshomaru Tamaranian Level: 118 Posts: 1074/8210 EXP: 18171887 For next: 211027 Since: 03-15-04 From: Canada, w00t! LOL FAD Since last post: 2 hours Last activity: 2 hours |
| ||
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. | |||
Parasyte Bullet Bill Level: 35 Posts: 84/514 EXP: 267348 For next: 12588 Since: 05-25-04 Since last post: 104 days Last activity: 32 days |
| ||
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 <||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people Sesshomaru Tamaranian Level: 118 Posts: 1075/8210 EXP: 18171887 For next: 211027 Since: 03-15-04 From: Canada, w00t! LOL FAD Since last post: 2 hours Last activity: 2 hours |
| ||
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.) |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - A question about the Gameboy instruction set | | | |