X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/81358c71b258a72a2777bba0a0b4a82a7cae298a..58d068d423c00a843a9f1a761503ed685a30a27c:/insn_ld_reg_imm16.v diff --git a/insn_ld_reg_imm16.v b/insn_ld_reg_imm16.v index b9bd84e..cf79aaa 100644 --- a/insn_ld_reg_imm16.v +++ b/insn_ld_reg_imm16.v @@ -1,16 +1,10 @@ `ifdef EXECUTE `INSN_LD_reg_imm16: begin - `EXEC_INC_PC; + `EXEC_INC_PC case (cycle) - 0: begin - `EXEC_NEXTADDR_PCINC; - rd <= 1; - end - 1: begin - `EXEC_NEXTADDR_PCINC; - rd <= 1; - end - 2: begin `EXEC_NEWCYCLE; end + 0: `EXEC_READ(`_PC + 1) + 1: `EXEC_READ(`_PC + 1) + 2: `EXEC_NEWCYCLE endcase end `endif @@ -21,18 +15,18 @@ 0: begin /* */ end 1: begin case (opcode[5:4]) - `INSN_reg16_BC: registers[`REG_C] <= rdata; - `INSN_reg16_DE: registers[`REG_E] <= rdata; - `INSN_reg16_HL: registers[`REG_L] <= rdata; - `INSN_reg16_SP: registers[`REG_SPL] <= rdata; + `INSN_reg16_BC: `_C <= rdata; + `INSN_reg16_DE: `_E <= rdata; + `INSN_reg16_HL: `_L <= rdata; + `INSN_reg16_SP: `_SPL <= rdata; endcase end 2: begin case (opcode[5:4]) - `INSN_reg16_BC: registers[`REG_B] <= rdata; - `INSN_reg16_DE: registers[`REG_D] <= rdata; - `INSN_reg16_HL: registers[`REG_H] <= rdata; - `INSN_reg16_SP: registers[`REG_SPH] <= rdata; + `INSN_reg16_BC: `_B <= rdata; + `INSN_reg16_DE: `_D <= rdata; + `INSN_reg16_HL: `_H <= rdata; + `INSN_reg16_SP: `_SPH <= rdata; endcase end endcase