X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/eaec80f24007825c7abba2affd76f74d520ce4cd..99b9687942367fd256a797bcd1f67fec07f92a37:/core/insn_add_sp_imm8.v?ds=sidebyside 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