`include "insn_bit.v"
`include "insn_alu_ext.v"
`include "insn_add_hl.v"
+`include "insn_ldhl_sp_imm8.v"
+`include "insn_add_sp_imm8.v"
--- /dev/null
+`define INSN_ADD_SP_IMM8 9'b011101000
+
+`ifdef EXECUTE
+ `INSN_ADD_SP_IMM8: begin
+ case (cycle)
+ 0: begin
+ `EXEC_INC_PC
+ end
+ 1: begin
+ `EXEC_READ(`_PC)
+ end
+ 3: begin
+ `EXEC_NEWCYCLE
+ `EXEC_INC_PC
+ end
+ endcase
+ end
+`endif
+
+`ifdef WRITEBACK
+ `INSN_ADD_SP_IMM8: begin
+ case (cycle)
+ 2: `_HL <= `_SP + {rdata[7] ? 8'hFF : 8'h00, rdata};
+ endcase
+ end
+`endif
--- /dev/null
+`define INSN_LDHL_SP_IMM8 9'b011111000
+
+`ifdef EXECUTE
+ `INSN_LDHL_SP_IMM8: begin
+ case (cycle)
+ 0: begin
+ `EXEC_INC_PC
+ end
+ 1: begin
+ `EXEC_READ(`_PC)
+ end
+ 2: begin
+ `EXEC_NEWCYCLE
+ `EXEC_INC_PC
+ end
+ endcase
+ end
+`endif
+
+`ifdef WRITEBACK
+ `INSN_LDHL_SP_IMM8: begin
+ case (cycle)
+ 2: `_HL <= `_SP + {rdata[7] ? 8'hFF : 8'h00, rdata};
+ endcase
+ end
+`endif
0001 0000 STOP
0111 0110 HALT Danger! Helvetica!
1100 1011 - - - see two-byte opcodes below
-1110 1000 ADD SP, imm8
-1111 1000 LDHL SP, imm8 load SP+n (signed n) into HL
*****************************