fix tests 9 and 10
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Thu, 22 May 2008 04:26:44 +0000 (00:26 -0400)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Thu, 22 May 2008 04:26:44 +0000 (00:26 -0400)
broken-tests
core/insn_add_hl.v
core/insn_add_sp_imm8.v
core/insn_ldhl_sp_imm8.v

index 31f155e..5ef0ec7 100644 (file)
@@ -17,12 +17,5 @@ TEST 07: Immediate insns
 TEST 08: Register insns
 
 TEST 09: BC/DE/HL arith
-09 (ADD HL, BC)
-19 (ADD HL, DE)
 
 TEST 10: SP/HL instructions
-39 (ADD HL, SP)
-E8 01 (ADD SP, 1)
-E8 FF (ADD SP, -1)
-F8 01 (LD HL, SP+1)
-F8 FF (LD HL, SP-1)
\ No newline at end of file
index 6bd7e7a..66a047f 100644 (file)
@@ -23,7 +23,7 @@
                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]
                                        };
index 3350bdc..ff5da37 100644 (file)
 `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
index 688465a..3b017a3 100644 (file)
 `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
This page took 0.049541 seconds and 4 git commands to generate.