correct code address is returned to assembler if a von Neumann cpu is simulated.

This commit is contained in:
hneemann 2017-03-20 17:39:10 +01:00
parent b46f71f01b
commit a90052b2d3

View File

@ -81,9 +81,6 @@ public class ROM extends Node implements Element {
public void readInputs() throws NodeException {
addr = (int) addrIn.getValue();
sel = selIn.getBool();
if (sel) {
romAddr = addr;
}
}
@Override
@ -107,6 +104,11 @@ public class ROM extends Node implements Element {
throw new NodeException(e.getMessage(), this, null);
}
}
if (isProgramMemory)
model.addObserver(event -> {
if (event == ModelEvent.STEP && sel)
romAddr = addr;
});
}
/**