I/O - BCL Molecular 18

BCL Molecular 18
Title
Go to content
Device I/O Instructions

(Typically never used by an application programmer, but used extensively in the O/S to control all peripherals such as terminals, printers and disk drives.  I suspect they are also used for later functions such as bank switching and the EP's real-time clock.)

I/O devices may have up to three 17-bit Device Registers, accessible to the programmer, implemented by their hardware interface. By convention, Device Register 3 is the Status Register.

All I/O devices also have a BUSY flag and a DONE flag.
Start a device by setting its BUSY flag (after loading relevant device registers).  The device signals an INTERRUPT REQUEST whilst its DONE flag is set.

(The MASK instruction can/could be used to limit which devices generate an interrupt.  Not sure if this is supported post the Mk 4)

1716151413121110987654321
000011=A-Reg
0=B-Reg
Function or
Skip Condition
ModeDevice Code


B9:B7MnemonicAction
1DATI1Read Device Register 1
2DATI2Read Device Register 2
3DATI3Read Device Register 3
4DATO1Write Device Register 1
5DATO2Write Device Register 2
6DATO3Write Device Register 3
7SKIPTest for SKIP CONDITION

Function or Skip Condition (B11:B10)


B11:B10FunctionSKIP IF
0No OperationBUSY
1START (Set BUSY, Clear DONE)NOT BUSY
2STOP (Clear BUSY, Clear DONE)DONE
3IOPLS (Input/Output Pulse)NOT DONE

Device Codes (B6:B1)

InOutStandard Assignment
2060Alpha-numeric Keyboard
5040Visual Display Unit
 30Line Printer
 34Serial Printer
6667IBM I/O Writer
1133Paper Tape
7070Disc

Example code to read a single sector from disk (actually part of the LOS bootstrap)

(The bootstrap is deliberatly simple for toggling in.  It loads one sector starting at sector 0 into core starting at address 0.   Interrupts are off on power-up, so the bootstrap sits in a tight loop just after this waiting to be overwritten by a jump to an lower address.  The sector is still coming in to core via DMA.)

010670DATO3BLoad sector No to reg 3
010570DATO2BLoad target core address to reg 2
011470DATO1B SBCDLoad reg 1 and start


Example code to send a single character to a terminal

Example code to read a single character from a terminal




(C) 2022 Kevin Murrell & The National Museum of Computing
Back to content