]> Joshua Wise's Git repositories - fpgaboy.git/blobdiff - insn_ldx_ahl.v
Semi-working, but prone to anus, keyboard driver
[fpgaboy.git] / insn_ldx_ahl.v
index a16d6babb8148a5aa304da136d3d40b61c0ec817..a2d2420b166e74d556833ddd2503619d9a920649 100644 (file)
@@ -1,18 +1,13 @@
 `ifdef EXECUTE
        `INSN_LDx_AHL: begin
                case (cycle)
-               0:      begin
-                               address <= {registers[`REG_H],registers[`REG_L]};
-                               if (opcode[3]) begin    // LDx A, (HL)
-                                       rd <= 1;
-                               end else begin
-                                       wr <= 1;
-                                       wdata <= registers[`REG_A];
-                               end
-                       end
+               0:      if (opcode[3])          // LDx A, (HL)
+                               `EXEC_READ(`_HL)
+                       else
+                               `EXEC_WRITE(`_HL, `_A)
                1:      begin
-                               `EXEC_NEWCYCLE;
-                               `EXEC_INC_PC;
+                               `EXEC_NEWCYCLE
+                               `EXEC_INC_PC
                        end
                endcase
        end
                0:      begin /* Type F */ end
                1:      begin
                                if (opcode[3])
-                                       registers[`REG_A] <= rdata;
-                               {registers[`REG_H],registers[`REG_L]} <=
-                                       opcode[4] ? // if set, LDD, else LDI
-                                       ({registers[`REG_H],registers[`REG_L]} - 1) :
-                                       ({registers[`REG_H],registers[`REG_L]} + 1);
+                                       `_A <= rdata;
+                               `_HL <= opcode[4] ? // if set, LDD, else LDI
+                                       (`_HL - 1) :
+                                       (`_HL + 1);
                        end
                endcase
        end
This page took 0.023583 seconds and 4 git commands to generate.