]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - core/insn_alu8.v
Fix bugs in SCF and CCF
[fpgaboy.git] / core / insn_alu8.v
index 2921b1858a3e9fdffe1b001557e3527a8e3886c4..26fc77eca45614d1c26c0920570413a83f959b93 100644 (file)
@@ -1,3 +1,6 @@
+`define INSN_ALU8              9'b010xxxxxx    // 10 xxx yyy
+`define INSN_ALU8IMM           9'b011xxx110
+
 `ifdef EXECUTE
        `INSN_ALU8,`INSN_ALU8IMM: begin
                if ((opcode[7:6] == 2'b11) && (cycle == 0)) begin       // alu8imm
 `ifdef EXECUTE
        `INSN_ALU8,`INSN_ALU8IMM: begin
                if ((opcode[7:6] == 2'b11) && (cycle == 0)) begin       // alu8imm
                        end
                        `INSN_alu_AND: begin
                                `_A <= `_A & tmp;
                        end
                        `INSN_alu_AND: begin
                                `_A <= `_A & tmp;
-                               `_F <=  { /* Z */ ((`_A & tmp) == 0) ? 1'b1 : 1'b0,
+                               `_F <=  { /* Z */ ((`_A & tmp) == 8'b0) ? 1'b1 : 1'b0,
                                          3'b010,
                                          `_F[3:0]
                                        };
                        end
                        `INSN_alu_OR: begin
                                `_A <= `_A | tmp;
                                          3'b010,
                                          `_F[3:0]
                                        };
                        end
                        `INSN_alu_OR: begin
                                `_A <= `_A | tmp;
-                               `_F <=  { /* Z */ ((`_A | tmp) == 0) ? 1'b1 : 1'b0,
+                               `_F <=  { /* Z */ ((`_A | tmp) == 8'b0) ? 1'b1 : 1'b0,
                                          3'b000,
                                          `_F[3:0]
                                        };
                        end
                        `INSN_alu_XOR: begin
                                `_A <= `_A ^ tmp;
                                          3'b000,
                                          `_F[3:0]
                                        };
                        end
                        `INSN_alu_XOR: begin
                                `_A <= `_A ^ tmp;
-                               `_F <=  { /* Z */ ((`_A ^ tmp) == 0) ? 1'b1 : 1'b0,
+                               `_F <=  { /* Z */ ((`_A ^ tmp) == 8'b0) ? 1'b1 : 1'b0,
                                          3'b000,
                                          `_F[3:0]
                                        };
                                          3'b000,
                                          `_F[3:0]
                                        };
This page took 0.027308 seconds and 4 git commands to generate.