]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - core/insn_alu_a.v
Fix flags bugs in tests 6 and 8
[fpgaboy.git] / core / insn_alu_a.v
index a51f8bb0adb2c84fd895768748b973d4c8b7e7b9..36bac34c15f711abb8b8a46a54c9b2e8d1441967 100644 (file)
                case(opcode[5:3])
                `INSN_alu_RLCA: begin
                        `_A <= {`_A[6:0],`_A[7]};
-                       `_F <= {`_F[7:5],`_A[7],`_F[3:0]};
+                       `_F <= {3'b0,`_A[7],`_F[3:0]};
                end
                `INSN_alu_RRCA: begin
                        `_A <= {`_A[0],`_A[7:1]};
-                       `_F <= {`_F[7:5],`_A[0],`_F[3:0]};
+                       `_F <= {3'b0,`_A[0],`_F[3:0]};
                end
                `INSN_alu_RLA: begin
                        `_A <= {`_A[6:0],`_F[4]};
-                       `_F <= {`_F[7:5],`_A[7],`_F[3:0]};
+                       `_F <= {3'b0,`_A[7],`_F[3:0]};
                end
                `INSN_alu_RRA: begin
                        `_A <= {`_F[4],`_A[7:1]};
-                       `_F <= {`_F[7:5],`_A[0],`_F[3:0]};
+                       `_F <= {3'b0,`_A[0],`_F[3:0]};
                end
                `INSN_alu_DAA: begin
                        `_A <= daa_tmp[7:0];
                        `_F <= {`_F[7],1'b1,1'b1,`_F[4:0]};
                end
                `INSN_alu_SCF: begin
-                       `_F <= {`_F[7:5],1'b1,`_F[3:0]};
+                       `_F <= {`_F[7],3'b001,`_F[3:0]};
                end
                `INSN_alu_CCF: begin
-                       `_F <= {`_F[7:5],~`_F[4],`_F[3:0]};
+                       `_F <= {`_F[7],2'b00,~`_F[4],`_F[3:0]};
                end
                endcase
        end
This page took 0.025551 seconds and 4 git commands to generate.