Obrázek 63.15. Keyboard/Reader Instruction Format
0 1 2 3 4 5 6 7 8 9 10 11 +---+---+---+---+---+---+---+---+---+---+---+---+ | 1 1 0 | 0 0 0 0 1 1 | | +---+---+---+---+---+---+---+---+---+---+---+---+ ^ ^ ^-- KSF | +------ KCC +---------- KRS 0 0 0 KCF 1 0 1 KIE 1 1 0 KRB
Tabulka 63.14. Příkazy pro práci s konzolou
mnemo | oktalově | binárně | popis |
---|---|---|---|
KCF | 6030 | 110 000 011 000 | Keyboard Clear Flags |
KSF | 6031 | 110 000 011 001 | Skip on Keaboard Flag |
KCC | 6032 | 110 000 011 010 | Clear Keyboard Flag |
KRS | 6034 | 110 000 011 100 | Read Keyboard Buffer Static |
KRB | 6036 | 110 000 011 110 | Read Keyboard Buffer Dynamic |
TLF | 7040 | 111 000 100 000 | Set the printer/punch Flag |
TSF | 7041 | 111 000 100 001 | Skip on Teleprinter Flag |
TCF | 7042 | 111 000 100 010 | Clear Teleprinter Flag |
TPC | 7044 | 111 000 100 100 | Load Teleprinter and Print |
TSK | 7045 | 111 000 100 101 | Skip if reader or printer interrupt Flag |
TLS | 7046 | 111 000 100 110 | Load Teleprinter Sequence |
Příklad 63.2. Čtení jednoho znaku z konzoly
1 / File: db/pdp8.code/keybinput.pal -*- mode:asm; -*- 2 3 0200 *200 4 00200 6032 INPUT, KCC /CLEAR KEYBOARD FLAG 5 00201 4204 JMS LISN /ENTER SUBROUTINE 6 00202 3211 DCA STORE /STORE ASCII CHARACTER 7 00203 7402 HLT 8 9 00204 0000 LISN, 0 /LISN SUBROUTINE 10 00205 6031 KSF /KEYBOARD FLAG RAISED YET? 11 00206 5205 JMP .-1 /NO: CHECK AGAIN 12 00207 6036 KRB /YES: READ THE CHARACTER 13 00210 5604 JMP I LISN /RETURN TO MAINLINE 14 15 00211 0000 STORE, 0 16 $ No detected errors
Obrázek 63.16. Printer/Punch Instruction Format
0 1 2 3 4 5 6 7 8 9 10 11 +---+---+---+---+---+---+---+---+---+---+---+---+ | 1 1 0 | 0 0 0 1 0 0 | | +---+---+---+---+---+---+---+---+---+---+---+---+ ^ ^ ^-- TSF | +------ TCF +---------- TPC 0 0 0 TLF 1 0 1 TSK 1 1 0 TLS
Příklad 63.3. Vytištění jednoho znaku na konzoli
1 / File: db/pdp8.code/printoutput.pal -*- mode:asm; -*- 2 3 0200 *200 4 00200 7300 OUTPUT, CLA CLL /CLEAR ACCUMULATOR AND LINK 5 00201 6046 TLS /RAISE PRINTER FLAG 6 00202 1213 TAD HOLD /GET THE CHARACTER 7 00203 4205 JMS TYPE /ENTER SUBROUTINE 8 00204 7402 HLT 9 10 11 00205 0000 TYPE, 0 /TYPE SUBROUTINE 12 00206 6041 TSF /PRINTER FALG RAISED YET? 13 00207 5206 JMP .-1 /NO: CHECK AGAIN 14 00210 6046 TLS /YES: PRINT THE CHARACTER 15 00211 7300 CLA CLL /CLEAR ACCUMULATOR AND LINK 16 00212 5605 JMP I TYPE /RETURN TO MAINLINE 17 18 00213 0243 HOLD, 243 /STORED ASCII CHARACTER 19 $ No detected errors