+ `INSN_PUSH_reg: begin /* PUSH is 16 cycles! */
+ case (cycle)
+ 0: begin
+ {registers[`REG_SPH],registers[`REG_SPL]} =
+ {registers[`REG_SPH],registers[`REG_SPL]} - 1;
+ cycle <= 1;
+ end
+ 1: begin
+ {registers[`REG_SPH],registers[`REG_SPL]} =
+ {registers[`REG_SPH],registers[`REG_SPL]} - 1;
+ cycle <= 2;
+ end
+ 2: cycle <= 3;
+ 3: cycle <= 0;
+ endcase
+ end
+ `INSN_POP_reg: begin /* POP is 12 cycles! */
+ case (cycle)
+ 0: begin
+ cycle <= 1;
+ {registers[`REG_SPH],registers[`REG_SPL]} =
+ {registers[`REG_SPH],registers[`REG_SPL]} + 1;
+ end
+ 1: begin
+ case (opcode[5:4])
+ `INSN_stack_AF: registers[`REG_F] <= rdata;
+ `INSN_stack_BC: registers[`REG_C] <= rdata;
+ `INSN_stack_DE: registers[`REG_E] <= rdata;
+ `INSN_stack_HL: registers[`REG_L] <= rdata;
+ endcase
+ {registers[`REG_SPH],registers[`REG_SPL]} =
+ {registers[`REG_SPH],registers[`REG_SPL]} + 1;
+ cycle <= 2;
+ end
+ 2: begin
+ case (opcode[5:4])
+ `INSN_stack_AF: registers[`REG_A] <= rdata;
+ `INSN_stack_BC: registers[`REG_B] <= rdata;
+ `INSN_stack_DE: registers[`REG_D] <= rdata;
+ `INSN_stack_HL: registers[`REG_H] <= rdata;
+ endcase
+ cycle <= 0;
+ end
+ endcase
+ end