Disk Write Finished
If the disk is finished reading or writing, then the disk switches memory #49 to the inactive state. 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 value of cell 49 at time (t + 1) = 0
Cell #46 indicates the number of values to copy, so if the disk bytes read is equal to the value in cell #46, then the disk is finished.
For example,
if the following are true:
- value of cell 46 at time 108 = 3
- value of cell 49 at time 108 = 1
- disk bytes read at time 108 = 3
then value of cell 49 at time (108 + 1) = 0
Thus, the value of cell 49 at time 109 is 0.
Try running the simulator below to see the disk change cell 49 to 0 after it is done writing data.
Time: 0
LW Computer I/O Simulator
Comments
Please log in to add comments