Lec 7c ProgrammingIO
Lec 7c ProgrammingIO
Physical memory locations for addresses FE00 - FFFF are not accessible.
The VRAM is an I/O device. Writing to the range of addresses C000-FDFF sets pixels on the
display device.
1. Keypress 'c':
KBDR <== x0063
POLL:
LDI R1, KBSR
BRn Ready
BRnzp POLL
Ready:
LDI R0, KBDR
...
KBSR: .FILL xFE00
KBDR: .FILL xFE02
TRAP pseudonymn Description (PP, Append. A.4)
-------------- ---------- ---------------------------------------------------------
TRAP x25 HALT jump to OS w/ message, loops in OS forever.
TRAP x20 GETC one char input, keyboard data ==> R0[7:0] (clears R0 first).
TRAP x21 OUT one char output, R0[7:0] ==> display; ignores big-end byte, R0[15:8].
TRAP x22 PUTS string output, Mem[R0++] ==> display until x0000. 1 char per word.
TRAP x23 IN one char input w/ prompt, ala GETC.
TRAP x24 PUTSP same as PUTS, but packed (2 chars per word, little-end byte then big-end byte).
in R4, x0D
out R4, xC7
Control-Bus signal:
0, access memory;
1, access I/O device (but uses same address wires)