Skip to content

Commit

Permalink
Add RST addresses to pseudocode
Browse files Browse the repository at this point in the history
  • Loading branch information
Gekkio committed Jan 7, 2024
1 parent 3106c13 commit f079243
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chapter/cpu/instruction-set.typ
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,8 @@ if opcode == 0xD9:
next_addr: [`n`],
pseudocode: ```python
opcode = read_memory(addr=PC); PC = PC + 1
if opcode in [0xC7, 0xD7, 0xE7, 0xF7, 0xCF, 0xDF, 0xEF, 0xFF]:
if opcode in [0xC7, 0xCF, 0xD7, 0xDF, 0xE7, 0xEF, 0xF7, 0xFF]:
# address 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38
n = rst_address(opcode)
SP = SP - 1
write_memory(addr=SP, data=msb(PC)); SP = SP - 1
Expand Down

0 comments on commit f079243

Please # to comment.