操作码 0xE9 (JP HL) 和 0xF8 (LD HL,SP+r8) 有什么作用?

What do opcodes 0xE9 (JP HL) and 0xF8 (LD HL,SP+r8) do?

我想我正在努力正确定义以下不明确的操作码:LD HL,SP+r8JP (HL) 操作码(分别为 0xE90xF8

在我的实现中,LD HL,SP+r8HL设置为SP+r8的值,但我感觉这可能与从RAM加载内存有关。 JP (HL),我已经 PUSH 将 PC 放入堆栈并将程序计数器设置为 HL 的值(类似于 JP a16,除了 HL 的值),但我已经看了几个论坛好像说的不对。

任何对这些指令的作用的澄清都会很好,因为我现在很迷茫。

In my implementation, LD HL,SP+r8 sets HL to the value of SP+r8, but I have a feeling that it may be to do with loading memory from RAM.

没有。它只需要一个 8 位立即数,对其进行符号扩展,将 SP 的值添加到它并将结果存储在 HL.

JP (HL), I have as PUSHing the PC onto the stack and setting the Program Counter to the value of HL (like JP a16, except with the value of HL)

JP 不会将当前的 PC 压入堆栈(也许您将其与 CALL 混淆了)。 JP (HL) 所做的只是 PC = HL.