X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/eaec80f24007825c7abba2affd76f74d520ce4cd..99b9687942367fd256a797bcd1f67fec07f92a37:/core/insn_ldhl_sp_imm8.v diff --git a/core/insn_ldhl_sp_imm8.v b/core/insn_ldhl_sp_imm8.v index 688465a..3b017a3 100644 --- a/core/insn_ldhl_sp_imm8.v +++ b/core/insn_ldhl_sp_imm8.v @@ -20,7 +20,15 @@ `ifdef WRITEBACK `INSN_LDHL_SP_IMM8: begin case (cycle) - 2: `_HL <= `_SP + {rdata[7] ? 8'hFF : 8'h00, rdata}; + 2: begin + `_HL <= `_SP + {rdata[7] ? 8'hFF : 8'h00, rdata}; + `_F <= { + 2'b00, + (({1'b0,`_SPL[3:0]} + {1'b0,rdata[3:0]}) & 5'h10) ? 1'b1 : 1'b0, + (({1'b0,`_SPL} + {1'b0,rdata}) & 9'h100) ? 1'b1 : 1'b0, + `_F[3:0] + }; + end endcase end `endif