X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/9e1c03b633deae6254b6df312a48eba6047e266e..refs/heads/master:/core/insn_add_sp_imm8.v diff --git a/core/insn_add_sp_imm8.v b/core/insn_add_sp_imm8.v index 3350bdc..ff5da37 100644 --- a/core/insn_add_sp_imm8.v +++ b/core/insn_add_sp_imm8.v @@ -20,7 +20,15 @@ `ifdef WRITEBACK `INSN_ADD_SP_IMM8: begin case (cycle) - 2: `_SP <= `_SP + {rdata[7] ? 8'hFF : 8'h00, rdata}; + 2: begin + `_SP <= `_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