3 if ((opcode[2:0] == `INSN_reg_dHL) && (cycle == 0)) begin
4 // fffffffff fuck your shit, read from (HL) :(
6 address <= {registers[`REG_H], registers[`REG_L]};
11 `INSN_reg_A: tmp <= registers[`REG_A];
12 `INSN_reg_B: tmp <= registers[`REG_B];
13 `INSN_reg_C: tmp <= registers[`REG_C];
14 `INSN_reg_D: tmp <= registers[`REG_D];
15 `INSN_reg_E: tmp <= registers[`REG_E];
16 `INSN_reg_H: tmp <= registers[`REG_H];
17 `INSN_reg_L: tmp <= registers[`REG_L];
18 `INSN_reg_dHL: tmp <= rdata;
26 if ((opcode[2:0] == `INSN_reg_dHL) && (cycle == 0)) begin
27 /* Sit on our asses. */
28 end else begin /* Actually do the computation! */
32 registers[`REG_A] + tmp;
34 { /* Z */ ((registers[`REG_A] + tmp) == 0) ? 1'b1 : 1'b0,
36 /* H */ (({1'b0,registers[`REG_A][3:0]} + {1'b0,tmp[3:0]}) >> 4 == 1) ? 1'b1 : 1'b0,
37 /* C */ (({1'b0,registers[`REG_A]} + {1'b0,tmp}) >> 8 == 1) ? 1'b1 : 1'b0,
38 registers[`REG_F][3:0]
43 registers[`REG_A] + tmp + {7'b0,registers[`REG_F][4]};
45 { /* Z */ ((registers[`REG_A] + tmp + {7'b0,registers[`REG_F][4]}) == 0) ? 1'b1 : 1'b0,
47 /* H */ (({1'b0,registers[`REG_A][3:0]} + {1'b0,tmp[3:0]} + {4'b0,registers[`REG_F][4]}) >> 4 == 1) ? 1'b1 : 1'b0,
48 /* C */ (({1'b0,registers[`REG_A]} + {1'b0,tmp} + {8'b0,registers[`REG_F][4]}) >> 8 == 1) ? 1'b1 : 1'b0,
49 registers[`REG_F][3:0]
54 registers[`REG_A] - tmp;
56 { /* Z */ ((registers[`REG_A] - tmp) == 0) ? 1'b1 : 1'b0,
58 /* H */ (({1'b0,registers[`REG_A][3:0]} - {1'b0,tmp[3:0]}) >> 4 == 1) ? 1'b1 : 1'b0,
59 /* C */ (({1'b0,registers[`REG_A]} - {1'b0,tmp}) >> 8 == 1) ? 1'b1 : 1'b0,
60 registers[`REG_F][3:0]
65 registers[`REG_A] - (tmp + {7'b0,registers[`REG_F][4]});
67 { /* Z */ ((registers[`REG_A] - (tmp + {7'b0,registers[`REG_F][4]})) == 0) ? 1'b1 : 1'b0,
69 /* H */ (({1'b0,registers[`REG_A][3:0]} - ({1'b0,tmp[3:0]} + {4'b0,registers[`REG_F][4]})) >> 4 == 1) ? 1'b1 : 1'b0,
70 /* C */ (({1'b0,registers[`REG_A]} - ({1'b0,tmp} + {8'b0,registers[`REG_F][4]})) >> 8 == 1) ? 1'b1 : 1'b0,
71 registers[`REG_F][3:0]
76 registers[`REG_A] & tmp;
78 { /* Z */ ((registers[`REG_A] & tmp) == 0) ? 1'b1 : 1'b0,
80 registers[`REG_F][3:0]
85 registers[`REG_A] | tmp;
87 { /* Z */ ((registers[`REG_A] | tmp) == 0) ? 1'b1 : 1'b0,
89 registers[`REG_F][3:0]
94 registers[`REG_A] ^ tmp;
96 { /* Z */ ((registers[`REG_A] ^ tmp) == 0) ? 1'b1 : 1'b0,
98 registers[`REG_F][3:0]
103 { /* Z */ ((registers[`REG_A] - tmp) == 0) ? 1'b1 : 1'b0,
105 /* H */ (({1'b0,registers[`REG_A][3:0]} - {1'b0,tmp[3:0]}) >> 4 == 1) ? 1'b1 : 1'b0,
106 /* C */ (({1'b0,registers[`REG_A]} - {1'b0,tmp}) >> 8 == 1) ? 1'b1 : 1'b0,
107 registers[`REG_F][3:0]