Reset Disk Bytes Read

If the disk is finished reading or writing, then reset the "disk bytes read" to 0. More formally,

if the following are true:
  • value of cell 49 at time t = 1
  • disk bytes read at time t = value of cell 46 at time t

then disk bytes read at time (t + 1) = 0

Cell #66 indicates the number of values to copy, so if the disk bytes read is equal to the value in cell #66, then the disk is finished. Reset "disk bytes read" to 0 so that the next disk read or write operation starts with value 0.

For example, if the following are true:

  • value of cell 49 at time 108 = 1
  • disk bytes read at time 108 = 3
  • value of cell 46 at time 108 = 3

then disk bytes read at time (108 + 1) = 0

Thus, the "disk bytes read" count at time 109 is 0.

Try running the simulator below to see the disk "bytes read" count reset to 0 after it is done writing data.

Time: 0
LW Computer IO Simulator

Comments

Please log in to add comments