- 0: begin
- wr <= 1;
- address <= {registers[`REG_SPH],registers[`REG_SPL]}-1;
- case (opcode[5:4])
- `INSN_stack_AF: wdata <= registers[`REG_A];
- `INSN_stack_BC: wdata <= registers[`REG_B];
- `INSN_stack_DE: wdata <= registers[`REG_D];
- `INSN_stack_HL: wdata <= registers[`REG_H];
- endcase
- end
- 1: begin
- wr <= 1;
- address <= {registers[`REG_SPH],registers[`REG_SPL]}-2;
- case (opcode[5:4])
- `INSN_stack_AF: wdata <= registers[`REG_F];
- `INSN_stack_BC: wdata <= registers[`REG_C];
- `INSN_stack_DE: wdata <= registers[`REG_E];
- `INSN_stack_HL: wdata <= registers[`REG_L];
- endcase
- end
+ 0: case (opcode[5:4])
+ `INSN_stack_AF: `EXEC_WRITE(`_SP - 1, `_A)
+ `INSN_stack_BC: `EXEC_WRITE(`_SP - 1, `_B)
+ `INSN_stack_DE: `EXEC_WRITE(`_SP - 1, `_D)
+ `INSN_stack_HL: `EXEC_WRITE(`_SP - 1, `_H)
+ endcase
+ 1: case (opcode[5:4])
+ `INSN_stack_AF: `EXEC_WRITE(`_SP - 1, `_F)
+ `INSN_stack_BC: `EXEC_WRITE(`_SP - 1, `_C)
+ `INSN_stack_DE: `EXEC_WRITE(`_SP - 1, `_E)
+ `INSN_stack_HL: `EXEC_WRITE(`_SP - 1, `_L)
+ endcase