]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - core/insn_add_hl.v
Ethernet TX support
[fpgaboy.git] / core / insn_add_hl.v
index bfd6880a1ea3d53889af9c1bc9500109711817dd..66a047fddceb26c5f45038747cc09dae63941d2c 100644 (file)
 `ifdef WRITEBACK
        `INSN_ADD_HL: begin
                case (cycle)
-               0:      {tmp,tmp2} <= `_HL + {tmp,tmp2};
                1:      begin
                                `_F <=  { /* Z */ `_F[7],
                                          /* N */ 1'b0,
-                                         /* H */ (({`_HL} + {tmp,tmp2}) & 16'h1000) ? 1'b1 : 1'b0,
+                                         /* H */ (({1'b0,`_H[3:0],`_L} + {1'b0,tmp[3:0],tmp2}) & 13'h1000) ? 1'b1 : 1'b0,
                                          /* C */ (({1'b0,`_HL} + {1'b0,tmp,tmp2}) & 17'h10000) ? 1'b1 : 1'b0,
                                          `_F[3:0]
                                        };
-                               `_HL <= {tmp, tmp2};
+                               `_HL <= `_HL + {tmp, tmp2};
                        end
                endcase
        end
This page took 0.02038 seconds and 4 git commands to generate.