Implemented BIT $n, r

First of the CB prefixed opcodes.
This commit is contained in:
2021-02-19 21:53:13 +00:00
parent 8c65e4a669
commit 93912e2089
5 changed files with 59 additions and 26 deletions

View File

@@ -10,6 +10,7 @@ package cpu_pkg;
ST2_EXEC,
ST2_DEC,
ST3_DEC,
ST3_EXEC,
ST4_EXEC
} state_t;
@@ -19,7 +20,9 @@ package cpu_pkg;
REG8_D = 3'h02,
REG8_E = 3'h03,
REG8_H = 3'h04,
REG8_L = 3'h05
REG8_L = 3'h05,
REG8_PHL = 3'h06,
REG8_A = 3'h07
} reg8_t;
typedef enum logic [1:0] {
@@ -29,15 +32,16 @@ package cpu_pkg;
REG16_SP_AF = 2'h03
} reg16_t;
typedef enum logic [2:0] {
ALU_OP_ADD = 3'h00,
ALU_OP_ADC = 3'h01,
ALU_OP_SUB = 3'h02,
ALU_OP_SBC = 3'h03,
ALU_OP_AND = 3'h04,
ALU_OP_XOR = 3'h05,
ALU_OP_OR = 3'h06,
ALU_OP_CP = 3'h07
typedef enum logic [3:0] {
ALU_OP_ADD = 4'h00,
ALU_OP_ADC = 4'h01,
ALU_OP_SUB = 4'h02,
ALU_OP_SBC = 4'h03,
ALU_OP_AND = 4'h04,
ALU_OP_XOR = 4'h05,
ALU_OP_OR = 4'h06,
ALU_OP_CP = 4'h07,
ALU_OP_BIT = 4'h08
} alu_op_t;
typedef enum logic [1:0] {
@@ -49,12 +53,13 @@ package cpu_pkg;
typedef enum {
OP_SRC_A,
OP_SRC_REG8,
OP_SRC_OPERAND8,
OP_SRC_OPERAND16,
OP_SRC_REG16
} op_src_t;
typedef enum {
OP_DEST_A,
OP_DEST_REG8,
OP_DEST_REG16
} op_dest_t;