These are the loudspeaker, cassette interface and the keyboard,
and all are controlled by the ULA. The cassette and the loudspeaker
are both handled by a single connection and are in a sense,
a single I/O device.
Instead of assigning address spaces to each device, they are
instead assigned a particular bit of an address. They are
active when the bit is zero.
Bit 0: ULA keyboard/loudspeaker/cassette
Bit 1: Not used
Bit 2: ZX Printer
Bit 3: Microdrives and Interface 1
Bit 4: Microdrives and Interface 1
Bits 5,6,7: For special uses
Bits 8 - 15: Used to determine which column of the keyboard
is being used.
Thus, any I/O address that has bit 2 set to zero selects
the printer. When inputting data, bit 0 represents the keyboard
and when outputting data, bit 0 represents the loudspeaker
and cassette. As discussed next.
This gives us a bit-pattern of 0000000011111110 for the ULA
(or 254 in decimal). This is found by bit 0 zero representing
the ULA, bits 1 to 7 as the devices (set to 1 for off), and
bits 8 to 15 are used by the keyboard.
|