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

5
cpu.v
View File

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