TAOCP 1.4.4 Exercise 1
(a) Yes.
Section 1.4.4: Input and Output
Exercise 1. [05] (a) Would sequence (3) still be correct if the MOVE instructions were placed before the JBUS instruction instead of after it? (b) What if the MOVE instructions were placed after the IN command?
Verified: no
Solve time: -
(a) Yes. If the two MOVE instructions are executed before JBUS *(5), they merely copy the contents of locations 2000-2099 into locations 1000-1099 while the tape unit is still completing the previous input. The subsequent JBUS then waits until that input has finished before execution continues. Since the copied block was already completely present in 2000-2099 before the sequence began, the data transferred by the MOVE instructions are correct, and the final IN 2000(5) is not issued until the previous input operation has terminated. Hence the sequence remains correct.
(b) No. If the MOVE instructions are placed after IN 2000(5), the new input operation begins immediately and starts writing into locations 2000-2099. The subsequent MOVE instructions then attempt to copy data from the same locations while they are being overwritten by the tape unit. The block that was supposed to be transferred to locations 1000-1099 may therefore be partially replaced by the next block before the copying is complete. Thus the sequence is not correct.