private long addr = 0;
private boolean writing = false;
+ private Queue<Long> toDispatch = new LinkedList<Long>();
public void service() {
-/*
- if (box_inCBD.dataReadyForShip()) {
+
+ if (toDispatch.size() > 0) {
+ //if (!box_out.readyForDataFromShip()) return;
+ //box_out.addDataFromShip(toDispatch.remove());
+ getInterpreter().dispatch(getInterpreter().readInstruction(toDispatch.remove(), getDock("out")));
+ }
+
+ if (box_inCBD.dataReadyForShip() && box_out.readyForDataFromShip()) {
long val = box_inCBD.removeDataForShip();
long addr = val >> 6;
long size = val & 0x3f;
- dispatch((int)addr, (int)size);
+ for(int i=0; i<size; i++)
+ toDispatch.add(readMem((int)(addr+i)));
}
-*/
if (count > 0) {
if (writing) {
if (box_inDataWrite.dataReadyForShip() && box_out.readyForDataFromShip()) {
writing = false;
} else if (box_inAddrWrite.dataReadyForShip()) {
-// addr = box_inAddrWrite.peekPacketForShip().value;
- box_inAddrWrite.removeDataForShip();
+ addr = box_inAddrWrite.removeDataForShip();
stride = 0;
count = 1;
writing = true;