Skip to content

Commit

Permalink
expand "RET" stack operations
Browse files Browse the repository at this point in the history
  • Loading branch information
koron committed Apr 18, 2024
1 parent 79b5239 commit c167cb3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions op_callret.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ func oopRETN(cpu *CPU) {
}

func oopRET(cpu *CPU) {
cpu.PC = cpu.readU16(cpu.SP)
cpu.SP += 2
//cpu.PC = cpu.readU16(cpu.SP)
//cpu.SP += 2
l := cpu.Memory.Get(cpu.SP)
cpu.SP++
h := cpu.Memory.Get(cpu.SP)
cpu.SP++
cpu.PC= (uint16(h) << 8) | uint16(l)
}

//////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit c167cb3

Please sign in to comment.