Do not set ABH/ABL in push/pull to avoid wrong PC being pushed if IRQ follows

This commit is contained in:
Arlet
2011-09-27 07:14:23 +02:00
parent b1472bfe31
commit 9b58705596

11
cpu.v
View File

@@ -410,10 +410,13 @@ always @*
* This can be used to keep the current address, freeing up the original * This can be used to keep the current address, freeing up the original
* source of the address, such as the ALU or DI. * source of the address, such as the ALU or DI.
*/ */
always @(posedge clk) begin always @(posedge clk)
ABL <= AB[7:0]; if( state != PUSH0 && state != PUSH1 &&
ABH <= AB[15:8]; state != PULL0 && state != PULL1 && state != PULL2 )
end begin
ABL <= AB[7:0];
ABH <= AB[15:8];
end
/* /*
* Data Out MUX * Data Out MUX