assign busdata = buswr ? buswdata : 8'bzzzzzzzz;
initial begin
- registers[ 0] = 0;
- registers[ 1] = 0;
- registers[ 2] = 0;
- registers[ 3] = 0;
- registers[ 4] = 0;
- registers[ 5] = 0;
- registers[ 6] = 0;
- registers[ 7] = 0;
- registers[ 8] = 0;
- registers[ 9] = 0;
- registers[10] = 0;
- registers[11] = 0;
+ registers[ 0] <= 0;
+ registers[ 1] <= 0;
+ registers[ 2] <= 0;
+ registers[ 3] <= 0;
+ registers[ 4] <= 0;
+ registers[ 5] <= 0;
+ registers[ 6] <= 0;
+ registers[ 7] <= 0;
+ registers[ 8] <= 0;
+ registers[ 9] <= 0;
+ registers[10] <= 0;
+ registers[11] <= 0;
end
always @(posedge clk)
`INSN_PUSH_reg: begin /* PUSH is 16 cycles! */
case (cycle)
0: begin
- {registers[`REG_SPH],registers[`REG_SPL]} =
+ {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]} <=
{registers[`REG_SPH],registers[`REG_SPL]} - 1;
cycle <= 2;
end
case (cycle)
0: begin
cycle <= 1;
- {registers[`REG_SPH],registers[`REG_SPL]} =
+ {registers[`REG_SPH],registers[`REG_SPL]} <=
{registers[`REG_SPH],registers[`REG_SPL]} + 1;
end
1: begin
`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]} <=
{registers[`REG_SPH],registers[`REG_SPL]} + 1;
cycle <= 2;
end