Keyboard Interrupts the Computer

When the interrupt cell #0 is set to 1, the PC is set to 1. More formally,

if interrupt at index: 0 time: t = 1, then the PC at time (t + 1) = 1

When the interrupt is set, regardless of which instruction was being executed at the time, the computer will execute instruction #1 next. It is upto the programmer to ensure that the keyboard action handling instructions start at instruction #1.

For example, if interrupt at index: 0 time: 7 = 1, then the PC at time (7 + 1) = 1

Since 7 + 1 = 8,

the PC at time 8 = 1

Try running the simulator below and click any key to see the PC change to 1.

Time: 0
LW Computer IO Simulator

Comments

Please log in to add comments