X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/41341eb3bab6479dc763afbe90c7c31a01d6b60f..4c90390a786b738c0dc0b8d55e7cc2d857f625de:/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