The GameBoy CPU Manual talks about restart operations on page 116. Each of these operations push the current address onto the stack, and then jumps to a specific address (0x00
, 0x08
, 0x10
, etc, depending on the opcode). E.g., for the 0xFF
opcode, I'd jump to the address 0x38
(after pushing the current PC onto the stack).
But this makes me run in an infinite loop with a Tetris ROM... Which has a 0xFF
opcode in the address 0x38
. So the loop here and the overflow is pretty obvious. This is how that part of the dump looks like:
00000000 c3 0c 02 00 00 00 00 00 c3 0c 02 ff ff ff ff ff |................|
00000010 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
00000020 ff ff ff ff ff ff ff ff 87 e1 5f 16 00 19 5e 23 |.........._...^#|
00000030 56 d5 e1 e9 ff ff ff ff ff ff ff ff ff ff ff ff |V...............|
00000040 c3 7e 01 ff ff ff ff ff c3 be 26 ff ff ff ff ff |.~........&.....|
00000050 c3 be 26 ff ff ff ff ff c3 5b 00 f5 e5 d5 c5 cd |..&......[......|
00000060 6b 00 3e 01 e0 cc c1 d1 e1 f1 d9 f0 cd ef 78 00 |k.>...........x.|
Am I misunderstanding something? Is the documentation wrong or inaccurate?