Rendering a Character on Screen

When a computer's memory cell #27 is set to 1, The display reads one value in the computer's memory and renders (draws) the value on the screen. Specifically,

if the following are true:
  • value of cell 27 at time t = 1
  • number of characters read at t < value of cell 26 at time t

then display text at x: (cursor x at time t), y: (cursor y at time t), and time: (t + 1) = value of cell (10 + (number of characters read at t)) at time t

The display draws one character at a time, starting from memory cell #10. Cell #26 tells the display how many characters need to be drawn. The display also tracks the number of characters it has drawn so far.

The cursor is the display position. This tells the display where to draw the next character on the screen.

For example, if the following are true:

  • value of cell 10 at time 11 = 107
  • value of cell 26 at time 11 = 1
  • value of cell 27 at time 11 = 1
  • number of characters read at 11 = 0
  • cursor x at time 11 = 2
  • cursor y at time 11 = 0

then display text at x: (cursor x at time 11), y: (cursor y at time 11), and time: (11 + 1) = value of cell (10 + (number of characters read at 11)) at time 11

After some substitutions and simplification, this becomes:

display text at x: 2, y: 0, and time: 12 = 107

click here for the full proof.

Try running the simulator below to see the display draw the memory value on the screen.

Time: 0
LW Computer IO Simulator

Comments

Please log in to add comments