From e4fd7c1673a5a587a2eb8d4c2b8e22d921b949b9 Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Wed, 21 May 2008 23:54:11 -0400 Subject: [PATCH] Fix flags bugs in tests 6 and 8 --- core/insn_alu_a.v | 8 ++++---- core/insn_alu_ext.v | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/insn_alu_a.v b/core/insn_alu_a.v index 5fbadee..36bac34 100644 --- a/core/insn_alu_a.v +++ b/core/insn_alu_a.v @@ -33,19 +33,19 @@ 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]; diff --git a/core/insn_alu_ext.v b/core/insn_alu_ext.v index 1985586..5ae8fe8 100644 --- a/core/insn_alu_ext.v +++ b/core/insn_alu_ext.v @@ -22,7 +22,7 @@ tmp[7]}; assign rr = {`_F[4],tmp[7:1]}; - assign rrf = {({tmp[4],tmp[7:1]} == 0 ? 1'b1 : 1'b0), + assign rrf = {({`_F[4],tmp[7:1]} == 0 ? 1'b1 : 1'b0), 2'b0, tmp[0]}; -- 2.43.0