X-Git-Url: http://git.joshuawise.com/fpgaboy.git/blobdiff_plain/3ad960bdb71efcbb1dfd436163085da0d70eb699..5c33c5c001049403ac33d71bfbe0115c318c1b4c:/insn_ldh_ac.v diff --git a/insn_ldh_ac.v b/insn_ldh_ac.v index 146f10b..a2ff5cc 100644 --- a/insn_ldh_ac.v +++ b/insn_ldh_ac.v @@ -1,18 +1,13 @@ `ifdef EXECUTE `INSN_LDH_AC: begin case (cycle) - 0: begin - address <= {8'hFF,registers[`REG_C]}; - if (opcode[4]) begin // LD A,(C) - rd <= 1; - end else begin - wr <= 1; - wdata <= registers[`REG_A]; - end - end + 0: if (opcode[4]) // LD A,(C) + `EXEC_READ(({8'hFF,`_C})) + else + `EXEC_WRITE(({8'hFF,`_C}), `_A) 1: begin - `EXEC_NEWCYCLE; - `EXEC_INC_PC; + `EXEC_NEWCYCLE + `EXEC_INC_PC end endcase end @@ -22,8 +17,7 @@ `INSN_LDH_AC: begin case (cycle) 0: begin /* Type F */ end - 1: if (opcode[4]) - registers[`REG_A] <= rdata; + 1: if (opcode[4]) `_A <= rdata; endcase end `endif