plato:source:plaopl:cpmasc
Table of Contents
CPMASC
Table Of Contents
Source Code
- CPMASC.txt
- CPMASC
- * /--- FILE TYPE = E
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- IDENT AIST3
- ORG 0140H PLATO LOAD ORIGIN
- OFFSET EQU *-0140H
- * ORG 0040H DSN LOAD ORIGIN
- *OFFSET EQU *-0040H
- * JUMP FOR ASCII LOADER RESIDENT IN ROM
- * JP INIT
- START EQU *
- DEFS 0140H-START
- SPACE 15
- * * * * * * * * * * * * * * * * * * * *
- *
- * INFORMATION SYSTEMS TERMINAL 3 (IST-III)
- * ASCII RAM RESIDENT LOAD FILE
- * PROCESSOR...Z80
- *
- * VERSION 02 03/30/81 DSN LOAD FILE 00
- *
- * CC 15632600 CONTROLWARE ID MF401-JO2
- * TLA 15632812
- *
- * CONTAINS THE FOLLOWING CODE.
- * 1. ASCII/PLATO RESIDENT CODE SEE ERS 16042872.
- * 2. ASCII/GRAPHICS RESIDENT CODE SEE ERS 16042873.
- * 3. ASCII/TIMESHARE RESIDENT CODE SEE ERS 16042874.
- *
- * SCREEN COPY IS AVAILABLE IN ALL THREE MODES.
- * COMM LINE PRINT IS AVAILABLE IN TIMESHARE AND
- * GRAPHIC MODES.
- *
- * THIS FILE IS INTENDED TO BE LOADED WITH THE ASCII LOADER.
- * SEE ERS 16042871.
- *
- * * * * * * * * * * * * * * * * * * * *
- SPACE 4
- * COPYRIGHT CONTROL DATA CORPORATION 1980
- * FOR INTERNAL USE ONLY
- * NOT A RELEASED PRODUCT
- EJECT
- * * * * * * * * * * * * * * * * * * * *
- *
- * SWITCH ASSIGNMENTS
- *
- * * * * * * * * * * * * * * * * * * * *
- *
- * FRONT PANEL SWITCHES
- *
- * -CLOSED/ON/0- -OPEN/OFF/1-
- * SE-1 NORMAL LOAD FILE SELECT LOAD FILE
- * SE-2 INTERNAL LOAD SOURCE EXTERNAL LOAD SOURCE
- * SE-3 HOST LOAD SOURCE LOCAL LOAD SOURCE
- * SE-4 SKIP DIAGNOSTICS RUN DIAGNOSTICS
- * SE-5 SKIP KB/TP TEST RUN KB/TP TEST
- * SE-6 LOUD BEEPER SOFT BEEPER
- * SE-7 (NOT USED)
- * SE-8 HALF DUPLEX FULL DUPLEX
- * SE-9 ODD PARITY EVEN PARITY
- * SE-10 PARITY OFF PARITY ON
- *
- * CONFIGURATION SWITCHES
- *
- * -CLOSED/ON/0- -OPEN/OFF/1-
- * S2-1 SWITCHED DTR CONSTANT DTR
- * S2-2 (NOT USED)
- * S2-3 PCN TRANSMIT RATE SELECT
- * S2-4 PCN TRANSMIT RATE SELECT
- * S2-5 PCN TRANSMIT RATE SELECT
- * S2-6 (NOT USED)
- * S2-7 SECONDARY CHAN XMIT PRIMARY CHAN XMIT
- * S2-8 EXIT DIAGNOSTICS LOOP ON DIAGNOSTICS
- * S2-9 NO TOUCH PANEL TOUCH PANEL PRESENT
- * S2-10 16K RAM 32K RAM
- *
- * INTERNAL SWITCHES
- *
- * -CLOSED/ON/0- -OPEN/OFF/1-
- * S5-1 PCN DEFAULT LOAD FILE SELECT BIT 0
- * S5-2 PCN DEFAULT LOAD FILE SELECT BIT 1
- * S5-3 ASCII DEFAULT LOAD FILE SELECT BIT 0
- * S5-4 ASCII DEFAULT LOAD FILE SELECT BIT 1
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * S5-5 (NOT USED)
- * S5-6 DEFAULT ASCII COMM DATA RATE SELECT BIT 0
- * S5-7 DEFAULT ASCII COMM DATA RATE SELECT BIT 1
- * S5-8 DEFAULT ASCII COMM DATA RATE SELECT BIT 2
- * * * * * * * * * * * * * * * * * * * *
- *
- * BIT ASSIGNMENTS FOR INPUT ADDRESSES
- *
- * * * * * * * * * * * * * * * * * * * *
- * INPUT ADDRESS 00 (MAINTENANCE SWITCHES)
- * 7 S2-8 (1=LOOP ON DIAG, 0=EXIT DIAG)
- * 6 S2-9 (1=TP PRESENT, 0=NO TP)
- * 5 S2-10(1=32K RAM, 0=16K RAM)
- * 4 SE-5 (1=DO KB/TP TEST, 0=SKIP KB/TP TEST)
- * 3 SE-4 (1=DO DIAGNOSTICS, 0=SKIP DIAGNOSTICS)
- * 2 SE-3 (1=LOCAL LOAD SOURCE, 0=HOST LOAD SOURCE)
- * 1 SE-2 (1=EXTERNAL LOAD, 0=INTERNAL LOAD)
- * 0 SE-1 (1=SELECT LOAD, 0=NORMAL LOAD)
- * INPUT ADDRESS 01 (KEYBOARD INPUT DATA)
- * 7 KEYBOARD BIT 7, CONTROL BIT (1=ON, 0=OFF)
- * 6 KEYBOARD BIT 6
- * 5 KEYBOARD BIT 5, SHIFT BIT (1=ON, 0=OFF)
- * 4 KEYBOARD BIT 4
- * 3 KEYBOARD BIT 3
- * 2 KEYBOARD BIT 2
- * 1 KEYBOARD BIT 1
- * 0 KEYBOARD BIT 0
- * INPUT ADDRESS 02 (TOUCH PANEL INPUT DATA)
- * 7-4 X POSITION BITS 3-0
- * 3-0 Y POSITION BITS 3-0
- * INPUT ADDRESS 03 (LOWER ID BITS)
- * INPUT ADDRESS 04 (UPPER ID BITS)
- * INPUT ADDRESS 05 (INTERNAL SWITCHES)
- * 7 S5-8 ASCII DEFAULT COMM DATA RATE SELECT BIT 2*
- * 6 S5-7 ASCII DEFAULT COMM DATA RATE SELECT BIT 1*
- * 5 S5-6 ASCII DEFAULT COMM DATA RATE SELECT BIT 0*
- * 4 S5-5 (1=OPEN, 0=CLOSED)
- * 3 S5-4 ASCII DEFAULT LOAD FILE SELECT BIT 1
- * 2 S5-3 ASCII DEFAULT LOAD FILE SELECT BIT 0
- * 1 S5-2 PCN DEFAULT LOAD FILE SELECT BIT 1
- * 0 S5-1 PCN DEFAULT LOAD FILE SELECT BIT 0
- *
- * *NOTE.
- * SWITCHES 8-6 ARE USED TO SELECT ASCII COMM
- * DEFAULT DATA RATE FOR LOADER AND RESIDENT.
- * RATES ARE AS FOLLOWS.
- * SW 8-6 X64 CLOCK X32 CLOCK X16 CLOCK
- * 0 75 BPS 150 BPS 300 BPS
- * 1 150 BPS 300 BPS 600 BPS
- * 2 300 BPS 600 BPS 1200 BPS
- * 3 600 BPS 1200 BPS 2400 BPS
- * 4 1200 BPS 2400 BPS 4800 BPS
- * 5 2400 BPS 4800 BPS 9600 BPS
- * 6 4800 BPS 9600 BPS 19200 BPS
- * 7 EXT CLK X1 EXT CLK X1 EXT CLK X1
- * INPUT ADDRESS 06 (COMMUNICATIONS SWITCHES AND STATUS)
- * 7 SERIAL I/O DSR (1=ON, 0=OFF)
- * 6 S2-6 (1=OPEN, 0=CLOSED)
- * 5 SE-10 (1=PARITY ON, 0=PARITY OFF)
- * 4 SE-9 (1=EVEN PARITY, 0=ODD PARITY)
- * 3 TALK/DATA SWITCH (1=DATA, 0=TALK)
- * 2 S2-1 (1=CONSTANT DTR, 0=SWITCHED DTR)
- * 1 SE-8 (1=FULL DUPLEX, 0=HALF DUPLEX)
- * 0 SE-7 (1=OPEN, 0=CLOSED)
- * INPUT ADDRESS 07 (CONTROLLER STATUS)
- * 7 BULK ERASE BUSY (1=BUSY, 0=NOT BUSY)
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * 6 RESET SWITCH (1=RESET OFF, 0=RESET ON)
- * 5 PARALLEL I/O TIMEOUT (1=TIMEOUT, 0=NO TIMEOUT)
- * 4 TOUCH PANEL DATA READY (1=DATA READY, 0=NO DATA READY)
- * 3 KEYBOARD DATA READY (1=DATA READY, 0=NO DATA READY)
- * 2 PCN TRANSMIT DATA REQUEST (1=REQUEST, 0=NO REQUEST)
- * 1 HARDWARE FLAG (1=FLAG ON, 0=FLAG OFF)*
- * 0 PCN RECEIVE DATA READY (1=READY, 0=NOT READY)
- *
- * *NOTE.
- * HARDWARE FLAG IS SET TO 1 BY A POWER ON RESET.
- * INPUT ADDRESS 08 (PCN RECEIVE DATA)
- * FIRST BYTE
- * 7 FIRST BYTE FLAG (=1)
- * 6 START BIT (=1)
- * 5-0 DATA BITS 19-14
- * SECOND BYTE
- * 7 FIRST BYTE FLAG (=0)
- * 6-0 DATA BITS 13-07
- * THIRD BYTE
- * 7 FIRST BYTE FLAG (=0)
- * 6-1 DATA BITS 06-01
- * 0 DATA BIT 00 (EVEN PARITY ON DATA BITS 19-01)
- *
- * NOTE. ADDRESSES 09-0F ARE ALSO PCN RECEIVE DATA
- * DUE TO INCOMPLETE ADDRESS DECODE.
- * INPUT ADDRESS 10 (ASCII COMM RECEIVE DATA)
- * Z80-SIO/2 A PORT
- *
- * NOTE. ADDRESSES 14, 18 AND 1C ARE ALSO ASCII COMM
- * RECEIVE DATA DUE TO INCOMPLETE ADDRESS DECODE.
- * INPUT ADDRESS 11 (ASCII COMM STATUS)
- * Z80-SIO/2 A PORT
- *
- * NOTE. ADDRESSES 15, 19 AND 1D ARE ALSO ASCII COMM
- * STATUS DUE TO INCOMPLETE ADDRESS DECODE.
- * INPUT ADDRESS 12 (SERIAL I/O RECEIVE DATA)
- * Z80-SIO/2 B PORT
- *
- * NOTE. ADDRESSES 16, 1A AND 1E ARE ALSO SERIAL I/O
- * RECEIVE DATA DUE TO INCOMPLETE ADDRESS DECODE.
- * INPUT ADDRESS 13 (SERIAL I/O STATUS)
- * Z80-SIO/2 B PORT
- *
- * NOTE. ADDRESSES 17, 1B AND 1F ARE ALSO SERIAL I/O
- * STATUS DUE TO INCOMPLETE ADDRESS DECODE.
- * INPUT ADDRESS 2X-3X (PARALLEL I/O INPUT DATA OR STATUS)
- * * * * * * * * * * * * * * * * * * * *
- *
- * BIT ASSIGNMENTS FOR OUTPUT ADDRESSES
- *
- * * * * * * * * * * * * * * * * * * * *
- * OUTPUT ADDRESS 00 (MAINTENANCE REGISTER)
- * 7 ROM/RAM ENABLE (1=RAM, 0=ROM)
- * 6 TEST MODE SELECT (1=NORMAL MODE, 0=TEST MODE)
- * 5 DTR LIGHT (1=OFF, 0=ON)
- * 4 DSR LIGHT (1=OFF, 0=ON)* *DSR, RTS, RCV AND XMT
- * 3 RTS LIGHT (1=OFF, 0=ON)* LIGHTS ARE ONLY AVAILABLE
- * 2 RCV LIGHT (1=OFF, 0=ON)* TO SOFTWARE IN TEST MODE.
- * 1 XMT LIGHT (1=OFF, 0=ON)* IN NORMAL MODE THEY ARE
- * 0 ERR LIGHT (1=OFF, 0=ON) DRIVEN BY HARDWARE.
- * NOTE. ALL MAINTENANCE REGISTER BITS ARE RESET TO 0
- * BY ANY RESET OPERATION.
- * OUTPUT ADDRESS 01 (PCN TRANSMIT DATA LOWER BITS)
- * 7-4 DATA BITS 04-01
- * 3 DATA BIT 00 (EVEN PARITY ON DATA BITS 10-01)
- * 2-0 NOT USED
- * OUTPUT ADDRESS 02 (PCN TRANSMIT DATA UPPER BITS)
- * 7-6 NOT USED
- * 5-0 DATA BITS 10-05
- * OUTPUT ADDRESS 03 (VIDEO CONTROL)
- * 7-3 NOT USED
- * 2 BULK OPERATION (1=DO BULK OPER, 0=DO NOT DO BULK OPER)
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * 1 ENABLE/DISABLE VIDEO (1=ENABLE, 0=DISABLE)
- * 0 WRITE/ERASE IF DOING BULK OPERATION (1=WRITE,0=ERASE)
- * OUTPUT ADDRESS 04 (LOAD INTERRUPT MASK)
- * 7 PCN DATA READY (1=ENABLE, 0=DISABLE) (VECTOR=00)
- * 6 KYBD DATA READY (1=ENABLE, 0=DISABLE) (VECTOR=04)
- * 5 TP DATA READY (1=ENABLE, 0=DISABLE) (VECTOR=06)
- * 4 PCN DATA REQUEST (1=ENABLE, 0=DISABLE) (VECTOR=02)
- * 3 EXT CHANNEL (1=ENABLE, 0=DISABLE) (VECTOR=0C)
- * 2 LONG INTERVAL (1=ENABLE, 0=DISABLE) (VECTOR=0E)
- * 1 SHORT INTERVAL (1=ENABLE, 0=DISABLE) (VECTOR=0A)
- * 0 I/O TIMEOUT (1=ENABLE, 0=DISABLE) (VECTOR=08)
- *
- * NOTE. LONG INTERVAL INTERRUPT IS 17.5 MSEC.
- * SHORT INTERVAL INTERRUPT IS 0.833 MSEC.
- * OUTPUT ADDRESS 05 (MISCELLANEOUS CONTROL)
- * 7 1=SELECT RAM FOR OPERAND PART OF NEXT INSTRUCTION
- * 6 SELECT EXTERNAL MODEM CONTROL (1=SELECT, 0=NO SELECT)
- * 5 SELECT INTERNAL MODEM CONTROL (1=SELECT, 0=NO SELECT)
- * 4 SELECT ASCII INTERFACE CONTROL (1=SELECT, 0=NO SELECT)
- * 3 SELECT PLATO INTERFACE CONTROL (1=SELECT, 0=NO SELECT)
- * 2 HARDWARE FLAG CONTROL (1=SET, 0=RESET)
- * 1 I/O TIMEOUT STATUS/INTERRUPT (1=RESET, 0=DO NOT RESET)
- * 0 ALARM CONTROL (1=SOUND ALARM, 0=DO NOT SOUND ALARM)
- * OUTPUT ADDRESS 06 (ASCII COMM DATA RATE)
- * 7-5 RECEIVE DATA BIT RATE
- * 4-2 TRANSMIT DATA BIT RATE
- * 1-0 NOT USED
- * BITS 7-5 X64 CLOCK X32 CLOCK X16 CLOCK
- * 0 75 BPS 150 BPS 300 BPS
- * 1 150 BPS 300 BPS 600 BPS
- * 2 300 BPS 600 BPS 1200 BPS
- * 3 600 BPS 1200 BPS 2400 BPS
- * 4 1200 BPS 2400 BPS 4800 BPS
- * 5 2400 BPS 4800 BPS 9600 BPS
- * 6 4800 BPS 9600 BPS 19200 BPS
- * 7 EXT CLK X1 EXT CLK X1 EXT CLK X1
- * OUTPUT ADDRESS 07 (SERIAL I/O DATA RATE)
- * 7-5 XMIT AND RCV DATA BIT RATE
- * 4-1 NOT USED
- * 0 EXTERNAL INTERFACE SELECT (1=LONG LINE, 0=RS232)
- * BITS 7-5 X64 CLOCK X32 CLOCK X16 CLOCK
- * 0 37.5 BPS 75 BPS 150 BPS
- * 1 75 BPS 150 BPS 300 BPS
- * 2 150 BPS 300 BPS 600 BPS
- * 3 300 BPS 600 BPS 1200 BPS
- * 4 600 BPS 1200 BPS 2400 BPS
- * 5 1200 BPS 2400 BPS 4800 BPS
- * 6 2400 BPS 4800 BPS 9600 BPS
- * 7 4800 BPS 9600 BPS 19200 BPS
- * OUTPUT ADDRESS 08-0F (NOT USED)
- * OUTPUT ADDRESS 10 (ASCII COMM TRANSMIT DATA)
- * Z80-SIO/2 A PORT
- *
- * NOTE. ADDRESSES 14, 18 AND 1C ARE ALSO ASCII COMM
- * TRANSMIT DATA DUE TO INCOMPLETE ADDRESS DECODE.
- * OUTPUT ADDRESS 11 (ASCII COMM CONTROL)
- * Z80-SIO/2 A PORT
- *
- * NOTE. ADDRESSES 15, 19 AND 1D ARE ALSO ASCII COMM
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * CONTROL DUE TO INCOMPLETE ADDRESS DECODE.
- * OUTPUT ADDRESS 12 (SERIAL I/O TRANSMIT DATA)
- * Z80-SIO/2 B PORT
- *
- * NOTE. ADDRESSES 16, 1A AND 1E ARE ALSO SERIAL I/O
- * TRANSMIT DATA DUE TO INCOMPLETE ADDRESS DECODE.
- * OUTPUT ADDRESS 13 (SERIAL I/O CONTROL)
- * Z80-SIO/2 B PORT
- *
- * NOTE. ADDRESSES 17, 1B AND 1F ARE ALSO SERIAL I/O
- * CONTROL DUE TO INCOMPLETE ADDRESS DECODE.
- * OUTPUT ADDRESS 2X-3X (PARALLEL I/O OUTPUT DATA OR COMMAND)
- * INTERNAL PCN MODEM INFORMATION
- * MODEM GENERATES DSR, CD AND RD.
- * MODEM LOOKS AT TD.
- * RTS, DTR AND CTS ARE NOT USED.
- * TERMINAL GATES RD WITH CD AND DSR.
- * I/O INPUT ADDRESS ASSIGNMENTS
- MNTSW EQU 00H MAINTENANCE SWITCHES
- KBDATA EQU 01H KEYBOARD DATA
- TPDATA EQU 02H TOUCH PANEL DATA
- IDLO EQU 03H ID CODE, LOWER 8 BITS
- IDUP EQU 04H ID CODE, UPPER 8 BITS
- INTSW EQU 05H INTERNAL SWITCHES
- COMMSW EQU 06H COMM CONTROL SWITCHES
- SYSSTAT EQU 07H CONTROLLER STATUS
- CLADATA EQU 08H PCN RECEIVE DATA
- ASCDATI EQU 10H ASCII COMM RECEIVE DATA
- ASCSTAT EQU 11H ASCII COMM STATUS
- SERDATI EQU 12H SERIAL I/O RECEIVE DATA
- SERSTAT EQU 13H SERIAL I/O STATUS
- FDDATA EQU 0EEH FLOPPY DISK INPUT DATA
- FDSTAT EQU 0EFH FLOPPY DISK STATUS
- * I/O OUTPUT ADDRESS ASSIGNMENTS
- PNLLTS EQU 00H MAINTENANCE PANEL LIGHTS
- CLAL EQU 01H PCN TRANSMIT DATA LOWER BITS
- CLAU EQU 02H PCN TRANSMIT DATA UPPER BITS
- VIDEOCTL EQU 03H BULK ERASE AND VIDEO ENABLE
- INTMSK EQU 04H SYSTEM INTERRUPT MASK
- MISCTL EQU 05H MISCELLANEOUS CONTROL
- ASCRATE EQU 06H ASCII COMM DATA RATE
- SERRATE EQU 07H SERIAL I/O DATA RATE
- ASCDATO EQU 10H ASCII COMM TRANSMIT DATA
- ASCCTRL EQU 11H ASCII COMM CONTROL
- SERDATO EQU 12H SERIAL I/O TRANSMIT DATA
- SERCTRL EQU 13H SERIAL I/O CONTROL
- FDCMND EQU 0EFH FLOPPY DISK COMMAND
- EJECT
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * *@* *
- *
- * PRINTER EQUATES
- *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * *@* *
- DATAFCN EQU 2AH 001NNNN0
- CNTLFCN EQU 2BH 001NNNN1
- MISCFCN EQU 05H 00000101
- MRESET0 EQU 00H RESET INTERFACE
- MRESET1 EQU 01H RESET PTR
- DISABLE EQU 2 DISABLE INTERRUPTS.
- ENABLE EQU 04H ENABLE INTERRUPTS.
- SECSTAT EQU 09H REQUEST SECONDARY STATUS.
- READID EQU 08H READ DEVICE ID.
- STIMER EQU 0EH START TIMER.
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- *
- C.ENQ EQU 05H DOT ROW PREAMBLE
- C.LF EQU 0AH LINE / ROW FEED
- C.FF EQU 0CH FORM FEED
- PDISABL EQU 13H DESELECT PRINTER.
- * * * * * * * * * * * * * * * * * * *
- *
- * 'C'P/'M 'E'Q'U'A'T'E'S
- *
- * * * * * * * * * * * * * * * * * * *
- TPESCK EQU 1DH TOUCH PANEL ESCAPE KEY
- EJECT EXTERNAL EQUATES
- SPACE 5
- *
- * USER JUMP TABLE
- * THE USER JUMP TABLE IS MOVED TO ADDRESS 0040 HEX
- * IN THE INITIALIZATION OF THE TERMINAL RESIDENT.
- *
- R.INIT EQU 0040H
- R.DOT EQU 0043H
- R.LINE EQU 0046H
- R.CHARS EQU 0049H
- R.BLOCK EQU 004CH
- R.INPX EQU 004FH
- R.INPY EQU 0052H
- R.OUTX EQU 0055H
- R.OUTY EQU 0058H
- R.XMIT EQU 005BH
- R.MODE EQU 005EH
- R.STEPX EQU 0061H
- R.STEPY EQU 0064H
- R.WE EQU 0067H
- R.DIR EQU 006AH
- R.INPUT EQU 006DH
- R.SSF EQU 0070H
- R.CCR EQU 0073H
- R.EXTOUT EQU 0076H
- R.EXEC EQU 0079H
- R.GJOB EQU 007CH
- R.XJOB EQU 007FH
- R.RETURN EQU 0082H
- R.CHRCV EQU 0085H
- EJECT
- FWA1 EQU 00B0H START OF FIRST CHECKSUM AREA
- *
- BLK0 EQU 00B0H BLOCK 00 TABLE, USED WHEN
- * LOADING THE RESIDENT FROM PLATO
- *
- IVTBL EQU 0100H FINAL ADDRESS OF INT. TABLE
- SPACE 4
- * ENTRY POINT ADDRESS FOR ROM RESIDENT PLATO
- * LOAD ROUTINE.
- DEFW INIT
- SPACE 3
- CKSMTBST EQU *
- DEFW FWA1 ENTRY POINTS AND CKSM TABLE
- DEFW LENGTH1
- DEFW FWA2 COMMON RESIDENT CODE
- DEFW LENGTH2
- DEFW FWA3 401X UNIQUE CODE
- DEFW LENGTH3
- DEFW 0 END OF TABLE
- DEFW 0 (LENGTH = 0)
- LENGTH1 EQU *-FWA1 END OF FIRST CHECKSUM AREA
- FWA2 EQU * START OF SECOND CHECKSUM AREA
- EJECT TERMINAL INITIALIZATION
- * * * * * * * * * * * * * * * * * * * * *
- *
- * TERMINAL INITIALIZATION
- *
- * * * * * * * * * * * * * * * * * * * * *
- * INITIALIZATION ENTRY POINT.
- INIT EQU *
- DI DISABLE INTERRUPTS
- LD A,0DFH CLEAR TEST MODE, ENABLE RAM
- OUT (PNLLTS),A SET DTR, CLEAR ERR LIGHT
- LD SP,ZSTACK SET STACK POINTER
- LD HL,CKSMTBST PRESET CHECKSUM TABLE
- LD (CKSUMTBL),HL ADDRESS
- LD A,01H SOUND BEEPER
- OUT (MISCTL),A
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * IF THE RESET FLAG DOES NOT EQUAL 3C HEX, OR THE
- * RESET FLAG EQUALS 3C HEX, BUT THE LOAD SOURCE IS
- * NOT THE ASCII HOST, THEN IT IS ASSUMED THAT A
- * FULL LOAD OF THE TERMINAL RESIDENT HAS JUST
- * OCCURRED AND THE RESIDENT VARIABLES ARE CLEARED.
- LD A,(RESETFLG) IS THIS A SHORT RESET
- XOR 3CH
- JR NZ,INIT0 INITIALIZE VARIABLES
- *
- LD A,(LOADINFO) ELSE GET LOAD INFO
- AND 14H MASK LOAD SOURCE BITS
- XOR 04 TEST FOR ASCII/HOST
- JP Z,INIT1 SKIP IF ASCII HOST
- *
- * INITIALIZE AFTER LOAD
- INIT0 EQU *
- LD HL,LOADINFO
- SET 2,(HL) SET LOADINFO TO NOT
- SET 3,(HL) SOURCE = DISK
- SET 4,(HL)
- *
- INC HL POINT TO RUNINFO
- LD C,06 SET RS232, EXTERNAL, ASCII
- IN A,(INTSW) GET COMM DEFAULT SWITCHES
- AND 0E0H
- OR C INCLUDE FOR RUNINFO
- LD C,A
- LD A,18H
- AND (HL)
- OR C
- LD (HL),A SET RUNINFO
- *
- LD A,(HL)
- AND 0E1H
- OUT (SERRATE),A SET RS232 COMM CHANNEL
- LD A,50H
- OUT (MISCTL),A SET ASCII COMM, EXT. MODEM
- *
- LD HL,JMPTBL LOAD JUMP
- LD DE,R.INIT TABLE TO LOW
- LD BC,JT.LEN MEMORY.
- LDIR
- *
- LD HL,IVT MOVE INTERRUPT
- LD DE,IVTBL VECTOR TABLE
- LD BC,IVT.LEN TO RIGHT LOCATION
- LDIR
- *
- *
- * IMEDIATELY AFTER FULL LOAD, CHECKSUM FLAG IS SET TO
- * NON-ZERO. CALL TO CHKSM.I INITIALIZES THE CHECKSUM
- * TABLE ADDRESS. CALL TO CHKSUM WITH CHKSMFG NON-ZERO
- * WILL STORE A CALCULATED CHECKSUM TO BE USED TO
- * VERFY THE BINARY DURING THE RESIDENT EXECUTION.
- * WHEN THE CHECKSUM IS STORED, CHKSMFG IS CLEARED.
- *
- LD A,55H
- LD (CKSMFG),A SET FLAG TO STORE CHECKSUM
- CALL CHKSUM.I INITIALIZE CHECKSUM VARIABLES
- *
- INIT01 EQU *
- CALL CHKSUM INITIALIZE CHECKSUM
- LD A,(CKSMFG)
- OR A TEST FOR END OF TABLE
- JR NZ,INIT01 STAY IN LOOP TILL END
- *
- LD A,(LOADINFO)
- AND 18H
- XOR 18H
- JR NZ,INIT01A
- SET 6,A
- JR INIT01B
- INIT01A XOR A SET ASCII MODE
- INIT01B LD (MODE),A
- LD A,3CH SET SHORT RESET FLAG
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- LD (RESETFLG),A
- LD HL,BEGVAR1 CLEAR VARIABLE SCRATCH AREA
- LD (HL),0
- LD DE,BEGVAR1+1
- LD BC,ENDVAR1-BEGVAR1-1
- LDIR
- LD HL,BEGVAR2
- LD (HL),0
- LD DE,BEGVAR2+1
- LD BC,ENDVAR2-BEGVAR2-1
- LDIR
- LD A,(RUNINFO) GET DEFAULT RATE FOR
- RLCA STATUS LINE
- RLCA
- RLCA
- AND 07H
- LD (ASCSPEED),A
- IN A,(COMMSW) GET DEFAULT PARITY SETTING
- RLCA FOR STATUS LINE
- RLCA
- RLCA
- RLCA
- AND 03H
- XOR 03H
- CP 03H
- JR NZ,INITPAR
- DEC A
- INITPAR EQU *
- LD (PARITY),A
- IN A,(COMMSW) GET DEFAULT HALF/FULL DUPLEX
- RRCA SETTING FOR STATUS LINE
- AND 01H
- LD (DUPLEXFG),A
- * ALL RESETS COME THROUGH THE FOLLOWING CODE
- INIT1 EQU *
- LD A,38H
- LD (M.STATUS),A SET USER PROGRAM NOT RUN.
- XOR A FLAG USER PROGRAM NOT RUNNING
- LD (USERFLG),A
- CALL INIT3 INIT INTS AND CHECKSUM
- LD HL,USBUF CLEAR OUT KB/TP BUFFER
- XOR A
- LD (HL),A
- INC HL
- LD (HL),A
- INC HL
- LD (HL),A
- *
- LD A,(LDSOURCE)
- INC A TEST FOR MICRO TUTOR LOAD
- JR Z,INITA INITIALIZE FOR PLATO
- *
- LD A,(MODE) CHECK PLATO/ASCII OPERATION
- RLCA
- JR NC,INIT1A JUMP IF ASCII (TS OR GRAPHIC)
- INITA EQU *
- CALL PINIT.1 DO PLATO OPERATION INIT
- CALL SENDNAK SEND NAK AND SET ABORT STATE
- LD HL,0382H SEND RESET STATUS TO PLATO
- CALL R.XMIT
- JR INIT1C
- INIT1A EQU *
- LD A,(TGMODE) ASCII, SO CHECK TS OR GRAPHIC
- OR A
- JR Z,INIT1B JUMP IF TIMESHARE
- CALL AINIT.G GRAPHIC OPERATION INIT
- JR INIT1C
- INIT1B EQU *
- CALL AINIT TIMESHARE OPERATION INIT
- INIT1C EQU *
- LD A,(VERSION) SET CONTROLWARE VERSION
- LD (M.VERS),A
- LD HL,0000H SELECT M0/FWD/SIZE 1/HOR PLOT
- CALL R.CCR AND CLEAR UNCOVER FLAG
- LD A,01H LOAD IST3 SUBTYPE
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- LD (M.SBTYPE),A
- LD HL,M.TYPE SET TERMINAL TYPE
- IN A,(MNTSW) GET SWITCH S2-10(32K)
- AND 60H SAVE TP AND MEM BITS IN
- LD (M.CONFIG),A CONFIGURATION BYTE
- AND 20H AND PUT IN BIT 4 OF M.TYPE
- RRCA
- OR 12 SET ASCII TERMINAL TYPE
- LD (HL),A IN BITS 3..0
- LD A,(M.LDFILE) IF LOAD FILE = 00 THIS IS
- OR A A PRODUCTION FILE.
- JR Z,INIT2 OTHERWISE IT IS EXPERIMENTAL
- *
- XOR 0AH TEST FOR ASCII FROM PLATO
- JR Z,INIT2
- SET 6,(HL) SET EXPERIMENTAL BIT
- LD HL,16 AND DISPLAY
- CALL R.OUTY .EXPERIMENTAL VERSION NN.
- LD HL,160 MESSAGE
- CALL R.OUTX
- LD HL,EXP
- CALL R.CHARS
- INIT2 EQU *
- LD HL,0 DISPLAY
- CALL R.OUTY .TERMINAL READY NN.
- LD HL,184 MESSAGE
- CALL R.OUTX
- LD HL,TRMRDY
- CALL R.CHARS
- LD HL,LDSOURCE
- INC (HL) TEST FOR DISK LOAD
- *
- CALL Z,5306H GO TO INTERPRETER
- *
- XOR A
- LD (LDSOURCE),A
- LD A,(MODE) CHECK ASCII/PLATO
- RLCA
- CALL NC,AFF.1 HOME CURSOR FOR TS OR GRAPHIC
- JP IDLE
- INIT3 EQU *
- LD HL,IVTBL SET INTERRUPT TABLE ADDRESS
- LD A,H (UPPER BITS)
- LD I,A INTO INT. VECTOR
- IM 2 SET FOR MODE 2 INTERRUPTS
- LD HL,044EH ENABLE KEYBOARD, DISK AND
- CALL R.SSF LONG INTERVAL INTERRUPTS
- LD HL,ASCPKGI SET UP ASCII INIT PACKAGE
- LD DE,ASCPKG
- LD BC,8
- LDIR
- CALL STAT.F1 SET UP SIO
- LD B,8
- LD C,SERCTRL
- LD HL,SERPKGI
- OTIR
- CALL CHKSUM.I INITIALIZE MEMORY CHECKSUM
- EI
- RET
- ASCSETUP EQU *
- LD B,8 SET UP ASCII COMM PORT
- LD C,ASCCTRL
- LD HL,ASCPKG
- OTIR
- RET
- ASCPKGI EQU * ASCII COMM INIT PACKAGE
- DEFB 04H REG. 4 NEXT
- DEFB 0C4H X64 CLK, 1 STOP BIT, NO PARITY
- DEFB 03H REG. 3 NEXT
- DEFB 0C1H 8 BITS/CH, NO AUTO EN, EN RCVR
- DEFB 05H REG. 5 NEXT
- DEFB 0EAH DTR ON,8 BITS/CH,TX EN,RTS ON
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- DEFB 01H REG. 1 NEXT
- DEFB 1BH PAR NOT AFF VECT,EN TX/EXT INT
- SERPKGI EQU * SERIAL I/O INIT PACKAGE
- DEFB 00H REG. 0 NEXT
- DEFB 18H CHANNEL CLEAR, REG. 0 NEXT
- DEFB 04H REG. 4 NEXT
- DEFB 0C4H X64 CLK,1 STOP BIT,NO PARITY
- DEFB 01H REG. 1 NEXT
- DEFB 04H DIS RCV INT, STAT AFF VECT
- DEFB 02H REG. 2 NEXT
- DEFB 10H INTERRUPT VECTOR = XX10H
- ENDB 00 LOAD AND CHECKSUM
- EJECT
- **********
- * PLATO INITIALIZE
- **********
- PINIT EQU *
- LD A,01H SET ERROR PROTOCOL TO STATE 0
- LD (EREG),A
- LD A,(MODE)
- AND 40H MASK FOR CPM MODE BIT
- OR 80H ADD IN PLATO MODE BITS
- LD (MODE),A
- LD A,20 INIT WORD COUNTER
- LD (E.CNTR),A
- LD C,06H SEND ACK
- CALL XMIT.1
- LD C,0+20H SEND 00 WORD COUNT
- CALL XMIT.1
- PINIT.1 EQU *
- LD HL,M0CODE00 SET UP M.M0
- LD (M.M0),HL
- XOR A SET (M.KSW) TO PUT INPUT DATA
- LD (M.KSW),A INTO THE TRANSMIT BUFFER
- LD (CURSAVED),A CLEAR CURSOR SAVED FLAG
- LD HL,ISTASC SELECT PLATO/ASCII KEYBOARD
- LD (KBAADR),HL
- LD HL,CTLADR.P SELECT PLATO CTL TBL
- LD (CTLADR),HL
- LD HL,ESCADR.P SELECT PLATO ESC SEQ TBL
- LD (ESCADR),HL
- LD HL,00 NO GRAPH MODE SCREEN BIAS
- LD (BIAS),HL
- LD A,01 DO NOT SCALE
- LD (SCALEFG),A
- LD (BYPASS),A SET BYPASS
- LD (G.TTYFLG),A DE-SELECT ALL CAPS
- LD HL,232
- CALL R.OUTX POSITION AT 232,32
- LD HL,32
- CALL R.OUTY
- LD L,00 SET HOR/MEM0/SIZE1/FWD
- CALL R.CCR
- LD L,1AH SET ALPHA/REWRITE MODE
- CALL R.MODE
- LD HL,MSG DISPLAY PLATO MESSAGE
- JP R.CHARS
- *PLATO MESSAGE
- MSG EQU *
- HEX 50,4C,41,54,4F,3F,00
- *EXPERIMENTAL VERSION XX MESSAGE
- EXP EQU *
- HEX 45,18,10,05
- HEX 12,09,0D,05
- HEX 0E,14,01,0C
- HEX 2D,56,05,12
- HEX 13,09,0F,0E
- HEX 2D,1B,1B 00(CHANGES WITH EACH ASSEMBLY)
- HEX 3F,00
- *TERMINAL READY MESSAGE
- TRMRDY EQU *
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- HEX 54,05,12,0D
- HEX 09,0E,01,0C
- HEX 2D,52,05,01
- HEX 04,19
- *VERSION (CHANGE WITH NEW PRODUCTION BINARY)
- VER EQU *
- HEX 2D,1B,1E 03
- HEX 3F,00
- * BLOCK FAILURE MESSAGE
- BLKFAIL EQU *
- HEX 42,0C,0F,03,0B,2D
- HEX 46,01,09,0C,15,12,05,3F,00
- VERS. EQU 82H EXPERIMENTAL VERSION
- VERSION DEFB VERS.
- EJECT
- * * * * * * * * * * * * * * * * * * * *
- *
- * LONG INTERVAL INTERRUPT PROCESSOR
- * INTERRUPTS OCCUR AT 17.5 MILLISECOND INTERVALS
- *
- * * * * * * * * * * * * * * * * * * * *
- LINT EQU *
- PUSH AF
- PUSH BC
- PUSH DE
- PUSH HL
- LD A,(M.ENAB) CLEAR LONG INTERVAL INT.
- LD B,A
- RES 2,A
- OUT (INTMSK),A
- LD A,B REENABLE LONG INTERVAL INT.
- OUT (INTMSK),A
- LD A,(USERFLG) IS A USER PROGRAM RUNNING
- OR A
- JR Z,LINT1 JUMP IF NO
- LD A,(MODE) YES, IS THIS PLATO OPERATION
- RLCA
- JP NC,R.INIT NO, SIMULATE A SHORT RESET
- LINT1 EQU *
- LD HL,(M.CLOCK) AND INCREMENT (M.CLOCK)
- INC HL
- LD (M.CLOCK),HL
- LD HL,BLINKCTR CHECK BLINK COUNTER
- LD A,(HL)
- OR A
- JP Z,RETURN
- DEC (HL) DECREMENT IF NOT ZERO
- JP R.RETURN
- ENDB 00 LOAD AND CHECKSUM
- EJECT
- EJECT
- * * * * * * * * * * * * * * * * * * * *
- *
- * ASCII COMMUNICATIONS PORT INTERRUPT PROCESSOR
- *
- * * * * * * * * * * * * * * * * * * * *
- ASCCRDY EQU * CHARACTER READY ENTRY
- PUSH AF (PARITY MAY BE GOOD OR BAD)
- PUSH BC
- PUSH DE
- PUSH HL
- IN A,(ASCDATI) INPUT DATA
- LD C,A
- CALL ERRCHK CALL ERROR PROTOCOL HANDLER
- JP C,R.RETURN EXIT IF CHAR TO BE IGNORED
- ASCCRDY1 EQU *
- LD A,(LOC.RMT) THROW AWAY CHARACTER
- OR A IF LOCAL
- JP NZ,RETURN
- RES 7,C CLEAR PARITY BIT
- LD HL,RXBUF RECEIVE BUFFER ADDRESS
- LD A,(MODE)
- BIT 6,A TEST FOR CPM MODE
- JR Z,ASCCRDY3 SKIP OVER IF NOT IN CPM MODE
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- LD HL,COMBUF CHANGE TO CPM BUFFER
- ASCCRDY3 LD A,7FH LOAD MASK FOR INDEX
- CP (HL) TEST FOR FULL BUFF
- JR Z,ASCCRDY2 JUMP IF FULL
- INC (HL) INCREMENT DIFF COUNT
- INC HL STEP TO INPUT INDEX
- AND (HL) INDEX TO REG A
- INC (HL) INCREMENT INPUT INDEX
- INC HL STEP TO START OF
- INC HL STORE AREA
- LD E,A ADD INDEX
- LD D,00
- ADD HL,DE
- LD (HL),C STORE DATA
- LD HL,M.JOBS INCREMENT (M.JOBS)
- LD A,(MODE)
- BIT 6,A SKIP INCREMENT OF M.JOBS IF
- JR NZ,ASCCRDY4 IN CPM MODE
- INC (HL)
- ASCCRDY4 JP R.RETURN
- ASCCRDY2 EQU *
- LD A,(MODE) SEND NAK AND ABORT RECEIVE
- RLCA IF PLATO MODE
- CALL C,SENDNAK
- JP RETURN
- ASCERR EQU * RECEIVE CHARACTER ERROR ENTRY
- PUSH AF (OVERRUN OR FRAMING ERROR)
- PUSH BC
- PUSH DE
- PUSH HL
- IN A,(ASCDATI) INPUT DATA
- LD C,A SAVE CHARACTER IN C
- LD A,30H CLEAR ERROR FLAGS
- OUT (ASCCTRL),A
- LD A,(MODE) CHECK MODE
- RLCA
- JR NC,ASCERR1
- CALL ERR.P PLATO MODE ERROR
- JR ASCERR2
- ASCERR1 EQU *
- CALL ERR.A ASCII MODE ERROR
- ASCERR2 EQU *
- JR NC,ASCCRDY1 SAVE CHAR IF FLAGGED OK
- JP RETURN OTHERWISE IGNORE IT
- ASCCREQ EQU * CHARACTER REQUEST ENTRY
- PUSH AF
- PUSH BC
- PUSH DE
- PUSH HL
- LD HL,TXBUF LOAD ADDRESS OF TRANSMIT BUFF
- XOR A TEST FOR EMPTY
- OR (HL) BUFFER
- JR Z,ASCCREQ1 JUMP IF BUFFER EMPTY
- DEC (HL) DECREMENT DIFFERENCE COUNT
- INC HL STEP TO
- INC HL OUT INDEX
- LD A,07 LOAD MASK FOR INDEX
- AND (HL) GET INDEX
- INC (HL) INCREMENT INDEX
- INC HL STEP TO STORE AREA
- LD E,A ADD INDEX TO
- LD D,00 START OF STORE AREA
- ADD HL,DE
- LD A,(HL) LOAD DATA TO TRANSMIT
- OUT (ASCDATO),A OUTPUT DATA
- JP RETURN
- ASCCREQ1 EQU *
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- LD A,28H TURN OFF CHARACTER REQUEST INT
- OUT (ASCCTRL),A
- XOR A CLEAR ASCII TRANSMIT BUSY FLAG
- LD (TXBUSY),A
- JP RETURN
- ASCXTCHG EQU * CHANGE OF CTS OR DCD, OR BREAK
- PUSH AF
- PUSH BC
- PUSH DE
- PUSH HL
- LD A,10H CLEAR EXT/STATUS INTERRUPT
- OUT (ASCCTRL),A
- JP RETURN
- EJECT
- * * * * * * * * * * * * * * * * * * * * *
- *
- * KEY BOARD INTERRUPT PROCESSOR
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- KYBD EQU *
- PUSH AF
- PUSH BC
- PUSH DE
- PUSH HL
- SPACE 1
- IN A,(KBDATA) INPUT KEY BOARD DATA
- LD L,A LOAD KEYBOARD DATA
- LD H,40H OP CODE AND CATAGORY
- LD A,(MODE) CLEAR CTRL BIT IF PLATO MODE
- RLCA
- JR NC,KYBD1
- RES 7,L
- KYBD1 EQU *
- LD A,(SCOPYFLG) IS SCREEN COPY ACTIVE
- OR A
- JR NZ,KYBD2 JUMP IF YES
- * DO A SCREEN COPY IF SHIFT-PRINT IS PRESSED.
- * OTHERWISE, JUST TRANSMIT THE CHARACTER.
- LD A,L NO, IS KEY = SHIFT-PRINT
- CP 3FH
- JR NZ,KYBD3 JUMP IF NO
- LD A,01 SET SCREEN COPY ACTIVE FLAG
- LD (SCOPYFLG),A
- EI ENABLE INTERRUPTS
- CALL G.PRINT DO THE SCREEN COPY
- DI DISABLE INTERRUPTS
- XOR A CLEAR SCREEN COPY ACTIVE FLAG
- LD (SCOPYFLG),A
- JP RETURN
- * TURN OFF SCREEN COPY IF STOP OR SHIFT-STOP IS PRESSED.
- * OTHERWISE IGNORE THE KEY.
- KYBD2 EQU *
- LD A,L IS KEY = STOP OR SHIFT-STOP
- RES 5,A
- CP 1AH
- JR NZ,RETURN NO, IGNORE KEY
- LD A,01 YES, SET SCREEN COPY TURNOFF
- LD (TURNOFF),A FLAG AND TRANSMIT THE KEY
- LD A,(MODE) CHECK MODE
- RLCA
- JR NC,RETURN TRANSMIT ONLY IF PLATO MODE
- KYBD3 EQU *
- EX DE,HL
- EXX
- PUSH BC
- PUSH DE
- PUSH HL
- EXX
- CALL KEY PROCESS KEY CODE.
- EXX
- POP HL
- POP DE
- POP BC
- EXX
- JR RETURN
- SPACE 4
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * * * * * * * * * * * * * * * * * * * * *
- *
- * TOUCH PANEL INTERRUPT PROCESSOR
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- TP EQU *
- PUSH AF
- PUSH BC
- PUSH DE
- PUSH HL
- SPACE 1
- IN A,(TPDATA) INPUT TOUCH PANEL DATA
- LD L,A LOAD TOUCH PANEL DATA
- LD H,41H OP CODE AND CATAGORY
- EX DE,HL
- CALL TOUCH PROCESS TOUCH PANEL DATA.
- LD A,01
- OUT (MISCTL),A
- JR RETURN RETURN TO INTERRUPTED PROCES
- EJECT EXTERNAL INTERRUPT PROCESSOR
- * * * * * * * * * * * * * * * * * * * * *
- *
- * EXTERNAL CHANNEL INTERRUPT PROCESSOR
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- EXTI EQU *
- PUSH AF
- PUSH BC
- PUSH DE
- PUSH HL
- *
- LD A,(MODE)
- BIT 6,A
- JP NZ,EXTICPM JUMP IF IN CPM MODE
- IN A,(FDCMND)
- BIT 0,A CHECK IF INTERRUPT FROM CPM
- JR Z,RETURN IF FROM CPM RETURN
- EXTI00 LD HL,(M.EXTPA) LOAD PROCESSOR ADDR.
- LD A,L TEST FOR ZERO
- OR H
- JR Z,EXTI0
- JP (HL) NONZERO, GO TO USER ROUTINE
- *
- EXTI0 EQU *
- LD A,(EXT.IN) LOAD EXTERNAL DEVICE ADDRESS
- LD C,A
- AND 1CH TEST FOR SERIAL OR PARALLEL
- JR Z,EXTI1
- SET 5,C SELECT PARALLEL CHANNEL
- JR EXTI2
- *
- EXTI1 EQU *
- SET 4,C SELECT SERIAL CHANNEL
- EXTI2 EQU *
- IN L,(C) INPUT FROM EXTERNAL CHANNEL
- LD H,82H LOAD OP CODE AND USER/PLATO
- LD A,(MODE)
- BIT 6,A
- JR NZ,EXTI3 JUMP IF IN CPM MODE
- CALL FIFO.ST AND STORE FOR TRANSMIT
- JR RETURN
- EXTI3 EQU *
- LD HL,EXTBUF CPM EXTERNAL BUFFER
- LD A,7FH BUFFER LENGTH
- CP (HL)
- JR Z,RETURN RETURN IF BUFFER IS FULL
- CALL KTPSTR SUBROUTINE TO STORE IN BUFFER
- JR RETURN
- SPACE 4
- * * * * * * * * * * * * * * * * * * * * *
- *
- * RESTORE ALL REGISTERS AND ENABLE INTERRUPTS
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- RETURN EQU *
- POP HL
- POP DE
- POP BC
- POP AF
- EI ENABLE SYSTEM INTERRUPTS
- RETI
- EJECT
- * * * * * * * * * * * * * * * * * * * *
- *
- * STORE DATA FROM INPUT DEVICES (KEYBOARD, TOUCH
- * PANEL OR EXTERNAL DEVICE) INTO EITHER THE TRANSMIT
- * BUFFER OR THE USER BUFFER DEPENDING ON (M.KSW)
- *
- * ON ENTRY, DATA IS IN HL
- * H7=1 FOR CATEGORY 2 DATA (EXT)
- * H6=1 FOR CATEGORY 1 DATA (KB OR TP)
- *
- * * * * * * * * * * * * * * * * * * * *
- FIFO.ST EQU *
- LD A,0C0H GET CATEGORY BITS
- AND H
- RLCA PUT CATEGORY BITS IN LOWER
- RLCA BITS
- LD B,A AND SAVE IN B REGISTER
- LD A,(M.KSW) CHECK FOR TRANSMIT/USER
- AND B
- JP Z,R.XMIT
- US.STOR EQU *
- LD E,L DE = HL WITH UPPER BITS CLEAR
- LD A,H
- AND 03H
- LD D,A
- LD HL,USBUF
- LD A,07H TEST FOR FULL BUFFER
- CP (HL)
- RET Z BUFFER FULL, RETURN TO CALLER
- INC (HL) NOT FULL, INCREMENT DIFF CNTR
- INC HL POINT TO INPUT POINTER
- AND (HL) GET LOWER BITS
- RLCA AND SET FOR TWO BYTE ADDRESS
- INC (HL) INCREMENT POINTER
- LD B,0 PUT INDEX IN BC
- LD C,A
- INC HL POINT TO START OF BUFFER AREA
- INC HL
- ADD HL,BC INDEX INTO BUFFER
- LD (HL),E STORE DATA LOWER BITS
- INC HL
- LD (HL),D STORE DATA UPPER BITS
- RET
- ENDB 00 LOAD AND CHECKSUM
- EJECT
- * * * * * * * * * * * * * * * * * * * *
- *
- * MAIN IDLE LOOP
- *
- * * * * * * * * * * * * * * * * * * * *
- IDLE EQU *
- XOR A FLAG USER PROGRAM NOT RUNNING
- LD (USERFLG),A
- CALL CHKSUM CHECKSUM MEMORY DURING IDLE
- JR Z,IDLE1
- JR BLOCKF NOP THIS FOR EXP TESTING
- IDLE1 EQU *
- LD A,(MODE) TEST FOR OPERATING MODE
- RLCA
- JP NC,AIDLE ASCII IDLE IF BIT 7 CLEAR
- **********
- * PLATO OPERATIONS IDLE LOOP
- **********
- PIDLE EQU *
- CALL R.EXEC TEST FOR RECEIVE OR XMIT DATA
- JR IDLE LOOP TO IDLE
- **********
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * DISPLAY .BLOCK FAILURE. MESSAGE
- * TERMINAL MUST BE RESET TO RECOVER
- **********
- BLOCKF EQU *
- LD HL,400
- CALL R.OUTX
- LD HL,256
- CALL R.OUTY
- LD HL,BLKFAIL
- CALL R.CHARS
- BLOCKF1 JR BLOCKF1 HANG
- EJECT
- **********
- * EXECUTE RECEIVE DATA UNTIL RECEIVE BUFFER IS EMPTY.
- **********
- EXEC EQU *
- LD A,(EREG) CHECK TIME OUT
- AND 04 IF COMM ERROR STATE
- CALL NZ,TIMOUT
- CALL CHECKSWS CHECK FRONT PNL SWS FOR CHANGE
- LD A,(MODE) CHECK MODE
- RLCA
- JR NC,EXEC3 NO TEST IF ASCII MODE
- BIT 7,A
- JR NZ,EXEC3 SKIP TIMEOUT TEST IF IN CPM MODE
- LD B,7 PLATO MODE ...
- EXEC1 EQU *
- LD A,10H
- OUT (ASCCTRL),A
- IN A,(ASCSTAT)
- BIT 3,A
- JR NZ,EXEC3 OK IF CARRIER ON
- LD HL,0 WAIT ABOUT HALF A SECOND
- EXEC2 EQU *
- DEC HL
- LD A,L
- OR H
- JR NZ,EXEC2
- DJNZ EXEC1 SEE IF CARRIER IS BACK ON
- LD (RESETFLG),A FORCE A FULL TIMESHARE
- JP R.INIT MODE INIT AFTER 3 SECONDS
- EXEC3 EQU *
- LD A,(M.JOBS) TEST FOR RECEIVE DATA
- OR A
- RET Z EXIT IF NO RECEIVE DATA
- CALL PROCESS
- JR EXEC3
- **********
- * FETCH A BYTE FROM THE RECEIVE BUFFER.
- * ON EXIT, THE BYTE IS IN THE C-REGISTER.
- **********
- GJOB EQU *
- LD HL,M.JOBS DECREMENT (M.JOBS)
- DEC (HL)
- LD HL,RXBUF
- DEC (HL) DECREMENT DIFF COUNT
- INC HL STEP TO OUT
- INC HL
- LD A,7FH MASK OUT INDEX WITH BUF LENGTH
- AND (HL) DATA IN A REG
- INC (HL) INCREMENT OUT INDEX
- INC HL BEGIN OF DATA STORE
- LD E,A
- LD D,00
- ADD HL,DE
- LD C,(HL) DATA TO C REGISTER
- RET
- EJECT
- **********
- * PROCESS A CHARACTER TAKEN FROM RECEIVE BUFFER
- **********
- PROCESS EQU *
- CALL R.GJOB GET NEXT CHAR
- **********
- * EXECUTE CHARACTER IN THE C-REGISTER
- **********
- XJOB EQU *
- RES 7,C CLEAR UPPER BIT OF CHARACTER
- PUSH BC SAVE CHARACTER
- CALL ESCCTL CHECK FOR ESC SEQ OR CTL CODE
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- POP BC GET SAVED CHARACTER
- JR C,XJOB2 JUMP IF ESC SEQ OR CTL CODE
- LD A,(CMODE) TEST FOR COMMAND MODE ACTIVE
- OR A
- JR Z,XJOB.DAT JUMP IF NOT
- XJOB.CMD EQU *
- LD HL,SELECT.C-2 SELECT COMMAND TABLE
- JR XJOB1 AND JUMP VIA (CMODE)
- XJOB.DAT EQU *
- LD A,(BYPASS) CHECK BYPASS
- OR A
- RET NZ IGNORE DATA IF BYPASS ON
- LD A,(MODE) JUMP VIA (MODE)
- AND 0BFH MASK OUT CPM BIT
- ADD A,A
- LD HL,SELECT.D SELECT DATA TABLE
- XJOB1 EQU *
- LD E,A INDEX INTO SELECTED TABLE
- LD D,0
- ADD HL,DE SELECT.C OR SELECT.D
- LD E,(HL) GET JUMP ADDRESS
- INC HL
- LD D,(HL)
- EX DE,HL
- PUSH BC SAVE CHARACTER
- CALL JMPHL EXECUTE COMMAND OR DATA
- POP BC GET SAVED CHARACTER
- XJOB2 EQU *
- LD A,(CPRINTFG) CHECK FOR COMM PRINT ACTIVE
- OR A
- JP NZ,CPRINT OUTPUT CHARACTER TO PRINTER
- RET
- JMPHL EQU *
- JP (HL) JUMP VIA HL
- SELECT.C EQU * COMMAND JUMP TABLE
- DEFW LDC
- DEFW SSF
- DEFW LDE
- DEFW LDA
- DEFW EXT
- SELECT.D EQU * DATA JUMP TABLE
- DEFW APOINT MODE 0
- DEFW GRAPH MODE 1
- DEFW MEMORY MODE 2
- DEFW CHARACT MODE 3
- DEFW ABLOCK MODE 4
- DEFW MODE5 MODE 5
- DEFW MODE6 MODE 6
- DEFW MODE7 MODE 7
- DEFW TEMP MODE 8
- **********
- * CHECK FOR CHANGE IN TALK/DATA SWITCH AND UPDATE
- * COMM CHANNEL DTR SIGNAL ACCORDINGLY.
- **********
- CHECKSWS EQU *
- LD HL,XCOMMSW POINT TO OLD SWITCH SETTING
- IN A,(COMMSW) GET NEW SWITCH SETTING
- LD C,A
- LD A,(HL) GET OLD SWITCH SETTING
- LD (HL),C SAVE NEW SWITCH SETTING
- XOR C COMPARE
- BIT 3,A
- RET Z EXIT IF NO CHANGE OF TALK/DATA
- BIT 2,C
- RET NZ IGNORE TALK/DATA IF CONST DTR
- LD HL,ASCPKG+5 POINT AT REG. 5 CONTROL BYTE
- RES 7,(HL) CLEAR DTR BIT
- LD A,0FFH CLEAR DTR AND ERR LIGHTS
- OUT (PNLLTS),A
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- BIT 3,C SET DTR BIT IF IN DATA POS.
- JR Z,CHKSWS1
- SET 7,(HL) SET DTR BIT
- LD A,0DFH SET DTR LIGHT, CLEAR ERR LIGHT
- OUT (PNLLTS),A
- CHKSWS1 EQU *
- JP ASCSETUP SET UP SIO
- EJECT
- * * * * * * * * * * * * * * * * * * * *
- * CHECK FOR AND EXECUTE ESCAPE SEQUENCES OR CONTROL CODES.
- * ON ENTRY, THE CHARACTER TO BE EXECUTED IS IN THE C-REG.
- * ON EXIT, CARRY IS SET IF CHARACTER WAS A CONTROL CODE
- * OR THE SECOND CHARACTER OF AN ESCAPE SEQUENCE.
- * OTHERWISE CARRY IS CLEAR ON EXIT.
- * * * * * * * * * * * * * * * * * * * *
- ESCCTL EQU *
- LD A,(G.ESC) TEST FOR ESCAPE FLAG SET
- OR A
- JR Z,CTLCK JUMP IF NOT SET
- LD A,(ESCCOM)
- AND A CHECK IF IN CPM COMMAND ESCAPE SEQUENCE
- JP NZ,EX.ESCC JUMP IF YES
- LD (G.ESC),A CLEAR FLAG
- EX.ESC EQU *
- LD HL,(ESCADR) SEARCH FOR ESC SEQ MATCH
- JR CTLEXEC
- CTLCK EQU *
- LD A,C TEST FOR CONTROL CODE
- CP 20H
- RET NC NOT A CTL CODE, RETURN
- XOR A
- LD (CMODE),A CLEAR COMMAND MODE
- LD (NBYTES),A CLEAR NBYTES COUNTER
- EX.CTL EQU *
- LD HL,(CTLADR) SEARCH FOR CONTROL CODE MATCH
- CTLEXEC EQU *
- CALL SEARCH EXECUTE CHAR
- SCF SET CARRY FLAG
- RET
- *
- SEARCH EQU *
- LD A,(HL) IF FF REACHED, NO MATCH
- CP 0FFH
- RET Z IGNORE CHAR IF NOT FOUND
- SEARCH1 EQU *
- CP C
- JR Z,MATCH CHECK FOR CHAR MATCH
- INC HL CONTINUE SEARCHING
- INC HL
- INC HL
- JR SEARCH
- MATCH EQU *
- INC HL
- LD E,(HL)
- INC HL MATCH, JUMP TO EXECUTE COMMAND
- LD D,(HL)
- EX DE,HL
- LD DE,M.CCR
- JP (HL)
- EJECT
- **********
- * CONVERT KEYBOARD CODE IN E REG TO ASCII CODE IN C REG.
- * ON EXIT, THE ZERO FLAG IS SET IF THE KEY IS UNDEFINED.
- * FOR DEFINED KEYS, THE ZERO FLAG IS CLEAR.
- **********
- KBCON EQU *
- LD D,00
- LD HL,(KBAADR)
- ADD HL,DE
- LD A,(HL)
- LD C,A
- CP 0FFH
- RET
- *
- ISTASC EQU *
- HEX 30,31,32,33 0X
- HEX 34,35,36,37
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- HEX 38,39,26,60
- HEX 0A,5E,2B,2D
- HEX 13,04,07,08 1X
- HEX 7B,0B,0D,1A
- HEX 02,12,01,03
- HEX 7D,0C,FF,FF
- HEX 3C,3E,5B,5D 2X
- HEX 24,25,5F,7C
- HEX 2A,28,40,27
- HEX 1C,5C,23,7E
- HEX 17,05,14,19 3X
- HEX 7F,09,1E,18
- HEX 0E,1D,11,16
- HEX 00,0F,FF,FF
- HEX 20,61,62,63 4X
- HEX 64,65,66,67
- HEX 68,69,6A,6B
- HEX 6C,6D,6E,6F
- HEX 70,71,72,73 5X
- HEX 74,75,76,77
- HEX 78,79,7A,3D
- HEX 3B,2F,2E,2C
- HEX 1F,41,42,43 6X
- HEX 44,45,46,47
- HEX 48,49,4A,4B
- HEX 4C,4D,4E,4F
- HEX 50,51,52,53 7X
- HEX 54,55,56,57
- HEX 58,59,5A,29
- HEX 3A,3F,21,22
- ENDB 00
- EJECT
- **********
- * 'THE FOLLOWING ROUTINE TRANSFERS DATA IN HL TO THE
- * TRANSMIT BUFFER. KEYBOARD DATA IS CONVERTED TO ASCII.
- **********
- TX.STOR EQU *
- LD E,L SAVE DATA IN DE
- LD C,L SAVE DATA IN C IF KEYBOARD
- LD D,H
- ADD HL,HL IS THIS KYBD DATA
- LD A,07H
- AND H
- JR Z,XMIT.1 YES, JUMP.
- TX.STOR3 EQU * NOT KYBD DATA, SO
- PUSH DE
- LD C,1BH SEND ESC CODE
- CALL XMIT.1
- POP DE
- LD A,3FH SEND LOWER 6 BITS
- AND E
- ADD A,40H
- LD C,A
- PUSH DE
- CALL XMIT.1
- POP HL SEND UPPER 4 BITS
- ADD HL,HL
- ADD HL,HL
- LD A,H
- AND 0FH
- ADD A,40H
- LD C,A
- CALL XMIT.1
- RET AND EXIT.
- **********
- * STORE CHAR FROM C-REGISTER INTO TRANSMIT BUFFER.
- **********
- XMIT.1A EQU * GRAPHIC/TIMESHARE MODE ENTRY
- LD A,(LOC.RMT)
- OR A
- RET NZ JUST EXIT IF LOCAL
- XMIT.1 EQU * PLATO MODE ENTRY
- LD HL,TXBUF TEST FOR FULL BUFFER
- LD A,07H
- CP (HL)
- JR C,XMIT.1 JUMP IF FULL
- INC (HL) NOT FULL, INC DIFF CNT
- INC HL POINT TO INPUT INDEX
- AND (HL) GET IT
- INC (HL) AND INCREMENT IT
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- INC HL POINT TO BUFFER AREA
- INC HL
- LD E,A ADD THE INPUT INDEX
- LD D,00H
- ADD HL,DE
- LD A,C CALCULATE PARITY ON XMIT CHAR
- OR A
- JP PE,XMIT.1B
- SET 7,C ASSUME EVEN PARITY
- XMIT.1B EQU *
- LD A,(MODE) CHECK MODE
- RLCA
- JR C,XMIT.1E JUMP IF PLATO
- LD A,(PARITY) IS PARITY SELECTED
- BIT 1,A
- JR NZ,XMIT.1C JUMP IF NO
- BIT 0,A YES, IS IT EVEN OR ODD
- JR Z,XMIT.1E JUMP IF EVEN
- JR XMIT.1D ODD
- XMIT.1C EQU *
- IN A,(COMMSW) CHECK EVEN/ODD
- BIT 4,A
- JR NZ,XMIT.1E JUMP IF EVEN
- XMIT.1D EQU *
- LD A,C CHANGE TO ODD PARITY
- XOR 80H
- LD C,A
- XMIT.1E EQU *
- LD (HL),C STORE DATA IN TXBUF
- LD HL,TXBUSY EXIT IF ASCII TRANSMITTER BUSY
- BIT 0,(HL)
- RET NZ
- DI TRANSMITTER IS IDLE, SO SET
- SET 0,(HL) BUSY FLAG AND START TRANSMIT
- CALL ASCCREQ
- RET
- EJECT
- **********
- * ROUTINE TO CHECKSUM RAM DURING IDLE TIME.
- * ON EXIT, ZERO FLAG IS SET IF CHECKSUM IS PROCEEDING OK.
- * IF THERE IS A CHECKSUM ERROR, THE ZERO FLAG IS CLEAR.
- **********
- CHKSUM EQU *
- LD DE,(CKSUMADD) GET CURRENT ADDRESS
- LD HL,(CKSUMWC) GET CURRENT WORD COUNT
- LD A,(CKSUM) GET CURRENT CHECKSUM
- LD C,A
- LD B,100 SET COUNTER
- CHKSUM1 EQU *
- LD A,L ARE WE DONE WITH THIS PART
- OR H
- JR Z,CHKSUM4 YES, JUMP
- LD A,(DE) ADD BYTE TO CHECKSUM
- ADD A,C
- LD C,A
- INC DE
- DEC HL
- DJNZ CHKSUM1 LOOP IF COUNT NOT EXPIRED
- CHKSUM2 EQU *
- LD (CKSUMADD),DE SAVE CURRENT ADDRESS
- LD (CKSUMWC),HL SAVE CURRENT WORD COUNT
- LD A,C SAVE CURRENT CHECKSUM
- LD (CKSUM),A
- XOR A SET ZERO FLAG
- RET
- CHKSUM4 EQU *
- LD HL,(CKSUMTAD) GET CURRENT TABLE ADDRESS
- LD E,(HL) DE = NEW ADDRESS
- INC HL
- LD D,(HL)
- INC HL
- LD A,(HL) BA = NEW WORD COUNT
- INC HL
- LD B,(HL)
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- INC HL
- LD (CKSUMTAD),HL SAVE PLACE IN TABLE
- LD L,A HL = BA = NEW WORD COUNT
- LD H,B
- OR B IS BYTE COUNT = 0
- JR NZ,CHKSUM2 NO, CONTINUE
- CHKSUM5 EQU * END OF TABLE FOUND
- LD A,(CKSMFG)
- OR A TEST TO STORE OR TEST CHECKSM
- JR Z,CHKSUM6 TEST IF FLAG = 00
- *
- XOR A
- LD (CKSMFG),A CLEAR FLAG.
- LD A,C
- LD (CHECKSUM),A STORE CHECKSUM
- CHKSUM6 EQU *
- LD A,(CHECKSUM) DOES CHECKSUM AGREE
- CP C
- PUSH AF SAVE TEST RESULT
- CALL CHKSUM.I REINITIALIZE
- POP AF GET SAVED TEST RESULT
- RET
- CHKSUM.I EQU *
- XOR A INITIALIZE FOR CHECKSUM
- LD C,A COMPUTATION
- LD (CKSUM),A
- LD HL,(CKSUMTBL)
- LD (CKSUMTAD),HL
- JR CHKSUM4
- EJECT
- **********
- * THIS ROUTINE PERFORMS ERROR RECOVERY PROTOCOL DURING
- * TRANSFERS FROM THE DSN NETWORK TO THE TERMINAL.
- * THE PROTOCOL FOR ASCII MODES (TIMESHARE OR GRAPHIC) MERELY
- * CHECKS FOR PARITY ERRORS AND TURNS ON THE ERR LIGHT UNTIL
- * THE NEXT CHARACTER IS RECEIVED IF THERE IS A PARITY ERROR
- * AND PARITY CHECKING IS SELECTED. IN TIMESHARE MODE, AN
- * ERROR CHARACTER IS DISPLAYED AS A PAD CHARACTER. IN PLATO
- * MODE, THE PROTOCOL UTILIZES EVEN PARITY ON EACH CHARACTER
- * TRANSFERRED AND ALSO A MODULO 96 WORD COUNT ON THE
- * BLOCK. 'THE FIRST CHARACTER RECEIVED IS AN ACK CODE
- * FOLLOWED BY A WORD COUNT BYTE FOLLOWED BY THE REST OF
- * THE DATA. 'THE TERMINAL SENDS AN ACK,WC AFTER EACH 20TH
- * BYTE RECEIVED UNLESS A PARITY ERROR HAS OCCURRED IN WHICH
- * CASE A NAK,WC IS SENT IMMEDIATELY.
- * 'THE C REGISTER CONTAINS THE DATA BYTE ON ENTRY.
- * ON EXIT, CARRY=1 SAYS TO DISCARD THE CHARACTER
- * CARRY=0 SAYS TO UTILIZE THE CHARACTER.
- **********
- ERRCHK EQU *
- LD A,(MODE) CHECK MODE
- RLCA
- JR C,ERRCHKP JUMP IF PLATO
- LD A,(PARITY) ASCII, SO CHECK PAR/NO PAR
- BIT 1,A
- JR NZ,ERRCHK2 JUMP IF NO PAR
- BIT 0,A PAR, SO CHECK EVEN/ODD
- LD A,C PUT CHAR IN A
- JR Z,ERRCHK1 JUMP IF EVEN PAR
- XOR 80H TOGGLE PARITY BIT
- ERRCHK1 EQU *
- OR A
- JP PO,ERR.A JUMP IF PARITY ERROR
- ERRCHK2 EQU *
- LD A,C PARITY OK...
- RES 7,A
- CP 7FH IS CHARACTER A RUBOUT
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- JR NZ,E006 NO, CONTINUE
- LD A,0DFH TURN OFF ERR LIGHT
- OUT (PNLLTS),A
- LD A,(MODE) CHECK FOR ALPHA MODE
- AND 0BFH MASK OUT CPM MODE BIT
- XOR 3
- RET NZ EXIT (USE CHAR) IF NOT ALPHA
- SCF
- RET EXIT(IGNORE CHARACTER)
- ERR.A EQU * ASCII MODE ERROR ENTRY
- LD A,(TGMODE) CHECK TIMESHARE/GRAPHIC
- OR A
- JR NZ,ERR.P JUMP IF GRAPHIC MODE
- LD C,7FH TS,SO CHANGE ERROR CHAR TO PAD
- ERR.P EQU * PLATO MODE ERROR ENTRY
- LD A,0DEH TURN ON ERR LIGHT
- OUT (PNLLTS),A
- LD HL,EREG POINT TO ERROR PROTOCOL FLAGS
- RES 6,(HL) CLEAR ACK FLAG
- OR A CLEAR CARRY
- BIT 0,(HL) TEST STATE 0
- RET NZ USE CHAR IF STATE = 0
- BIT 1,(HL) TEST STATE 1
- CALL NZ,SENDNAK SEND NAK,M AND SET STATE 2 IF
- SCF STATE=1
- RET EXIT(DISCARD CHARACTER)
- ERRCHKP EQU * PLATO MODE ERROR PROTOCOL
- LD A,C
- OR A
- JP PO,ERR.P JUMP IF PARITY ERROR
- LD HL,EREG POINT TO ERROR CONTROL FLAGS
- LD A,06H IF CHAR=ACK THEN
- CP C
- JR NZ,E001
- SET 6,(HL) SET ACK FLAG
- SCF
- RET AND EXIT(DISCARD)
- E001 EQU *
- BIT 0,(HL) ELSE IF STATE=0
- JR Z,E100 (NON ERROR CONTROL) THEN
- BIT 6,(HL) IF ACK FLAG=1 THEN
- JR Z,E006
- E002 EQU *
- RES 6,(HL) CLEAR ACK FLAG
- LD A,C
- RES 7,A
- SUB 20H
- RET C EXIT(DISCARD) IF CTRL CHAR
- LD (MREG),A THEN SAVE BIASED CHAR
- LD (NREG),A AT M AND N
- LD (HL),02H SET STATE=1
- LD A,0DFH TURN OFF ERR LIGHT
- OUT (PNLLTS),A
- SCF AND EXIT(DISCARD)
- RET
- E006 EQU *
- LD A,0DFH TURN OFF ERR LIGHT
- OUT (PNLLTS),A
- OR A CLEAR CARRY
- RET EXIT(USE CHAR)
- E100 EQU *
- BIT 1,(HL) IF NOT STATE 1 THEN JUMP
- JR Z,E200
- BIT 6,(HL) IF ACK FLAG=1 THEN
- JR Z,E105
- RES 6,(HL) CLEAR ACK FLAG
- LD A,C
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- SUB 20H SET N = CHAR-20H
- LD (NREG),A
- SCF EXIT(DISCARD)
- RET
- E105 EQU * ELSE
- LD A,(MREG) IF N=M (NORMAL CASE) THEN
- LD B,A
- LD A,(NREG)
- CP B
- JR NZ,E107
- INC A SET M AND N =
- CP 60H N+1 MOD 96
- JR NZ,E106
- XOR A
- E106 LD (NREG),A
- LD (MREG),A
- RES 7,(HL) MARK AS OK CHAR
- JR E109
- E107 EQU * M<>N, SO
- INC A SET N = N+1 MOD 96
- CP 60H
- JR NZ,E108
- XOR A
- E108 LD (NREG),A
- SET 7,(HL) MARK AS DISCARD CHAR
- E109 EQU * NOW TEST THE CHAR COUNTER.
- LD A,(E.CNTR) IF E.CNTR<>1 THEN
- DEC A
- JR NZ,E110
- LD A,20 RESET IF = 0
- E110 EQU *
- LD (E.CNTR),A DECREMENT E.CNTR
- JR NZ,E114
- PUSH BC COUNTER=0, SO
- LD C,06H SEND ACK
- CALL XMIT.1
- LD A,(MREG) SEND M+20H
- ADD A,20H
- LD C,A
- CALL XMIT.1
- POP BC
- E114 EQU *
- LD A,(HL) PUT MARK IN CARRY FLAG
- RLCA
- RET AND EXIT
- E200 EQU * ERROR STATE
- BIT 6,(HL) TEST ACK FLAG
- JP NZ,E002 RESYNC IF SET
- SCF EXIT(DISCARD)
- RET
- * PLATO COMMUNICATIONS ERROR STATE TIMER,
- * RESENDS NAK SEQUENCE EVERY 250 MS UNTIL ACK RECEIVED.
- TIMOUT EQU *
- LD HL,(ECLOCK) HAS TIMER EXPIRED
- DEC HL
- LD (ECLOCK),HL
- LD A,L
- OR H
- RET NZ NO, EXIT
- * CALLABLE ROUTINE TO SEND NAK SEQUENCE AND SET ERROR STATE.
- SENDNAK EQU *
- LD A,0DEH TURN ON ERR LIGHT
- OUT (PNLLTS),A
- LD A,04H SET STATE=2 (ABORT)
- LD (EREG),A AND CLEAR ACK FLAG
- LD C,15H SEND NAK
- CALL XMIT.1
- LD A,(MREG) SEND WC+20H
- ADD A,20H
- LD C,A
- CALL XMIT.1
- LD HL,300 RESET 250 MS TIMER
- LD (ECLOCK),HL
- RET
- ENDB 00 LOAD AND CHECKSUM
- EJECT PROCESS LDM COMMAND
- * * * * * * * * * * * * * * * * * * * * *
- *
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * LOAD MODE INSTRUCTION, (LDM)
- *
- * LOAD TERMINAL OPERATING MODE
- *
- * BIT 1 BULK ERASE
- *
- * BIT 3 BIT 2
- * 0 0 ERASE WRITE INVERSE
- * 0 1 WRITE WRITE NORMAL
- * 1 0 ERASE OVERSTRIKE ER
- * 1 1 WRITE OVERSTRIKE WR
- *
- * BITS 4-6 LOAD OPERATING MODE
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- MODESET EQU * USER ENTRY POINT
- LD A,L
- SRL A SET CARRY IF BULK ERASE
- LD (M.MODE),A STORE MODE BITS
- CALL C,BULKER BULK ERASE IF CARRY SET
- LD A,(M.MODE) GET MODE BITS
- RRCA
- RRCA
- AND 07H
- LD C,A
- LD A,(MODE) INSERT THEM INTO MODE
- AND 0C0H SAVE CPM AND PLATO/ASCII MODE BITS
- OR C
- LD (MODE),A
- LD A,(M.MODE)
- JR LDM3
- MODESET1 EQU * LOCAL ENTRY TO SET W/E BITS
- LD A,(M.MODE) GET PRESENT MODE
- AND 0FCH CLEAR WRITE/ERASE BITS
- OR L INSERT NEW WRITE/ERASE BITS
- LD (M.MODE),A STORE MODE BITS
- LDM3 EQU *
- LD IX,CGPARM
- LD (IX+0),-01
- BIT 1,A TEST FOR OVERSTRIKE OR WRITE
- JR NZ,LDM4
- INC (IX+0) SET FOR NORMAL WRITE
- LDM4 EQU *
- LD (IX+1),-01
- LD (IX+2),-01
- BIT 0,A TEST FOR WRITE OR ERASE
- JR Z,LDM5
- INC (IX+2) SET FOR WRITE.
- *
- LDM5 EQU *
- RET
- MODESET2 EQU * LOCAL ENTRY TO SET MODE BITS
- LD A,(MODE) GET OLD MODE BITS
- AND 0C0H CLEAR OLD MODE BITS
- BIT 7,A
- JR Z,MODSET2A JUMP IF ASCII MODE
- XOR A CLEAR BYPASS IN PLATO MODE
- LD (BYPASS),A
- LD A,(MODE)
- AND 40H
- OR 80H GET BACK PLATO MODE BIT
- MODSET2A EQU *
- OR C INSERT NEW MODE BITS
- LD (MODE),A STORE MODE BITS
- ADD A,A SHIFT LEFT 2 AND SAVE IN C
- ADD A,A
- LD C,A
- LD A,(M.MODE) UPDATE MODE BITS IN M.MODE
- AND 0E3H
- OR C
- LD (M.MODE),A
- RET
- EJECT
- * * * * * * * * * * * * * * * * * * * * *
- *
- * PROCESS LOAD COORDINATE , (LDC)
- *
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- LDC EQU *
- CALL GETXY GET COORDINATES
- PUSH DE
- PUSH DE SAVE Y COORDINATE.
- CALL R.OUTX SET COORDINATES
- POP HL
- POP HL GET Y COORDINATE.
- CALL R.OUTY
- RET
- EJECT ECHO COMMAND PROCESSOR
- * * * * * * * * * * * * * * * * * * * * *
- *
- * PROCESS LOAD ECHO INSTRUCTION (LDE)
- *
- * BITS 1-7 ECHO CODE
- *
- * ECHO CODE =70 STATUS REQUEST. THE CONTENTS
- * M.TYPE IS LOADED AS THE ECHO
- *
- * =7A SEND BACKOUT, TURN OFF DTR
- *
- * =7B SOUND AUDIBLE TONE AT TERMIN
- *
- * =7C TERMINAL ID CODE REQUEST. TH
- * TERMINAL SIXTEEN BIT ID CODE
- * LOADED INTO FOUR ECHO RESPON
- *
- * =7D REQUEST FOR TERMINAL FLAG
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- LDE EQU *
- CALL GET3 GET NEXT 3 BYTES
- LD A,L
- AND 7FH
- CP 70H TEST FOR STATUS REQUEST
- JR NZ,LDE0
- SPACE 1
- LD A,(M.TYPE) LOAD TERMINAL TYPE CODE
- SET 7,A SET ECHO OP CODE
- LD L,A LOAD TYPE AS ECHO
- LD H,00 CATEGORY 3 SET TO 0 FOR
- CALL R.XMIT TEST IN TX.STOR FOR XMIT
- RET
- *
- LDE0 EQU *
- CP 7AH TEST FOR TURN OFF 'D'T'R
- JR NZ,LDE1
- BACKOUT EQU *
- LD HL,03FFH SEND OUT BACK OUT CODE
- CALL R.XMIT TO PLATO
- BACKOUT1 EQU *
- LD A,01H WAIT UNTIL BACKOUT IS SENT
- OUT (ASCCTRL),A
- IN A,(ASCSTAT)
- BIT 0,A
- JR Z,BACKOUT1
- LD A,05H TURN OFF DTR AND RTS
- OUT (ASCCTRL),A
- LD A,28H
- OUT (ASCCTRL),A
- LD A,0FFH TURN OFF DTR AND ERR LIGHTS
- OUT (PNLLTS),A
- LD B,6 WAIT 3 SECONDS
- BACKOUT2 EQU *
- LD HL,0
- BACKOUT3 EQU *
- DEC HL
- LD A,L
- OR H
- JR NZ,BACKOUT3
- DJNZ BACKOUT2
- XOR A FORCE FULL TIMESHARE MODE INIT
- LD (RESETFLG),A
- JP R.INIT
- *
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- LDE1 EQU *
- CP 7CH TEST FOR ID REQUEST
- JR NZ,LDE2 NOT ID REQUEST
- *
- IN A,(IDLO) INPUT LOWER EIGHT BITS OF ID
- PUSH AF
- AND 0FH MASK LOWER FOUR BITS
- OR 80H INCLUDE OP CODE AND ID COUNT
- LD L,A
- LD H,00 CATEGORY 3 SET TO 0 FOR
- CALL R.XMIT TEST IN TX.STOR FOR XMIT
- *
- POP AF
- RRCA
- RRCA
- RRCA
- RRCA
- AND 0FH MASK SECOND FOUR BITS
- OR 90H INCLUDE OP CODE AND ID COUNT
- LD L,A
- LD H,00 CATEGORY 3 SET TO 0 FOR
- CALL R.XMIT TEST IN TX.STOR FOR XMIT
- *
- IN A,(IDUP) INPUT UPPER EIGHT BITS
- PUSH AF
- AND 0FH MASK LOWER FOUR BITS
- OR 0A0H INCLUDE OP CODE AND COUNT
- LD L,A
- LD H,00 CATEGORY 3 SET TO 0 FOR
- CALL R.XMIT TEST IN TX.STOR FOR XMIT
- *
- POP AF
- RRCA
- RRCA
- RRCA
- RRCA
- AND 0FH MASK UPPER FOUR BITS
- OR 0B0H INCLUDE OP CODE AND ID COUNT
- LD L,A
- LD H,00 CATEGORY 3 SET TO 0 FOR
- CALL R.XMIT TEST IN TX.STOR FOR XMIT
- RET
- *
- LDE2 EQU *
- CP 7BH TEST FOR AUDIBLE
- JR NZ,LDE3 NOT AUDIBLE
- AND 01
- OUT (MISCTL),A SOUND AUDIBLE ALARM
- RET
- *
- LDE3 EQU *
- CP 7DH TEST FOR TERMINAL FLAG REGIS
- JR NZ,LDE4 NOT FLAG REQUSET
- *
- LD HL,(MEMREG) LOAD FLAG POINTER
- LD A,(HL) LOAD CONTENTS OF FLAG REGIST
- AND 7FH AND MASK LOWER SEVEN BITS
- *
- LDE4 EQU *
- OR 80H SET ECHO OP CODE
- LD L,A LOAD ECHO CODE
- LD H,00 CATEGORY 3 SET TO 0 FOR
- CALL R.XMIT TEST IN TX.STOR FOR XMIT
- RET EXIT
- EJECT PROCESS LDA COMMAND
- * * * * * * * * * * * * * * * * * * * * *
- *
- * LOAD MEMORY ADDRESS, (LDA)
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- LDA EQU *
- CALL GET3 GET NEXT 3 BYTES
- CALL CHKRG CHECK ADDRESS RANGE
- LD (MEMREG),HL
- RET
- *
- * CHECK ADDRESS IN HL BETWEEN BOUNDS
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * ADDRESS MUST BE BETWEEN BEGVAR1..ENDVAR1 OR ENDRES..7FFFH.
- * ROUTINE RETURNS TO CALLER WITH HL UNCHANGED IF IN BOUNDS.
- * ROUTINE EXITS THE CALLER IF HL WAS OUT OF BOUNDS.
- CHKRG EQU *
- EX DE,HL ADDRESS TO DE
- LD HL,-ENDRES
- ADD HL,DE
- JR NC,CHKRG0 JUMP IF <END OF RESIDENT
- EX DE,HL ADDRESS BACK TO HL
- BIT 7,H
- RET Z EXIT IF OK (<8000H)
- EX DE,HL ADDRESS BACK TO DE
- CHKRG0 EQU * ADDRESS IS <END OF RESIDENT
- LD HL,-BEGVAR1 OR >7FFFH
- ADD HL,DE
- JR NC,CHKRG1 JUMP IF <BEGVAR1 (ERROR)
- LD HL,-ENDVAR1
- ADD HL,DE
- EX DE,HL ADDRESS BACK TO HL
- RET NC EXIT IF <ENDVAR1 (OK)
- CHKRG1 EQU * OUT OF BOUNDS
- POP HL
- RET
- EJECT SSF AND EXT
- * * * * * * * * * * * * * * * * * * * * *
- *
- * SELECT SPECIAL FUNCTION
- *
- * THIS COMMAND IS USED TO COMMUNICATE WITH VARIOUS DEVI
- * CONNECTED TO THE EXTERNAL CHANNELS, AND SET THE TERMI
- * INTERNAL INTERRUPT MASK.
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- *
- * ON-LINE ENTRY POINT
- *
- SSF EQU *
- CALL GET3 GET NEXT 3 BYTES
- RES 7,H CLEAR UPPER BIT
- *
- * USER ENTRY POINT
- *
- SSF0 EQU *
- LD A,H
- RRCA
- RRCA
- AND 1FH MASK DEVICE ADDRESS BITS
- JR NZ,SSF1 NOT SLIDE PROJECTOR
- *
- * OUTPUT TO SLIDE PROJECTOR
- *
- LD C,20H LOAD SLIDE PROJECTOR ADDRESS
- OUT (C),L OUTPUT LOWER EIGHT BITS
- LD A,03
- AND H MASK UPPER TWO BITS
- OUT (C),A OUTPUT UPPER TWO BITS
- RET
- *
- SSF1 EQU *
- CP 01 TEST FOR INTERRUPT MASK
- JR NZ,SSF2 NOT INTERRUPT MASK
- LD A,L LOAD MASK
- JP ENAB AND SET INTERRUPT NASK
- *
- SSF2 EQU *
- BIT 1,H TEST FOR INPUT OR OUTPUT
- JR NZ,SSF3 GO TO INPUT IF NOT ZERO
- *
- * OUTPUT TO EXTERNAL DEVICE
- *
- LD (EXT.OUT),A STORE DEVICE ADDRESS
- LD C,A
- BIT 0,H TEST FOR DATA IN LOWER BITS
- RET NZ EXIT IF NONE
- *
- LD E,L
- LD HL,EXTD LOAD DATA STORE ADDRESS
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- LD (HL),E AND STORE DATA BYTE
- CP 03 TEST FOR SERIAL/PARALLEL
- RET Z CANNOT OUTPUT TO SER CTRL PORT
- JP C,SCOUT JUMP IF SER DATA PORT
- SET 5,C SET EXTERNAL CHANNEL BIT
- OUTI OUTPUT DATA FROM MEMORY
- RET
- *
- *
- * INPUT FROM EXTERNAL DEVICE
- *
- SSF3 EQU *
- LD (EXT.IN),A STORE DEVICE ADDRESS
- LD C,A
- BIT 0,H TEST FOR DATA IN LOWER BITS
- RET NZ EXIT IF NONE
- AND 1CH TEST FOR SERIAL OR PARALLEL
- JR NZ,SSF4 JUMP IF PARALLEL CHANNEL
- * SERIAL CHANNEL INPUT
- SET 4,C SELECT SERIAL CHANNEL
- BIT 0,C
- JR Z,SSF4A JUMP IF DATA INPUT
- LD L,00H STATUS INPUT....
- LD A,11H RESET EXTERNAL STATUS
- OUT (C),A
- IN A,(C) GET STATUS REG 1(ERROR STATUS)
- AND 70H
- JR Z,SSF3A
- SET 4,L SET RECEIVE DATA ERROR STATUS
- LD A,30H RESET ERROR LATCHES
- OUT (C),A
- SSF3A EQU *
- IN A,(C) GET STATUS REG 0
- AND 0ADH CLEAR UNUSED BITS
- OR L INSERT RECEIVE ERROR STATUS
- LD L,A
- IN A,(COMMSW) GET DSR STATUS
- BIT 7,A
- JR Z,SSF4B
- SET 1,L SET DSR STATUS
- JR SSF4B
- * PARALLEL CHANNEL INPUT
- SSF4 EQU *
- SET 5,C SELECT PARALLEL CHANNEL
- SSF4A EQU *
- IN L,(C) INPUT FROM DEVICE
- SSF4B EQU *
- LD H,82H LOAD OP CODE AND CATAGORY
- LD A,(M.KSW) LOAD USER/PLATO FLAG
- PUSH HL
- CP 02 FOR M.KSW=0 OR M.KSW=1
- CALL C,R.XMIT STORE FOR TRANSMIT TO PLATO
- POP HL FOR M.KSW=2 OR M.KSW=3
- * RETURN DATA IN L TO USER
- RET
- ENDB 00 LOAD AND CHECKSUM
- EJECT EXT
- * * * * * * * * * * * * * * * * * * * * *
- *
- * OUTPUT DATA TO EXTERNAL DEVICE
- *
- * THIS COMMAND TRANSFERS TWO BYTES OF DATA TO THE DEVIC
- * CONNECTED TO THE EXTERNAL CHANNEL, AND ADDRESSED BY T
- * LAST SSF COMMAND RECEIVED BY THE TERMINAL.
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- *
- * ON-LINE ENTRY POINT
- *
- EXT EQU *
- CALL GET3 GET NEXT 3 BYTES
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- EX DE,HL SAVE DATA IN TEMP AREA
- LD HL,EXTD+1
- LD (HL),E
- DEC HL
- LD (HL),D HL NOW POINTS TO TEMP AREA
- LD DE,02 LOAD DATA BYTE COUNT
- *
- * USER ENTRY POINT
- * ON ENTRY, HL=FWA AND DE=LENGTH IN BYTES
- EXTX EQU *
- LD A,(EXT.OUT) LOAD EXTERNAL DEVICE ADDRESS
- LD C,A
- AND 1CH TEST FOR SERIAL OR PARALLEL
- JR NZ,EXT3 JUMP IF PARALLEL CHANNEL
- *
- * SERIAL CHANNEL OUTPUT
- *
- BIT 0,C
- JR Z,EXT2 JUMP IF DATA OUTPUT
- SET 4,C SELECT SERIAL CHANNEL
- SRL D CONTROL OUTPUT
- RR E DIVIDE BYTE COUNT BY 2
- EXT0 EQU *
- LD A,(HL) CHECK WHICH SIO REGISTER IS
- AND 07H BEING WRITTEN INTO
- DEC A
- JR NZ,EXT0A
- INC HL REG 1 (CANNOT WRITE TO REG 1)
- INC HL
- JR EXT1
- EXT0A EQU *
- DEC A
- JR NZ,EXT0B
- INC HL REG 2 SETS CLOCK RATE
- LD B,(HL) GET RATE INFORMATION
- RES 0,B INSERT LONG LINE/RS232 BIT
- LD A,(RUNINFO) FROM RUNINFO
- AND 01H
- OR B
- OUT (SERRATE),A
- INC HL
- JR EXT1
- EXT0B EQU *
- OUTI OTHER REGISTERS ARE WRITTEN
- OUTI INTO IN BYTE PAIRS
- EXT1 EQU *
- DEC DE
- LD A,E
- OR D
- JR NZ,EXT0 LOOP UNTIL OUTPUT IS DONE
- RET
- EXT2 EQU *
- CALL SCOUT DATA OUTPUT
- DEC DE
- LD A,E
- OR D
- JR NZ,EXT2
- RET
- * OUTPUT DATA FROM (HL) TO SERIAL I/O ADDRESS (C).
- * OUTPUT IS ABORTED IF CHARACTER REQUEST TIMEOUT OCCURS.
- SCOUT EQU *
- SET 4,C SELECT SERIAL CHANNEL
- LD A,(M.CLOCK) INITIALIZE TIMER
- ADD A,8
- LD B,A
- SCOUT1 EQU *
- IN A,(SERSTAT) CHECK SERIAL CHANNEL STATUS
- BIT 2,A
- JR NZ,SCOUT2 JUMP IF CHAR REQUEST
- LD A,(M.CLOCK)
- CP B
- JR NZ,SCOUT1 LOOP IF NO TIMEOUT
- RET ABORT OUTPUT
- SCOUT2 EQU *
- OUTI OUTPUT DATA
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- RET
- *
- * PARALLEL CHANNELS
- *
- EXT3 EQU *
- SET 5,C ADD EXT CHANNEL BIT
- *
- EXT4 EQU *
- OUTI OUTPUT DATA FROM MEMORY
- *
- DEC DE DECREMENT BYTE COUNT
- LD A,D
- OR E TEST FOR LAST BYTE
- JR NZ,EXT4 OUT PUT NEXT BYTE
- RET
- EJECT MODE 0, POINT PLOT
- * * * * * * * * * * * * * * * * * * * * *
- *
- * POINT PLOT MODE
- *
- * EACH MODE 0 DATA WORD SPECIFIES THE COORDINATES ON TH
- * DISPAY TO BE WRITTEN OR ERASED. BIT 2 OF THE LAST LDM
- * COMMAND RECEIVED WILL DETERMINE WRITE OR ERASE.
- *
- * MODE 0 DATA WORD
- * BITS 1-9 Y COORDINATE
- * BITS 10-18 X COORDINATE
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- SPACE 1
- APOINT EQU *
- CALL GETXY GET COORDINATES
- *
- * WRITE/ERASE SINGLE DOT
- *
- * USER ENTRY POINT
- SPACE 1
- POINT EQU *
- PUSH DE SAVE Y COORDINATE
- CALL R.OUTX LOAD X COORDINATE
- POP HL RETREIVE Y COORDINATE
- CALL R.OUTY LOAD Y COORDINATE
- SPACE 1
- * USER ENTRY POINT
- SPACE 1
- WE EQU *
- CALL MASKS GENERATE WRITE/ERASE MASKS
- *
- EX DE,HL
- LD HL,(DMAA) LOAD DMA ADDRESS
- LD A,(M.MODE) LOAD WRITE/ERASE FLAG
- BIT 0,A TEST FOR WRITE OR ERASE
- JR Z,MODE01 GO TO ERASE
- *
- LD A,E LOAD WRITE MASK
- OR (HL) INCLUDE POINT IN DMA DATA
- LD (HL),A AND STORE IN DMA
- RET
- *
- MODE01 EQU *
- LD A,D LOAD ERASE MASK
- AND (HL) ERASE POINT
- LD (HL),A STORE RESULT IN DMA
- RET
- EJECT MODE 1, VECTOR GENERATOR
- * * * * * * * * * * * * * * * * * * * * *
- *
- * VECTOR MODE
- *
- * EACH DATA WORD RECEIVED SPECIFIES THE END COORDINATES
- * THE LINE TO BE DRAWN. THIS LINE IS DRWWN BETWEEN THE
- * CURRENT COORDINATES AND THE END COORDINATES SPECIFIED
- * THE MODE 1 DATA WORD. THE END COORDINATES IS ALSO THE
- * OF THE NEXT LINE TO BE DRAWN.
- *
- * MODE 1 DATA WORD
- * BITS 1-9 Y COORDINATE
- * BITS 10-18 X COORDINATE
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- GRAPH EQU *
- CALL GETXY GET COORDINATES
- LD A,(DARK)
- AND A IF DARK VECTOR,
- JR Z,ALINE BASE POSITION
- PUSH DE SAVE Y COORD
- CALL R.OUTX OUTPUT X
- POP HL
- CALL R.OUTY OUTPUT Y
- XOR A TURN OFF DARK VECTOR
- LD (DARK),A
- RET
- *
- ALINE EQU *
- LD A,(DASH) LOAD FLAG FOR DASHED/SOLID
- RRA
- JP C,G.LINE1 IF SET, USE DASHED VECTOR
- * OTHERWISE R.LINE
- *
- LINE EQU *
- *
- LD (XEND),HL STORE X END COORDINATE
- EX DE,HL
- LD (YEND),HL STORE Y END COORDINATE
- *
- LD C,00 CLEAR C FOR VECTOR FLAG
- LD HL,(XREG) LOAD CURRENT X COORDINATE
- CALL CALDELX CALCULATE DELTA X
- LD HL,(YREG) LOAD CURRENT Y COORDINATE
- CALL CALDELY CALCULATE DELTA Y
- *
- LD A,08H TEST FOR NEGATIVE X
- AND C
- LD A,C
- LD (VECFLG),A STORE VECTOR FLAG
- JR Z,MODE11 JUMP IF Y POSITIVE
- XOR 10H TOGGLE Y DIRECTION
- LD (VECFLG),A AND STORE
- LD HL,(YEND) RESET VECTOR
- CALL R.OUTY LOAD COORDINATE.
- LD HL,(XEND)
- CALL R.OUTX LOAD COORDINATE.
- *
- MODE11 EQU *
- LD HL,(YDELTA)
- EX DE,HL
- LD HL,(XDELTA) LOAD DELTA X
- SBC HL,DE
- JR NC,MODE12 JUMP IF X GREATER
- *
- * DELTA Y GREATER
- *
- LD HL,(XDELTA) LOAD DELTA X
- CALL DIVIDE CALCULATE SLOPE
- LD BC,(YDELTA) LOAD DELTA FOR LOOP COUNT
- CALL VECINIT INIT REGS FOR VECTOR ROUTINE
- JR YVEC
- *
- * DELTA Y IS EQUAL TO OR LESS THAN DELTA X
- *
- MODE12 EQU *
- LD HL,(XDELTA) LOAD DELTA X
- EX DE,HL
- CALL DIVIDE CALCULATE SLOPE
- LD BC,(XDELTA) LOAD DELTA FOR LOOP COUNT
- CALL VECINIT INIT REGS FOR VECTOR ROUTINE
- JR XVEC
- *
- * INITIALIZATION ROUTINE FOR VECTOR GENERATORS.
- *
- VECINIT EQU *
- LD A,C TOGGLE BIT 7 OF C FOR
- XOR 80H USE BY VECTOR GENERATOR
- LD C,A JP,PE INSTRUCTION
- EXX
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- CALL MASKS GENERATE MASKS
- LD C,L
- LD B,00 SET WRITE MASK
- LD DE,0FFFFH LOAD FOR POSITIVE 'Y
- LD HL,(DMAA) LOAD STARTING ADDRESS
- LD A,(VECFLG) LOAD VECTOR PARAMETERS
- BIT 4,A TEST FOR POS 'Y DELTA
- JR Z,VECINIT1 JUMP IF X POSITIVE
- *
- INC DE SET DE FOR
- INC DE NEGATIVE 'Y
- *
- VECINIT1 EQU *
- LD A,(M.MODE) TEST MODE BITS
- RRA FOR WRITE OR ERASE
- RET C GO TO WRITE VECTOR
- DEC B SET ERASE MASK
- RET GO TO ERASE VECTOR
- EJECT
- * VECTOR GENERATOR. Y IS LONG AXIS, X IS SHORT AXIS.
- * WRITE/ERASE VECTOR.
- *
- * ON ENTRY,
- * B=WRITE/ERASE MASK (00=WRITE, FF=ERASE)
- * C=BIT MASK (BIT TO BE CHANGED=1, OTHER BITS=0)
- * DE=-1 IF WRITING UP TO RIGHT, +1 IF WRITING DOWN TO RIGHT
- * HL=CURRENT DISPLAY MEMORY ADDRESS
- * BC*=DELTA Y (BIT 7 OF C IS TOGGLED FOR USE WITH JP,PE)
- * DE*=SLOPE
- * HL*=ACCUMULATOR (INITIALLY 8000H)
- *
- * ENTRY POINT IS YVEC.
- *
- * THIS CODE IS TIME OPTIMIZED. DO NOT CHANGE WITHOUT
- * CAREFUL THOUGHT.
- *
- * TIMING FOR THIS ROUTINE.
- *
- * T STATES = 110*DELTA Y + 13*DELTA X
- * + 26*NO. OF HORIZONTAL BYTE BOUNDARIES CROSSED
- * + 16 (IF DELTA Y >=256) + 85
- *
- * TIME FOR DELTA Y=511, DELTA X=000 IS 14.078 MILLISECONDS.
- * TIME FOR DELTA Y=511, DELTA X=510 IS 16.145 MILLISECONDS.
- *
- YVEC1 EQU *
- ADD HL,DE ADD SLOPE TO ACCUMULATOR
- EXX
- JR NC,YVEC2
- RLC C MOVE ONE DOT RIGHT
- JR C,YVEC3
- YVEC2 EQU *
- ADD HL,DE MOVE ONE DOT UP OR DOWN
- SET 7,H
- * ENTRY POINT
- YVEC EQU *
- LD A,(HL) MODIFY CURRENT DOT
- XOR B
- OR C
- XOR B
- LD (HL),A
- EXX DECREMENT AND TEST COUNT
- DEC C
- JP PO,YVEC1 (LOOP IF NO OVERFLOW)
- DEC B
- JP P,YVEC1 LOOP IF NOT DONE YET
- JP MODE19 EXIT
- YVEC3 EQU *
- INC H MOVE RIGHT ONE BYTE
- INC H
- JP YVEC2
- EJECT
- * VECTOR GENERATOR. X IS LONG AXIS, Y IS SHORT AXIS.
- * WRITE/ERASE VECTOR.
- *
- * ON ENTRY,
- * B=WRITE/ERASE MASK (00=WRITE, FF=ERASE)
- * C=BIT MASK (BIT TO BE CHANGED=1, OTHER BITS=0)
- * DE=-1 IF WRITING UP TO RIGHT, +1 IF WRITING DOWN TO RIGHT
- * /--- BLOCK LARWK1 00 000 73/00/00 00.00
- * HL=CURRENT DISPLAY MEMORY ADDRESS
- * BC*=DELTA X (BIT 7 OF C IS TOGGLED FOR USE WITH JP,PE)
- * DE*=SLOPE
- * HL*=ACCUMULATOR (INITIALLY 8000H)
- *
- * ENTRY POINT IS XVEC.
- *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- * THIS CODE IS TIME OPTIMIZED. DO NOT CHANGE WITHOUT
- * CAREFUL THOUGHT.
- *
- * TIMING FOR THIS ROUTINE.
- *
- * T STATES = 106*DELTA X + 17*DELTA Y
- * + 36*NO. OF HORIZONTAL BYTE BOUNDARIES CROSSED
- * + 16 (IF DELTA X >=256) + 85
- *
- * TIME FOR DELTA X=511, DELTA Y=000 IS 14.134 MILLISECONDS.
- * TIME FOR DELTA X=511, DELTA Y=511 IS 16.306 MILLISECONDS.
- *
- XVEC1 EQU *
- ADD HL,DE ADD SLOPE TO ACCUMULATOR
- EXX
- JR NC,XVEC2
- ADD HL,DE MOVE ONE DOT UP OR DOWN
- SET 7,H
- XVEC2 EQU *
- RLC C MOVE ONE DOT RIGHT
- JR C,XVEC3
- * ENTRY POINT
- XVEC EQU *
- LD A,(HL) MODIFY CURRENT DOT
- XOR B
- OR C
- XOR B
- LD (HL),A
- EXX DECREMENT AND TEST COUNT
- DEC C
- JP PO,XVEC1 (LOOP IF NO OVERFLOW)
- DEC B
- JP P,XVEC1 LOOP IF NOT DONE YET
- JP MODE19 EXIT
- XVEC3 EQU *
- INC H MOVE RIGHT ONE BYTE
- INC H
- SET 7,H
- JP XVEC
- *
- *
- *
- MODE19 EQU *
- LD HL,(YEND)
- CALL R.OUTY LOAD COORDINATE.
- LD HL,(XEND)
- JP R.OUTX LOAD COORDINATE.
- ENDB 00 LOAD AND CHECKSUM
- EJECT MODE 2, DATA LOAD AND STORE
- * * * * * * * * * * * * * * * * * * * * *
- *
- * LOAD TERMINAL MEMORY
- *
- * EACH DATA WORD RECEIVED CONTAINS 16 BITS OF DATA TO B
- * STORED IN THE TERMINAL MEMORY. THIS DATA IS STORED IN
- * SUCCESSIVE LOCATIONS STARTING WITH THE CURRENT CONTEN
- * OF THE MEMORY ADDRESS REGISTER. AFTER EACH EIGHT BITS
- * IS STORED, THE MEMORY ADDRESS REGISTER IS INCREMENTED
- * THE MEMORY ADDRESS REGISTER IS INITIALIZED BY THE
- * LAST LDA COMMAND RECEIVED.
- *
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 2
- MEMORY EQU *
- CALL GET3 GET NEXT 3 BYTES
- LD B,H SAVE DATA IN BC
- LD C,L
- LD HL,(MEMREG) GET MEMORY ADDRESS
- CALL CHKRG CHECK AGAINST BOUNDS
- LD (HL),C STORE DATA
- INC HL
- LD (HL),B
- INC HL
- LD (MEMREG),HL SAVE UPDATED ADDRESS
- LD A,(CONFLG) TEST FOR CONVERTING
- OR A CHAR. DATA
- RET Z DO NOT CONVERT
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD A,(NDATAB)
- INC A
- LD (NDATAB),A INCREMENT COUNT ON DATA BYTES
- CP 08 IF 16 BYTES, THEN CONVERT DATA
- RET NZ
- LD DE,0010H
- XOR A CLEAR CARRY
- SBC HL,DE
- EX DE,HL DE _ FWA CHAR. DATA
- LD HL,0001 HL _ CHAR. COUNT OF 1
- CALL CONVERT
- XOR A
- LD (NDATAB),A CLEAR NUMBER DATA BYTES FG.
- RET
- EJECT MODE 3, CHARACTER GENERATOR
- * * * * * * * * * * * * * * * * * * * * *
- *
- *
- * ALPHA MODE
- *
- * MODE 3 DATA WORDS ARE CHARACTERS TO BE DISPLAYED.
- * ON ENTRY, THE CHAR IS IN THE C-REG.
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 2
- CHARACT EQU *
- LD A,(MODE) CHECK MODE
- RLCA
- JP NC,ALPHMODE GO TO ASCII CHAR GEN
- LD HL,M.CCR IS REVERSE SET
- BIT 6,(HL)
- JR Z,CHARS0 NO, JUMP
- PUSH BC YES, DO TAB FIRST
- EX DE,HL PUT M.CCR IN DE
- CALL TAB
- POP BC
- CHARS0 LD DE,(MEMSEL) DISPLAY THE CHARACTER
- LD A,C
- SUB 20H
- LD L,A
- JP CHARGEN
- **********
- * USER ENTRY POINT
- **********
- CHARS EQU *
- LD A,(HL) GET DATA
- RES 7,A MASK TO 7 BITS
- INC HL
- LD (CHFWA),HL SAVE CHAR ADDRESS
- LD HL,M.CCR
- CP 3FH IS CHAR AN UNCOVER CODE
- JR NZ,CHARS1 NO, JUMP
- SET 7,(HL) SET UNCOVER FLAG
- JR CHARS6
- CHARS1 EQU *
- BIT 7,(HL) IS UNCOVER FLAG SET
- JR NZ,CHARS10 YES, JUMP TO HANDLE CTL CODES
- BIT 6,(HL) IS REVERSE SET
- JR Z,CHARS2 NO, JUMP
- PUSH AF YES, DO TAB BEFORE PLOTTING
- PUSH HL
- EX DE,HL PUT M.CCR INTO DE
- CALL TAB
- POP HL
- POP AF
- CHARS2 EQU * NOW PLOT THE CHAR
- LD C,A SAVE CHAR IN C
- LD A,(HL) GET SELECTED CHAR MEM
- AND 0EH
- JR Z,CHARS4 JUMP IF M0 SELECTED
- SUB 2
- JR Z,CHARS3 JUMP IF M1 SELECTED
- LD DE,(MEMSEL) M2..M7, SO USE SELECTED MEM
- LD L,C AND UNTRANSLATED CHAR
- JR CHARS5
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- CHARS3 EQU * M1 SELECTED, SO
- SET 6,C BIAS CHAR
- CHARS4 EQU * M0 OR M1 SELECTED
- LD B,0 TRANSLATE CHAR TO ASCII
- LD HL,PCHARS
- ADD HL,BC
- LD L,(HL) GET BIASED ASCII CHAR IN L
- LD DE,M0CODE00 M0 IF L7=0
- BIT 7,L
- JR Z,CHARS5
- RES 7,L CLEAR FLAG BIT
- LD DE,M1CODE00 M1 IF L7=1
- CHARS5 EQU *
- CALL CHARGEN DISPLAY THE CHAR
- CHARS6 EQU *
- LD HL,(CHFWA) GET SAVED CHAR ADDRESS
- JR CHARS LOOP
- CHARS10 EQU * UNCOVER FLAG IS SET
- DEC A EXIT IF CHAR=01
- RET Z
- RES 7,(HL) CLEAR UNCOVER FLAG
- INC A EXIT IF CHAR=00
- RET Z
- CP 08H EXECUTE CONTROL CODES
- JR C,CHARS6 IGNORE 00-07
- CP 0EH
- JR NC,CHARS11
- LD C,A EXCUTE 08-0D
- CALL EX.CTL
- JR CHARS6
- CHARS11 EQU *
- CP 1EH
- JR NC,CHARS6 IGNORE 1E-7F
- ADD A,32H EXECUTE 0E-1D
- LD C,A (BIASED TO 40-4F)
- CALL EX.ESC
- JR CHARS6
- EJECT
- **********
- * THE FOLLOWING TABLE IS USED TO TRANSLATE FROM 6-BIT
- * PLATO CHARACTER CODES TO ASCII CODES.
- * BIT 7 SET INDICATES THE CHARACTER IS PHYSICALLY FOUND IN
- * M1, WHILE BIT 7 CLEAR INDICATES THE CHARACTER IS
- * PHYSICALLY FOUND IN M0. BITS 6-0 ARE THE ASCII CHARACTER
- * WITH 20H SUBTRACTED OFF FOR USE BY THE CHARACTER GENERATOR
- **********
- PCHARS EQU *
- HEX 1A,41,42,43 0X (M0)
- HEX 44,45,46,47
- HEX 48,49,4A,4B
- HEX 4C,4D,4E,4F
- HEX 50,51,52,53 1X
- HEX 54,55,56,57
- HEX 58,59,5A,10
- HEX 11,12,13,14
- HEX 15,16,17,18 2X
- HEX 19,0B,0D,0A
- HEX 0F,08,09,04
- HEX 1D,00,0C,0E
- HEX 8F,3B,3D,05 3X
- HEX 8A,84,07,02
- HEX 01,1B,1C,1E
- HEX 3F,1F,9F,00
- HEX 03,21,22,23 4X (M1)
- HEX 24,25,26,27
- HEX 28,29,2A,2B
- HEX 2C,2D,2E,2F
- HEX 30,31,32,33 5X
- HEX 34,35,36,37
- HEX 38,39,3A,83
- HEX 80,3E,9C,40
- HEX 86,87,88,89 6X
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 5E,8B,8C,8D
- HEX 8E,5B,5D,06
- HEX 85,00,5C,9D
- HEX 82,90,91,92 7X
- HEX 93,94,95,96
- HEX 97,98,99,9A
- HEX 9B,20,3C,00
- ENDB 00 LOAD AND CHECKSUM
- EJECT
- *
- *
- * BACKSPACE
- *
- BKSP EQU *
- LD A,(DE) LOAD PLOTTING FLAG
- XOR 40H TOGGLE FORW/REV BIT
- JR TAB0
- *
- * HORIZONTAL TAB
- *
- TAB EQU *
- LD A,(DE) LOAD PLOTTING FLAG
- *
- TAB0 EQU *
- LD DE,(SIZE) LOAD CHARACTER SIZE
- BIT 0,A TEST FOR HORIZONTAL/VERTICAL
- JR NZ,TAB2 GO TO VERT ROUTINE
- BIT 6,A TEST FOR FORWARD/REVERSE
- LD HL,(XREG) LOAD CURRENT X COORDINATE
- JR NZ,TAB1 GO TO REVERSE ROUTINE
- *
- ADD HL,DE ADD CHARACTER SIZE
- JP R.OUTX LOAD COORDINATE.
- *
- TAB1 EQU *
- AND A CLEAR CARRY BIT
- SBC HL,DE SUBTRACT CHARACTER SIZE
- JP R.OUTX LOAD COORDINATE.
- *
- TAB2 EQU *
- BIT 6,A TEST FOR FORWARD/REVERSE
- LD HL,(YREG) LOAD CURRENT Y COORDINATE
- JR NZ,TAB3 GO TO REVERSE ROUTINE
- *
- ADD HL,DE ADD CHARACTER SIZE
- JP R.OUTY LOAD COORDINATE.
- *
- TAB3 EQU *
- AND A CLEAR CARRY BIT
- SBC HL,DE SUBTRACT CHARACTER SIZE
- JP R.OUTY LOAD COORDINATE.
- *
- * LINE FEED
- *
- LF EQU *
- LD HL,(SIZE) LOAD CHARACTER SIZE
- ADD HL,HL AND ADJUST FOR HEIGHT
- EX DE,HL
- BIT 0,(HL) TEST FOR HOR/VERT
- JR NZ,LF1 GO TO VERTICAL ROUTINE
- *
- LD HL,(YREG) LOAD CURRENT Y COORDINATE
- AND A CLEAR CARRY BIT
- SBC HL,DE SUBTRACT CHARACTER SIZE
- JP R.OUTY LOAD COORDINATE.
- *
- LF1 EQU *
- LD HL,(XREG) LOAD CURRENT X COORDINATE
- ADD HL,DE ADD CHARACTER SIZE
- JP R.OUTX LOAD COORDINATE.
- *
- * VERTICAL TAB
- *
- VT EQU *
- LD HL,(SIZE) LOAD CHARACTER SIZE
- ADD HL,HL AND ADJUST FOR HEIGHT
- EX DE,HL
- BIT 0,(HL) TEST FOR HOR/VERT
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- JR NZ,VT1 GO TO VERTICAL ROUTINE
- *
- LD HL,(YREG) LOAD CURRENT Y COORDINATE
- ADD HL,DE ADD CHARACTER SIZE
- JP R.OUTY LOAD COORDINATE.
- *
- VT1 EQU *
- LD HL,(XREG) LOAD CURRENT X COORDINATE
- AND A CLEAR CARRY BIT
- SBC HL,DE SUBTRACT CHARACTER SIZE
- JP R.OUTX LOAD COORDINATE.
- *
- * FORM FEED
- *
- FF EQU *
- LD HL,512
- LD A,(M.CCR) LOAD PLOTTING PARAMETERS
- BIT 6,A TEST FOR FORWARD OR REVERSE
- JR Z,FF1 JUMP IF FORWARD
- *
- LD DE,(SIZE) LOAD CHARACTER SIZE
- AND A CLEAR CARRY BIT
- SBC HL,DE AND SUBTRACT FROM FULL SCE
- *
- FF1 EQU *
- BIT 0,A TEST FOR HORIZONTAL OR VERTI
- JR NZ,FF2 JUMP IF VERTICAL
- *
- CALL R.OUTX LOAD COORDINATE.
- *
- LD HL,(SIZE) LOAD CHARACTER SIZE
- ADD HL,HL AND DOUBLE IT
- LD DE,512 LOAD FULL SCREEN SIZE
- EX DE,HL
- AND A CLEAR CARRY BIT
- SBC HL,DE SUBTRACT SIZE FROM FULL SCRE
- JP R.OUTY LOAD COORDINATE.
- *
- FF2 EQU *
- CALL R.OUTY LOAD COORDINATE.
- *
- LD HL,(SIZE) LOAD CHARACTER SIZE
- ADD HL,HL AND DOUBLE IT
- DEC HL SUBTRACT ONE
- JP R.OUTX LOAD COORDINATE.
- *
- * CARRIAGE RETURN
- *
- CR EQU *
- LD HL,(SIZE) LOAD CHARACTER SIZE
- ADD HL,HL AND ADJUST FOR HEIGHT
- EX DE,HL
- BIT 0,(HL) TEST FOR HOR/VERT
- JR NZ,CR1 GO TO VERTICAL ROUTINE
- *
- LD HL,(YREG) LOAD CURRENT Y COORDINATE
- AND A CLEAR CARRY BIT
- SBC HL,DE SUBTRACT CHARACTER SIZE
- CALL R.OUTY LOAD Y COORDINATE
- LD HL,(M.MARGIN) LOAD MARGIN
- JP R.OUTX LOAD COORDINATE.
- *
- CR1 EQU *
- LD HL,(XREG) LOAD CURRENT X COORDINATE
- ADD HL,DE ADD CHARACTER SIZE
- CALL R.OUTX LOAD X COORDINATE
- LD HL,(M.MARGIN) LOAD MARGIN
- JP R.OUTY LOAD COORDINATE.
- *
- SUB EQU *
- LD HL,-0005 LOAD DISPLACEMENT
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- JR SUB0
- *
- SUPER EQU *
- LD HL,0005 LOAD DISPLACEMENT
- SUB0 EQU *
- LD A,(DE) LOAD PLOTTING FLAFG
- BIT 0,A TEST HORIZONTAL OR VERTICAL
- JR NZ,SUP1 GO TO VERTICAL PLOT
- *
- BIT 5,A
- JR Z,SUP0 JUMP IF SIZE ZERO
- ADD HL,HL ELSE DOUBLE DISPLACEMENT
- SUP0 EQU *
- EX DE,HL
- LD HL,(YREG) LOAD Y COORDINATE
- ADD HL,DE ADJUST COORDINATE
- JP R.OUTY LOAD COORDINATE.
- *
- SUP1 EQU *
- BIT 5,A
- JR Z,SUP2 JUMP IF SIZE ZERO
- ADD HL,HL ELSE DOUBLE DISPLACEMENT
- SUP2 EQU *
- EX DE,HL
- LD HL,(XREG) LOAD X COORDINATE
- AND A CLEAR CARRY BIT
- SBC HL,DE ADJUST COORDINATE
- JP R.OUTX LOAD COORDINATE.
- *
- SELECTMM EQU *
- LD A,C GET CHAR
- SUB 42H REMOVE BIAS
- RLCA
- CALL LDMEMSEL SELECT M0..M7
- LD HL,M.CCR UPDATE MEM SEL BITS IN (M.CCR)
- LD A,0F1H
- AND (HL)
- OR C
- LD (HL),A
- RET
- * CALLABLE ROUTINE TO SELECT M0..M7 AS SPECIFIED IN A-REG.
- *
- * ON ENTRY.. A-REG = 2 * MEM NO.
- *
- * ON EXIT... (MEMSEL) = FWA OF MEM NO.
- * C-REG = 2 * MEM NO.
- *
- LDMEMSEL EQU *
- LD C,A SAVE 2*MEM IN C
- LD DE,M0CODE00
- OR A
- JR Z,LDMEM1 JUMP IF M0 SELECTED
- LD DE,M1CODE00
- DEC A
- DEC A
- JR Z,LDMEM1 JUMP IF M1 SELECTED
- LD B,0 SELECT M2..M7
- LD HL,MEM2-4
- ADD HL,BC
- LD E,(HL)
- INC HL
- LD D,(HL)
- LDMEM1 LD (MEMSEL),DE
- RET
- *
- HOR EQU *
- EX DE,HL
- RES 0,(HL) AND SET HORIZONTAL PLOT
- LD A,16
- LD (HEIGHT),A LOAD CHARACTER HEIGHT
- RET
- *
- VERT EQU *
- EX DE,HL
- SET 0,(HL) AND SET VERTICAL PLOT
- LD A,08
- LD (HEIGHT),A LOAD CHARACTWR HEIGHT
- RET
- *
- FWD EQU *
- EX DE,HL
- RES 6,(HL) AND SET FORWARD PLOT
- RET
- *
- REV EQU *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- EX DE,HL
- SET 6,(HL) AND SET REVERSE PLOT
- RET
- *
- SIZE0 EQU *
- EX DE,HL
- RES 5,(HL) SET SIZE 0 FLAG
- LD HL,0008 LOAD SIZE 0 CHARACTER
- JR SIZEC
- *
- SIZE2 EQU *
- EX DE,HL
- SET 5,(HL) SET SIZE 2 FLAG
- LD HL,0010H LOAD SIZE 2 CHARACTER
- *
- SIZEC EQU *
- LD (SIZE),HL LOAD CHARACTER WIDTH
- ADD HL,HL
- LD (HEIGHT),HL LOAD CHARACTER HEIGHT
- RET
- EJECT
- * * * * * * * * * * * * * * * * * * * *
- *
- * CHARACTER GENERATOR
- * CALCULATES CHARACTER DATA ADDRESS AND JUMPS TO CHARAC
- * GENERATOR FOR PLOTTING DATA.
- *
- * ON ENTRY, L CONTAINS BIASED CHAR TO PLOT
- * DE CONTAINS FWA OF CHAR MEM TO BE USED
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- CHARGEN EQU *
- *
- LD H,00 ADJUST CHARACTER CODE
- ADD HL,HL CHARACTER DATA TABLE
- ADD HL,HL
- ADD HL,HL
- ADD HL,HL
- LD BC,000FH
- ADD HL,BC
- ADD HL,DE CHARACTER DAT ADDRESS
- PUSH HL
- POP IX CHAR DATA ADDRESS IN IX
- LD A,(M.CCR) LOAD PLOTTING PARAMETERS
- BIT 5,A TEST FOR SIZE ZERO OR SIZE T
- JP NZ,SIZE.2
- *
- BIT 0,A TEST FOR HOR. OR VERT.
- JP NZ,VPLOTX
- JP HPLOT
- ENDB 00 LOAD AND CHECKSUM
- EJECT BLOCK WRITE/ERASE
- EJECT SIZE 2
- * * * * * * * * * * * * * * * * * * * * *
- *
- * SIZE 2 CHARACTER GENERATOR
- * CHARACTER DATA IS EXPANDED TO DOUBLE THE WIDTH AND HE
- * OF THE CHARACTER AS IT IS DISPLAYED ON THE DISPLAY SC
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- SIZE.2 EQU *
- LD DE,SAVE3F LOAD TEMP. STORE ADDRESSES
- LD HL,SAVE1F
- EXX
- LD B,16 LOAD CHARACTER BYTE COUNT
- SIZE2.A EQU *
- EXX
- LD B,02 PASS COUNT
- LD C,(IX+0) DATA BYTE
- SIZE2.B EQU *
- XOR A EXPLODE 4 BITS TO 16 BITS
- SRL C
- JR NC,SIZE2.C
- OR 03
- SIZE2.C EQU *
- SRL C
- JR NC,SIZE2.D
- OR 0CH
- SIZE2.D EQU *
- SRL C
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- JR NC,SIZE2.E
- OR 30H
- SIZE2.E EQU *
- SRL C
- JR NC,SIZE2.F
- OR 0C0H
- SIZE2.F EQU *
- LD (DE),A STORE EXPLODED DATA
- DEC DE
- LD (DE),A
- DEC DE
- EX DE,HL
- DJNZ SIZE2.B LOOP ON 2 PASSES
- DEC IX POINT TO NEXT CHAR. DATA BYTE
- EXX
- DJNZ SIZE2.A LOOP FOR 16 BYTES.
- EXX
- LD IX,SAVE3F LOAD CHAR DATA ADDRESS.
- LD A,(M.CCR)
- BIT 0,A
- JR NZ,SIZE2V DO VERTICAL SIZE TWO
- EJECT
- **
- *
- * HORIZONTAL SIZE 2 PLOT
- *
- **
- SIZE2H EQU *
- CALL HPLOTN
- *
- LD HL,(XREG)
- LD DE,08
- ADD HL,DE
- CALL OUTX
- CALL HPLOTN
- LD HL,(XREG)
- LD DE,-08
- ADD HL,DE
- CALL OUTX
- LD A,(M.CCR)
- BIT 6,A TEST FOR FORWARD OR REVERSE
- CALL Z,TAB
- RET
- SPACE 2
- * * * * * * * * * * * * * * * * * * * * *
- *
- * VERTICAL PLOT
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- SIZE2V EQU *
- CALL VPLOTX
- LD HL,(XREG)
- LD DE,16
- ADD HL,DE
- CALL OUTX
- CALL VPLOTX
- LD HL,(XREG)
- LD DE,-16
- ADD HL,DE
- LD A,(M.CCR)
- BIT 6,A TEST FOR FORWARD OR REVERSE
- CALL Z,TAB TAB IF FORWARD
- RET
- EJECT FAST PLOT NORMAL(HORIZONTAL)
- **********
- * FAST HORIZONTAL PLOT NORMAL
- **********
- SPACE 2
- HPLOTN EQU *
- LD HL,(DMAA) LOAD DISPLAY ADDRESS
- LD DE,(DMA1)
- LD A,(HEIGHT)
- LD B,A LOAD CHARACTER HEIGHT.
- EXX
- *
- CG EQU *
- LD HL,CGPARM
- LD E,(HL)
- INC HL
- LD D,(HL)
- INC HL
- LD C,(HL)
- *
- LD A,(BP)
- AND 07 TEST FOR FAST PLOT.
- JR NZ,COMCG JUMP IF NOT FAST PLOT
- EXX
- *
- FHPLOT EQU *
- LD A,(HL)
- EXX
- XOR C
- AND E
- OR (IX+0)
- XOR C
- EXX
- LD (HL),A STORE RESULT ON SCREEN.
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- DEC HL UP DATE SCREEN ADDRESS
- DEC IX UP DATE CARACTER DATA ADDRESS
- *
- LD A,L THIS TESTS IF CHARACTER
- INC A IS SPLIT AT TOP AND BOTTOM
- JR NZ,FHPLT0 OF DISPLAY.
- BIT 0,H TEST FOR MIDDLE OF SCREEN
- JR Z,FHPLT0
- INC H ADJUST ADDRESS IF
- INC H CHARACTER WRAPS OFF TOP.
- SET 7,H
- *
- FHPLT0 EQU *
- DJNZ FHPLOT
- *
- RET
- EJECT COMMON CHARACTER GENERATOR
- ENDB 00
- *
- **********
- *
- * COMMON CHARACTER GENERATOR USED TO PLOT CHARACTERS
- * WHENEVER THE CHARACTER IS NOT LOCATED ON THE
- * COARSE GRID.
- *
- * ENTRY IX = ADDRESS OF CHARACTER DATA
- *
- **********
- COMCG EQU *
- LD B,A POSITION DATA MASK
- SCF
- COMCG1 EQU *
- RL E
- RL D
- DJNZ COMCG1
- EXX
- **
- *
- * CHARACTER PLOTTING LOOP
- *
- **
- COMCG4 EQU *
- LD A,(IX+0) GET CHAR DATA
- EXX
- LD L,A HL ';= CHAR DATA
- LD H,00H
- LD A,(BP) GET BIT POS
- AND 07H
- JR Z,COMCG6 JUMP IF NO ROTATE.
- *
- LD B,A
- COMCG5 EQU * POSITION CHAR DATA
- ADD HL,HL
- DJNZ COMCG5
- COMCG6 EQU *
- EXX
- LD A,(HL) MODIFY LEFT PART OF CHAR
- EXX
- XOR C COMPLIMENT SCREEN DATA IF ERASE
- AND E SAVE IF OVERSTRIKE
- OR L INCLUDE NEW CHAR DATA
- XOR C COMPLIMENT IF ERASE OR INVERSE
- EXX
- LD (HL),A
- LD A,(DE) MODIFY RIGHT PART OF CHAR
- EXX
- XOR C COMPLIMENT SCREEN DATA IF ERASE
- AND D SAVE IF OVERSTRIKE
- OR H INCLUDE NEW CHAR DATA
- XOR C COMPLIMENT IF ERASE OR INVERSE
- EXX
- LD (DE),A
- DEC DE UPDATE POINTERS
- DEC HL
- DEC IX
- DEC B
- RET Z ** EXIT **
- *
- LD A,L LOOP IF L NOT 0FFH
- INC A
- JR NZ,COMCG4
- BIT 0,H LOOP IF H IS EVEN
- JR Z,COMCG4
- INC H COLUMN OVERFLOW
- INC H
- SET 7,H
- INC D
- INC D
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- SET 7,D
- JR COMCG4
- SPACE 2
- **********
- * HORIZONTAL ADVANCE
- **********
- SPACE 2
- HPLOT EQU *
- CALL HPLOTN
- *
- H.ADV EQU *
- LD A,(M.CCR)
- BIT 6,A
- RET NZ IF REVERSE, RETURN
- LD HL,(XREG) OTHERWISE ADVANCE
- LD DE,0008 BY ONE CHAR. WIDTH
- ADD HL,DE
- JP R.OUTX
- EJECT VERTICAL CHARACTER DATA ROTATION
- * VERRT- VERTICAL ROTATION ROUTINE
- * THIS ROUTINE MOVES THE CURRENT CHARACTER DATA
- * TO A TEMPORARY STORAGE AREA, SAVE4F. THEN IT
- * ROTATES 16 BYTES OF CHARACTER DATA TO A TEMPORARY
- * STORAGE AREA, SAVE5F. 'THE ALGORITHM STORES BACK
- * INTO SAVE4F AREA THE INTERMEDIATE ROTATES WHICH
- * IS WHY THE INITIAL CHARACTER DATA MOVE IS NEEDED.
- * THIS ROTATION FACILITATES THE VERTICAL
- * CHARACTER GENERATION.
- * ENTRY- DE HAS LWA OF CHARACTER DATA
- * EXIT- IX HAS LWA OF ROTATED CHAR. DATA, SAVE5F
- SPACE 2
- VERRT EQU *
- PUSH IX
- POP HL
- LD DE,SAVE4F TO TEMPORARY STORE AREA
- LD BC,0010H
- LDDR
- LD C,08
- LD IX,SAVE3F+8 LOAD CHAR DATA ADDRESS
- VERRT.0 EQU *
- LD HL,SAVE4F+8
- LD DE,SAVE5F
- LD B,08
- VERRT.1 EQU *
- EX DE,HL
- RR (IX+8) SHIFT BIT OFF CHAR DATA
- RL (HL)
- DEC HL
- EX DE,HL
- RR (IX+0) SHIFT BIT OFF CHAR DATA
- RL (HL)
- DEC HL
- DJNZ VERRT.1 INNER LOOP 8 TIMES
- DEC IX
- DEC C
- JR NZ,VERRT.0 OUTER LOOP 8 TIMES
- LD IX,SAVE5F
- RET
- EJECT VERTICAL PLOT ADDRESS ADJUST/ADVANCE
- **********
- * VERTICAL PLOT ADDRESS ADJUST
- **********
- SPACE 2
- VADR.ADJ EQU *
- LD HL,(DMAA)
- DEC H
- DEC H
- SET 7,H
- LD (VDMA1),HL POINT TO WORD LEFT OF DMAA
- DEC H
- DEC H
- SET 7,H
- LD (VDMA2),HL POINT TO WORD LEFT OF VDMA1
- RET
- SPACE 2
- **********
- * VERTICAL CHARACTER GENERATOR ADVANCE ROUTINE
- *********
- V.ADV EQU *
- LD A,(M.CCR)
- BIT 6,A
- RET NZ IF REVERSE, RETURN
- LD DE,0008
- CALL R.INPY
- ADD HL,DE
- CALL R.OUTY
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- RET
- ENDB 00 LOAD AND CHECKSUM
- EJECT VERTICAL SCREEN TOP WRAP CHECK
- **********
- * VERTICAL WRAP ROUTINE
- * CHECKS TO SEE IF SCREEN TOP HAS BEEN
- * REACHED AND ADJUSTS VDMA1 AND VDMA2
- * IF SO.
- * ENTRY- DE HAS CURRENT DISPLAY MEM. ADDR.
- **********
- SPACE 2
- V.WRAP EQU *
- LD A,E
- INC A
- RET NZ
- BIT 0,D
- RET Z
- INC D
- INC D
- INC H
- INC H
- SET 7,D
- SET 7,H
- RET
- EJECT VERTICAL BIT ROTATE
- **********
- * VERTICAL PLOT NORMAL
- **********
- VPLOTX EQU *
- CALL VERRT ROTATE CHAR DATA TO SAVE5F
- CALL VADR.ADJ ADJUST SCREEN ADDRESSES
- LD HL,(VDMA1)
- LD DE,(DMAA)
- LD A,(HEIGHT)
- LD B,A
- EXX
- CALL CG
- *
- LD HL,(VDMA2)
- LD DE,(VDMA1)
- LD A,(HEIGHT)
- LD B,A
- EXX
- CALL CG
- JP V.ADV
- EJECT BLOCK WRITE/ERASE
- * * * * * * * * * * * * * * * * * * * * *
- *
- *
- * BLOCK WRITE/ERASE
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 2
- *
- ABLOCK EQU *
- CALL GETXY GET AN X AND Y COORD
- LD A,(MODE4CNT) CHECK WHICH SET OF COORDS
- XOR 1
- LD (MODE4CNT),A
- JR Z,ABLOCK1
- LD (BLOCKX),HL FIRST SET OF COORDS
- LD (BLOCKY),DE
- RET
- ABLOCK1 LD (XEND),HL SECOND SET OF COORDS
- LD (YEND),DE
- LD HL,BLOCKX POINT TO COORDS
- * USER ENTRY POINT
- BLOCK EQU *
- LD DE,BLOCKX STORE USER'7S COORDINATES
- LD BC,0008H TO PROGRAM MEMORY
- LDIR STARTING AT BLOCKX
- *
- LD A,(BLOCKX) SAVE1 _ MASK FOR 1ST X COORD.
- AND 07
- CALL MASKS0
- EX DE,HL
- LD (SAVEL),HL
- *
- LD A,(XEND) SAVE2 _ MASK FOR 2ND X COORD.
- AND 07
- CALL MASKS0
- EX DE,HL
- LD (SAVER),HL
- *
- LD HL,BLOCKX+1 ENSURE EACH COORDINATE
- LD B,04 IS 9 BITS MAX.
- LD C,01
- *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- BLOCK0 EQU *
- LD A,(HL)
- AND C
- LD (HL),A
- INC HL
- INC HL
- DJNZ BLOCK0
- *
- MODE4.B EQU *
- LD C,00
- LD HL,(BLOCKX)
- CALL CALDELX CALCULATE DELTA X
- LD HL,(BLOCKY)
- CALL CALDELY CALCULATE DELTA Y
- BIT 4,C IF DELTA Y IS POSITIVE
- LD HL,(YEND) USE YEND AS BEGINNING
- JR Z,MODE4.C Y COORD.
- LD HL,(BLOCKY) OTHERWISE, USE BLOCKY
- *
- MODE4.C EQU *
- CALL R.OUTY THIS WILL COMPLEMENT Y
- *
- BIT 3,C IF DELTA X IS POSITIVE
- LD HL,(BLOCKX) USE BLOCKX AS BEGINNING
- LD BC,(SAVEL) XCOORD.
- LD DE,(SAVER)
- JR Z,MODE4.D
- LD HL,(XEND) OTHERWISE, USE XEND
- LD BC,(SAVER)
- LD DE,(SAVEL)
- *
- MODE4.D EQU *
- SLA D
- LD A,D
- LD (RMASK),A
- LD A,B
- LD (LMASK),A
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD A,C
- XOR D
- LD (MMASK),A
- CALL R.OUTX SET BEGINNING X ON SCREEN
- LD BC,(YDELTA)
- LD HL,(XDELTA)
- LD A,(BP)
- AND 07
- LD E,A
- LD D,00
- ADD HL,DE IS DELTA X + BP > 0
- LD DE,0007
- SBC HL,DE
- JR C,MODE4.E LESS THAN 8 BIT WIDTH
- JR NZ,MODE4.F MORE THAN 8 BIT WIDTH
- *
- MODE4.E EQU *
- LD A,(MMASK) *CASE 1* DELTA X WITHIN 8 BITS
- LD D,A
- LD HL,(DMAA)
- LD A,(M.MODE)
- BIT 0,A
- JP Z,BLOCKES
- LD A,D
- CPL
- LD D,A
- JP BLOCKWS
- *
- MODE4.F EQU *
- LD HL,(DMAA)
- EXX
- LD DE,(XDELTA) WORD COUNT _ DELTA X / 8
- LD A,E
- AND 07
- LD B,A
- SRL D
- RR E
- SRL D
- RR E
- SRL E
- LD A,(BP)
- AND 07
- ADD A,B
- CP 08
- JR C,MODE4.G
- INC E GREATER THAN 0, WORD COUNT + 1
- *
- MODE4.G EQU *
- EXX
- LD A,(LMASK)
- LD D,A
- LD A,(M.MODE)
- BIT 0,A
- JP NZ,BLOCKW
- *
- LD A,(LMASK)
- CPL
- LD D,A
- JP BLOCKE
- ENDB 00
- EJECT SHORT BLOCK WRITE/ERASE
- * * * * * * * * * * * * * * * * * * * * *
- *
- * SHORT BLOCK ERASE, LESS THAN ONE BYTE IN Y AXIS
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- BLOCKES EQU *
- LD A,(HL) LOAD DMA DATA
- AND D AND MASK SAVE BITS
- LD (HL),A
- *
- LD A,B AND TEST
- OR C ZERO COUNT
- JP Z,BLK.EXIT END OF PLOT
- DEC BC DECREMENT LOOP COUNT
- INC HL INCREMENT ADDRESS
- JR BLOCKES
- SPACE 2
- * * * * * * * * * * * * * * * * * * * * *
- *
- * SHORT BLOCK WRITE, LESS THAN ONE BYTE IN Y AXIS
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- BLOCKWS EQU *
- LD A,(HL) LOAD DMA DATA
- OR D WRITE
- LD (HL),A
- *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD A,B AND TEST
- OR C ZERO COUNT
- JP Z,BLK.EXIT END OF PLOT
- DEC BC DECREMENT LOOP COUNT
- INC HL INCREMENT ADDRESS
- JR BLOCKWS
- EJECT
- * * * * * * * * * * * * * * * * * * * * *
- * BLOCK ERASE
- * HL DMA ADDRESS
- * D MASK
- * E LINE COUNT
- * BC X DELTA
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 2
- BLOCKE EQU *
- LD A,(HL) LOAD DMA DATA
- AND D AND MASK SAVE BITS
- LD (HL),A
- *
- LD A,B AND TEST
- OR C ZERO COUNT
- JR Z,BLOCK1
- DEC BC DECREMENT LOOP COUNT
- INC HL INCREMENT ADDRESS
- JR BLOCKE
- *
- BLOCK1 EQU *
- LD BC,(YDELTA) LOAD WIDTH OF ERASE AREA
- LD HL,(DMAA) LOAD REFRESH MEMORY ADDRESS
- INC H DO NEXT COLUMN
- INC H
- SET 7,H REFRESH MEMORY ADDRESS BIT
- EXX
- DEC E DECREMENT LINE COUNT
- EXX
- JR NZ,BLOCK3 DO NEXT LINE IF NON ZERO
- *
- LD A,(RMASK) ELSE LOAD MASK
- LD D,A
- *
- BLOCK2 EQU *
- LD A,(HL) LOAD DMA DATA
- AND D AND MASK SAVE BITS
- LD (HL),A
- *
- LD A,B AND TEST
- OR C ZERO COUNT
- JR Z,BLK.EXIT END OF PLOT
- DEC BC DECREMENT LOOP COUNT
- INC HL INCREMENT ADDRESS
- JR BLOCK2
- *
- BLOCK3 EQU *
- LD D,H
- LD E,L
- LD (DMAA),HL STORE NEXT LINE ADDRESS
- LD (HL),00H ERASE FIRST CELL
- LD A,B
- OR C TEST FOR SINGLE DOT WIDTH
- JR Z,BLOCK1 SINGLE DOT
- *
- INC DE INCREMENT DESTINATION ADDRES
- LDIR ERASE LINE
- JR BLOCK1 TEST FOR LAST LINE
- EJECT
- * * * * * * * * * * * * * * * * * * * * *
- *
- * BLOCK WRITE
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 2
- BLOCKW EQU *
- LD A,(HL) LOAD DMA DATA
- OR D WRITE
- LD (HL),A
- *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD A,B AND TEST
- OR C ZERO COUNT
- JR Z,BLOCKW1
- DEC BC DECREMENT LOOP COUNT
- INC HL INCREMENT ADDRESS
- JR BLOCKW
- *
- BLOCKW1 EQU *
- LD BC,(YDELTA) LOAD WIDTH OF WRITE AREA
- LD HL,(DMAA) LOAD REFRESH MEMORY ADDRESS
- INC H
- INC H DO NEXT COLUMN
- SET 7,H REFRESH MEMORY ADDRESS BIT
- EXX
- DEC E DECREMENT LINE COUNT
- EXX
- JR NZ,BLOCKW3 DO NEXT LINE IF NON ZERO
- *
- LD A,(RMASK) ELSE LOAD MASK
- CPL
- LD D,A
- *
- BLOCKW2 EQU *
- LD A,(HL) LOAD DMA DATA
- OR D WRITE
- LD (HL),A
- *
- LD A,B AND TEST
- OR C ZERO COUNT
- JR Z,BLK.EXIT END OF PLOT
- DEC BC DECREMENT LOOP COUNT
- INC HL INCREMENT ADDRESS
- JR BLOCKW2
- *
- BLOCKW3 EQU *
- LD D,H
- LD E,L
- LD (DMAA),HL STORE NEXT LINE ADDRESS
- LD (HL),0FFH STORE ONES IN DMA
- LD A,B
- OR C TEST FOR SINGLE DOT WIDTH
- JR Z,BLOCKW1 SINGLE DOT
- *
- INC DE
- LDIR
- JR BLOCKW1 TEST FOR LAST LINE
- * * * * * * * * * * * * * * * * * * * * *
- *
- * BLOCK WRITE/ERASE EXIT
- * X COORDINATE IS SET TO FIRST X COORDINATE RECEIVED
- * Y COORDINATE IS SET TO FIRST Y COORDINATE 7INUS 15
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 2
- BLK.EXIT EQU *
- LD HL,(BLOCKX) LOAD FIRST X COORDINATE
- CALL OUTX AND SET REFRESH ADDRESS
- LD HL,(BLOCKY) LOAD FIRST Y COORDINATE
- LD DE,-15 LOAD NEGATIVE FIFTEEN
- ADD HL,DE AND ADD TO Y COORDINATE
- CALL OUTY AND SET REFRESH ADDRESS
- RET EXIT TO CALLER
- *********
- * GET X AND Y COORDINATES.
- * POP RETURNS ARE EXECUTED UNTIL LOW X BYTE IS RECEIVED.
- * THEN A NORMAL RETURN IS EXECUTED WITH THE X COORDINATE
- * IN HL AND THE Y COORDINATE IN DE.
- *********
- GETXY EQU *
- LD A,C RESTORE DATA
- LD HL,NBYTES INCR. NUMBER OF INPUTS
- INC (HL)
- AND 60H IF CHAR AND 60H=20H, HI Y
- CP 20H
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- JR NZ,LOYCHK OTHERWISE, CHECK FOR LO Y
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- AND C
- LD L,A
- LD H,00
- ADD HL,HL
- ADD HL,HL
- ADD HL,HL
- ADD HL,HL
- ADD HL,HL HL=HIGH
- LD A,(NBYTES) IF THIS INPUT IS FIRST
- CP 01 IN SEQ. IT IS HIGH Y BYE
- JR Z,HIYBYTE
- LD (HIX),HL OTHERWISE, IT IS HIGH X
- POP AF POP AND RET TO IDLE
- RET
- *
- HIYBYTE EQU *
- LD (HIY),HL
- POP AF
- RET
- LOYCHK EQU *
- CP 60H IF CHAR AND 60H=60H, LO Y
- JR NZ,LOXCHK OTHERWISE, CHECK FOR LOW X
- LD A,C
- AND 1FH
- LD (LOY),A LOY=(CHAR-32)
- POP AF POP AND RET TO IDLE
- RET
- *
- LOXCHK EQU *
- CP 40H IF CHAR AND 60H=40H, LO X
- JR NZ,ERR ERR RETURN TO IDLE DEFAULT
- LD A,C
- AND 1FH LOX=(CHAR-32)
- LD (LOX),A
- LD HL,(HIX)
- OR L
- LD L,A
- EX DE,HL DE HAS X COORD
- LD A,(LOY)
- LD HL,(HIY)
- OR L
- LD L,A
- EX DE,HL HL HAS X COORD
- * DE HAS Y COORD
- XOR A CLEAR COMMAND MODE FLAG
- LD (CMODE),A
- LD (NBYTES),A SET NINPUTS TO 0
- LD A,(SCALEFG) LOAD SCALE/NO SCALE FLAG
- RRA
- RET C IF SET, COORDS AS IS
- *
- SRA H OTHERWISE, SCALE BY
- RR L A FACTOR OF 2
- SRA D TO SCALE INTO 512X512
- RR E
- PUSH HL SAVE X COORD.
- LD HL,(BIAS) BIAS Y COORD.
- ADD HL,DE
- RES 1,H APPLY 512 MODULUS
- EX DE,HL
- POP HL
- RET
- *
- ERR EQU *
- POP AF
- RET
- **********
- * GET NEXT 3 DATA BYTES AND ASSEMBLE THEM
- * INTO A 2-BIT WORD IN C REG. AND A 16-BIT WORD IN HL REG.
- **********
- GET3 EQU *
- LD A,3FH UNBIAS CHAR
- AND C
- LD C,A
- LD HL,NBYTES
- LD A,(HL)
- INC (HL) INCREMENT NBYTES
- AND A TEST NBYTES
- JR NZ,GET3.1
- LD L,C FIRST CHAR
- LD H,A
- LD (DWORD),HL
- POP HL
- RET
- GET3.1 EQU *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- DEC A
- JR NZ,GET3.2
- LD A,C SECOND CHAR
- RRCA
- RRCA
- LD D,A
- AND 0C0H
- LD E,A
- LD A,D
- AND 0FH
- LD D,A
- LD HL,(DWORD)
- ADD HL,DE
- LD (DWORD),HL
- POP HL
- RET
- GET3.2 EQU *
- LD A,C THIRD CHAR
- RLCA
- RLCA
- RLCA
- RLCA
- LD C,A
- AND 0F0H
- LD D,A
- LD E,00H
- LD HL,(DWORD)
- ADD HL,DE
- LD A,C
- AND 03H
- LD C,A
- XOR A
- LD (NBYTES),A CLEAR NBYTES
- LD (CMODE),A CLEAR CMODE
- RET
- ENDB 00
- EJECT USER MODE ENTRY
- * * * * * * * * * * * * * * * * * * * * *
- *
- * USER MODES
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 2
- MODE5 EQU *
- CALL GET3 GET NEXT 3 BYTES IN C,H,L
- EX DE,HL DE=BITS 16-01 (C=BITS 18-17)
- LD A,01H FLAG USER PROGRAM RUNNING
- LD (USERFLG),A
- LD HL,(MOD5A) LOAD MODE 5 ADDRESS
- JP (HL)
- *
- MODE6 EQU *
- CALL GET3 GET NEXT 3 BYTES IN C,H,L
- EX DE,HL DE=BITS 16-01 (C=BITS 18-17)
- LD A,01H FLAG USER PROGRAM RUNNING
- LD (USERFLG),A
- LD HL,(MOD6A) LOAD MODE 6 ADDRESS
- JP (HL)
- *
- MODE7 EQU *
- CALL GET3 GET NEXT 3 BYTES IN C,H,L
- EX DE,HL DE=BITS 16-01 (C=BITS 18-17)
- LD A,01H FLAG USER PROGRAM RUNNING
- LD (USERFLG),A
- LD HL,(MOD7A) LOAD MODE 7 ADDRESS
- JP (HL)
- EJECT ASSEMBLE COMM LINE INPUT
- * * * * * * * * * * * * * * * * * * * * *
- *
- * PROCESS INTERRUPT MASK AND ENABLE DEVICES
- *
- * INTERRUPT MASK
- * BIT 0 I/O TIMEOUT
- * BIT 1 SHORT INTERVAL
- * BIT 2 LONG INTERVAL
- * BIT 3 EXTERNAL DEVICE
- * BIT 4 PLATO COMM CHARACTER REQUEST
- * BIT 5 TOUCH PANEL
- * BIT 6 KEYBOARD
- * BIT 7 PLATO COMM CHARACTER READY
- *
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- ENAB EQU *
- LD L,A SAVE CURRENT ENABLE BITS
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- AND 20H MASK FOR TP ENABLE
- JR Z,ENAB.1 IF ZERO, DISABLE TOUCH PANEL
- LD A,(M.ENAB) TEST FOR REENABLE OF TP
- AND 20H
- JR NZ,ENAB.1 IF REENABLE, ENAB.1
- IN A,(SYSSTAT) TEST FOR TOUCH PANEL DATA
- BIT 4,A
- JR Z,ENAB.1 NO DATA, ENAB.1
- IN A,(TPDATA) RID OF EXTRA TOUCH
- ENAB.1 EQU *
- LD A,L
- AND 6CH DISABLE UNALLOWED INTERRUPTS
- OR 44H ENABLE LONG INTERVAL AND KYBD
- LD L,A SAVE INTERRUPTS
- LD A,(MODE)
- BIT 6,A CHECK MODE
- LD A,L
- JR Z,ENAB.2 SKIP IF NOT IN CPM MODE
- OR 08H IF CPM MODE RE-ENABLE EXT. INT.
- ENAB.2 EQU *
- LD (M.ENAB),A AND STORE
- OUT (INTMSK),A ENABLE/DISABLE DEVICES
- RET
- EJECT M.CCR
- * * * * * * * * * * * * * * * * * * * * *
- *
- * M.CCR AND CHARACTER PLOTTING PARAMETERS ARE SET IN
- * ACCORDANCE EITH THE CONTENTS OF HL REGISTER PAIR.
- *
- * BIT FUNCTION
- * 0 1=VERTICAL, 0=HORIZONTAL
- * 1,2,3 CHARACTER MEMORY SELECT, 0-7
- * 4 UNUSED
- * 5 1=SIZE TWO CHARACTERS, 0=SIZE ONE CHARACTER
- * 6 1=REVERSE, 0=FORWARD
- * 7 1=UNCOVER CODE LAST CHARACTER CODE RECEIVED
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- CCR EQU *
- LD (M.CCR),HL STORE BIT SETTINGS IN M.CCR
- LD A,0EH SET UP (MEMSEL)
- AND L
- CALL LDMEMSEL
- LD A,(M.CCR) SET UP (SIZE)
- LD HL,8
- BIT 5,A
- JR Z,CCR.1
- ADD HL,HL
- CCR.1 LD (SIZE),HL
- RET
- EJECT
- * * * * * * * * * * * * * * * * * * * * *
- *
- * CALCULATE DELTA OF X AND Y BEGIN AND END POINTS
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- CALDELX EQU *
- EX DE,HL
- LD HL,(XEND) LOAD X END POINT
- LD B,08H LOAD PLOTTING BIT
- CALL CALDEL DO CALCULATION
- LD (XDELTA),HL STORE DELTA
- RET
- *
- CALDELY EQU *
- EX DE,HL
- LD HL,(YEND) LOAD Y END POINT
- LD B,10H LOAD PLOTTING BIT
- CALL CALDEL DO CALCULATION
- LD (YDELTA),HL STORE DELTA Y
- RET
- *
- CALDEL EQU *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- AND A CLEAR CARRY BIT
- SBC HL,DE SUBTRACT BEGIN POINT FROM EN
- RET P RETURN IF RESULT POSITIVE
- *
- LD A,L
- CPL COMPLIMENT
- LD L,A NEGATIVE DELTA
- LD A,H
- CPL
- LD H,A
- INC HL
- LD A,C
- OR B LOAD NEGATIVE DELTA FLAG
- LD C,A
- RET
- EJECT DIVIDE ROUTINE
- * * * * * * * * * * * * * * * * * * * * *
- *
- * DIVIDEND HL REGISTERS
- * DIVISOR DE REGISTERS
- * QUOTIENT BC REGISTERS
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 2
- DIVIDE EQU *
- LD BC,0040H SET SHIFT COUNT TO TEN PLACE
- *
- DIV1 EQU *
- ADD HL,HL SHIFT DIVIDEND LEFT ONE PLAC
- LD (SAVE1),HL AND SAVE
- SBC HL,DE SUBTRACT DIVISOR FROM DIVIDE
- JR NC,DIV2
- *
- LD HL,(SAVE1)
- *
- DIV2 EQU *
- CCF COMPLIMENT CARRY
- RL C SHIFT QUOTIENT
- RL B INTO BC REGISTERS
- JR NC,DIV1 REPEAT IF NOT COMPLETE
- *
- LD L,C
- LD H,B
- ADD HL,HL LEFT
- ADD HL,HL JUSTIFY
- ADD HL,HL FRACTIONAL
- ADD HL,HL QUOTIENT
- ADD HL,HL
- ADD HL,HL
- EX DE,HL
- LD HL,8000H LOAD HALF BIT OFF SET
- RET EXIT TO CALLER
- EJECT INPUT TO USER
- * * * * * * * * * * * * * * * * * * * * *
- *
- * INPUT FROM KEYBOARD, TOUCH PANEL OR EXTERNAL DEVICE
- *
- * DATA WORDS ARE LOADED FROM THE USER FIFO BUFFER AND T
- * TO THE USER IN REGISTERS HL.
- * ONE DATA WORD IS TRANSFERED EACH TIME THIS ROUTINE
- * IS CALLED.
- * IF THE USER BUFFER IS EMPTY, THE MOST SIGNIFICANT BIT
- * OF H REGISTE IS SET.
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 2
- INPUT EQU *
- LD DE,USBUF LOAD ADDRESS OF USER BUFFER
- LD HL,8000H
- LD A,(DE) LOAD BUFFER COUNT
- OR A AND TEST FOR DATA IN BUFFE
- RET Z NO DATA, RETURN TO CALLER
- *
- EX DE,HL
- DEC (HL) DECREMENT COUNT
- INC HL STEP ADDRESS TO
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- INC HL OUTPUT INDEX
- LD A,07
- AND (HL) MASK INDEX FOR EIGHT WORD BU
- INC (HL) INCREMENT INDEX
- *
- INC HL ADVANCE ADDRESS TO START OF
- RLCA
- LD E,A LOAD INDEX TO
- LD D,00 DE REGISTER PAIR
- ADD HL,DE ADD INDEX TO START ADDRESS
- LD E,(HL) LOAD LOWER BITS OF WORD
- INC HL
- LD D,(HL) LOAD UPPER BITS OF WORD
- EX DE,HL
- RET EXIT
- EJECT
- * * * * * * * * * * * * * * * * * * * * *
- *
- * SET STEP COORDINATE ROUTINE DIRECTION BITS
- *
- * THIS ROUTINE SETS THE DIRECTION OF THE STEP ROUTINES.
- * THE LOWER TWO BITS OF HL REGISTERS ARE LOADED TO M.DI
- * BIT 0 0 STEP Y FORWARD (UP)
- * 1 STEP Y REVERSE (DOWN)
- * BIT 1 0 STEP X FORWARD (RIGHT)
- * 1 STEP X REVERSE (LEFT)
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- DIR EQU *
- LD (M.DIR),HL STORE DIRECTION BITS
- RET
- EJECT OUTPUT COORDINATES
- * * * * * * * * * * * * * * * * * * * * *
- *
- * SET NEW Y COORDINATE
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- OUTY EQU *
- LD A,01 MASK FOR
- AND H NINE BIT
- LD H,A COORDINATE
- LD (YREG),HL
- CALL COMPHL
- LD DE,(DMAA) LOAD DMA ADDRESS
- RES 0,D
- LD A,H
- OR D LOAD UPPER BIT INTO ADDRESS
- SET 7,A
- LD H,A
- LD (DMAA),HL STORE NEW REFRESH MEMORYY AD
- INC H ADD TWO HUNDRED
- INC H TO ADDRESS
- SET 7,H SET REFRESH MEMORY BIT
- LD (DMA1),HL AND STORE
- INC H ADD FOUR HUNDRED
- INC H TO REFRESH ADDRESS
- SET 7,H SET REFRESH MEMORY BIT
- LD (DMA2),HL AND STORE
- *
- * INPUT Y COORDINATE
- *
- INPY EQU *
- LD HL,(YREG)
- RET
- EJECT OUTPUT Y COORDINATE
- * * * * * * * * * * * * * * * * * * * * *
- *
- * SET NEW X COORDINATE
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- OUTX EQU *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD A,01 MASK FOR
- AND H NINE BIT
- LD H,A COORDINATE
- LD (XREG),HL STORE NINE BIT COORDINATE
- LD A,07H
- AND L
- LD (BP),A
- LD DE,(DMAA) LOAD DMA ADDRESS
- LD A,81H LOAD MASK
- AND D MASK SAVE BITS OF ADDRESS
- LD D,A
- LD A,0F8H
- AND L MASK NEW BITS
- SRL A
- SRL A
- OR D INCLUDE Y BITS INTO ADDRESS
- LD D,A
- BIT 0,H TEST UPPER BIT
- JR Z,OUTX1
- SET 6,D SET UPPER BIT
- OUTX1 EQU *
- SET 7,D
- LD (DMAA),DE LOAD NEW DMA ADDRESS
- INC D ADD TWO HUNDRED
- INC D TO REFRESH ADDRESS
- SET 7,D SET REFRESH MEMORY BIT
- LD (DMA1),DE AND STORE
- INC D ADD FOUR HUNDRED
- INC D TO REFRESH ADDRESS
- SET 7,D SET REFRESH MEMORY BIT
- LD (DMA2),DE AND STORE
- SPACE 2
- *
- * INPUT X COORDINATE
- *
- INPX EQU *
- LD HL,(XREG)
- RET
- EJECT COMPLEMENT HL REGISTER PAIR
- *
- COMPHL EQU *
- LD A,L
- CPL
- LD L,A
- LD A,H
- CPL
- AND 01
- LD H,A
- RET
- EJECT STEP X AND Y COORDINATES
- * * * * * * * * * * * * * * * * * * * * *
- *
- *
- * STEP X COORDINATE
- *
- * STEP THE X COORDINATE ONE DOT DEPENDING ON THE SETTIN
- * BIT 1 OF M.DIR.
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- STEPX EQU *
- CALL INPX
- LD A,(M.DIR)
- BIT 1,A TEST FOR DIRECTION OF STEP
- JR NZ,STEPX1 STEP NEGATIVE IF NOT ZERO
- SPACE 1
- INC HL
- JP R.OUTX LOAD X COORDINATE
- *
- STEPX1 EQU *
- DEC HL
- JP R.OUTX LOAD Y COORDINATE
- SPACE 2
- * * * * * * * * * * * * * * * * * * * * *
- *
- *
- * STEP Y COORDINATE
- *
- * STEP THE Y COORDINATE ONE DOT DEPENDING ON THE SETTIN
- * OF BIT 0 OF M.DIR.
- *
- * * * * * * * * * * * * * * * * * * * * *
- SPACE 1
- STEPY EQU *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- CALL INPY
- LD A,(M.DIR) LOAD STEP DIRECTION FLAG
- BIT 0,A TEST DIRECTION OF STEP
- JR NZ,STEPY1 GO NEGATIVE IF NOT ZERO
- SPACE 1
- INC HL
- JP R.OUTY LOAD Y COORDINATE
- SPACE 1
- SPACE 1
- STEPY1 EQU *
- DEC HL
- JP R.OUTY LOAD Y COORDINATE
- EJECT MASK GENERATOR
- EJECT
- *
- * MASK GENERATOR
- *
- * ENTRY
- * B = LOOP COUNT, (LOWER THREE BITS OF Y COOR
- *
- * EXIT
- * D = 11100000
- * E = 00011111
- * H = 11011111
- * L = 00100000
- *
- MASKS EQU *
- LD A,(BP) LOAD LOWER THREE BITS OF Y
- AND 07H
- *
- MASKS0 EQU *
- LD B,A
- OR A TEST BITS FOR ZERO
- LD A,0FFH LOAD A ALL ONES
- LD L,01H
- JR Z,MASKS2 NO SHIFT IF ZERO
- *
- MASKS1 EQU *
- SLA A SHIFT LEFT ZERO FILLING
- SLA L
- DJNZ MASKS1 STAY IN LOOP FOR BP COUNT
- *
- MASKS2 EQU *
- LD D,A LOAD 11110000
- CPL
- LD E,A LOAD 00001111
- LD A,L
- CPL
- LD H,A LOAD 11101111
- RET
- EJECT CHARACTER CONVERT ROUTINE
- SPACE 2
- * CONVERT CHARACTER DATA TO ACCOMMODATE DISPLAY CHANGE
- * ENTRY HL NUMBER CHARACTERS TO CONVERT
- * DE FWA OF CHARACTER DATA
- SPACE 2
- CONVERT EQU *
- LD A,L STORE NUMBER OF CHARS
- LD (NCHARS),A TO CONVERT
- CON0 EQU *
- PUSH DE CHARACTER DATA SOURCE ADDR
- LD C,E ON STACK AND BC
- LD B,D
- LD HL,SAVE1+8 TEMP DEST. ADDR OF ODD ROWS
- EXX BRING IN AUX. REGS.
- POP DE CHARACTER DATA SOURCE ADDR
- INC DE POINTS TO EVEN ROWS
- LD BC,0808H B';BIT COUNT; C';LOOP COUNT
- LD HL,SAVE1 TEMP DESTIN. ADDR OF EVEN ROWS
- CON1 EQU *
- LD A,(DE) ROTATE UPPER BIT OF EVEN ROWS
- RLA TO LOWER BIT OF DESTINATION
- LD (DE),A SAVE ROTATED DATA OF SOURCE
- RR (HL)
- INC DE POINT TO NEXT EVEN ROW OF DATA
- INC DE
- EXX BRING IN MAIN REGS.
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD A,(DE) ROTATE UPPER BIT OF ODD ROWS
- RLA TO LOWER BIT OF DESTINATION
- LD (DE),A SAVE ROTATED DATA OF SOURCE
- RR (HL)
- INC DE POINT TO NEXT ODD ROW DATA
- INC DE
- EXX BRING IN AUX. REGS.
- DJNZ CON1 DECREMENT BIT COUNT TO 0
- EXX BRING IN MAIN REGS.
- INC HL POINT TO NEXT DEST. WORD
- * FOR ODD ROWS
- LD E,C DE GETS SOURCE FWA AGAIN
- LD D,B
- PUSH DE
- EXX BRING IN AUX. REGS.
- POP DE DE GETS SOURCE FWA+1 FOR
- INC DE EVEN ROWS
- INC HL POINT TO NEXT DEST. WORD
- * FOR EVEN ROWS
- LD B,08 RESET BIT COUNT
- DEC C DECREMENT LOOP COUNT TO 0
- JR NZ,CON1
- EXX BRING IN MAIN REGS.
- LD E,C DE GETS SOURCE FWA
- LD D,B
- LD HL,SAVE1 HL GETS TEMPORARY FWA
- LD BC,0010H BC GETS 16 BYTE COUNT
- LDIR CONVERTED DATA TO SOURCE
- LD A,(NCHARS) MORE DATA TO CONVERT'/
- DEC A
- LD (NCHARS),A RESTORE NUMBER OF CHARACTERS
- JR NZ,CON0 NO, DO NEXT CHARACTER
- RET RETURN TO CALLER
- SPACE 4
- **********
- * BULK ERASE THE SCREEN
- **********
- BULKER EQU *
- LD A,06H DO BULK ERASE
- OUT (VIDEOCTL),A
- BULKER1 IN A,(SYSSTAT) GET SYSTEM STATUS
- RLCA
- JR C,BULKER1 WAIT UNTIL BULK ERASE DONE
- RET
- ENDB 00
- EJECT
- ****************************************
- * M0 CHARACTER SET *
- ****************************************
- M0CODE00 EQU * SPACE
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- M0CODE01 EQU * EXCLAMATION MARK
- HEX 00,00,00,08
- HEX 08,08,08,08
- HEX 08,00,00,08
- HEX 00,00,00,00
- M0CODE02 EQU * DOUBLE QUOTATION MARK
- HEX 00,00,00,14
- HEX 14,14,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- M0CODE03 EQU * NUMBER SIGN
- HEX 00,00,00,14
- HEX 14,7F,14,7F
- HEX 14,14,00,00
- HEX 00,00,00,00
- M0CODE04 EQU * DOLLAR SIGN
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 00,00,00,08
- HEX 3E,49,09,3E
- HEX 48,49,3E,08
- HEX 00,00,00,00
- M0CODE05 EQU * PERCENT SIGN
- HEX 00,00,00,02
- HEX 45,25,12,08
- HEX 24,52,51,20
- HEX 00,00,00,00
- M0CODE06 EQU * AMPERSAND
- HEX 00,00,00,04
- HEX 0A,0A,04,46
- HEX 49,31,31,4E
- HEX 00,00,00,00
- M0CODE07 EQU * APOSTROPHE
- HEX 00,00,00,08
- HEX 08,08,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- M0CODE08 EQU * LEFT PARENTHESIS
- HEX 00,00,00,40
- HEX 20,10,10,10
- HEX 10,10,10,20
- HEX 40,00,00,00
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- M0CODE09 EQU * RIGHT PARENTHESIS
- HEX 00,00,00,01
- HEX 02,04,04,04
- HEX 04,04,04,02
- HEX 01,00,00,00
- M0CODE0A EQU * ASTERISK
- HEX 00,00,00,00
- HEX 00,08,2A,14
- HEX 14,2A,08,00
- HEX 00,00,00,00
- M0CODE0B EQU * PLUS SIGN
- HEX 00,00,00,00
- HEX 00,00,08,08
- HEX 3E,08,08,00
- HEX 00,00,00,00
- M0CODE0C EQU * COMMA
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,0C,0C
- HEX 08,04,00,00
- M0CODE0D EQU * MINUS SIGN
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 3E,00,00,00
- HEX 00,00,00,00
- M0CODE0E EQU * PERIOD
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,0C,0C
- HEX 00,00,00,00
- M0CODE0F EQU * SLASH
- HEX 00,00,00,00
- HEX 00,40,20,10
- HEX 08,04,02,01
- HEX 00,00,00,00
- M0CODE10 EQU * ZERO
- HEX 00,00,00,00
- HEX 5C,22,32,2A
- HEX 2A,26,22,1D
- HEX 00,00,00,00
- M0CODE11 EQU * ONE
- HEX 00,00,00,00
- HEX 08,0C,08,08
- HEX 08,08,08,1C
- HEX 00,00,00,00
- M0CODE12 EQU * TWO
- HEX 00,00,00,00
- HEX 1C,22,20,10
- HEX 08,04,02,3E
- HEX 00,00,00,00
- M0CODE13 EQU * THREE
- HEX 00,00,00,00
- HEX 1C,22,20,18
- HEX 20,20,22,1C
- HEX 00,00,00,00
- M0CODE14 EQU * FOUR
- HEX 00,00,00,00
- HEX 20,30,28,24
- HEX 7E,20,20,20
- HEX 00,00,00,00
- M0CODE15 EQU * FIVE
- HEX 00,00,00,00
- HEX 3E,02,02,1E
- HEX 20,20,10,0E
- HEX 00,00,00,00
- M0CODE16 EQU * SIX
- HEX 00,00,00,00
- HEX 18,04,02,1E
- HEX 22,22,22,1C
- HEX 00,00,00,00
- M0CODE17 EQU * SEVEN
- HEX 00,00,00,00
- HEX 3E,20,10,10
- HEX 08,08,04,04
- HEX 00,00,00,00
- M0CODE18 EQU * EIGHT
- HEX 00,00,00,00
- HEX 1C,22,22,1C
- HEX 22,22,22,1C
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 00,00,00,00
- M0CODE19 EQU * NINE
- HEX 00,00,00,00
- HEX 1C,22,22,22
- HEX 3C,20,10,0C
- HEX 00,00,00,00
- M0CODE1A EQU * COLON
- HEX 00,00,00,00
- HEX 00,00,0C,0C
- HEX 00,00,0C,0C
- HEX 00,00,00,00
- M0CODE1B EQU * SEMICOLON
- HEX 00,00,00,00
- HEX 00,00,0C,0C
- HEX 00,00,0C,0C
- HEX 08,04,00,00
- M0CODE1C EQU * LESS THAN SIGN
- HEX 00,00,00,00
- HEX 00,10,08,04
- HEX 02,04,08,10
- HEX 00,00,00,00
- M0CODE1D EQU * EQUAL SIGN
- HEX 00,00,00,00
- HEX 00,00,00,3E
- HEX 00,3E,00,00
- HEX 00,00,00,00
- M0CODE1E EQU * GREATER THAN SIGN
- HEX 00,00,00,00
- HEX 00,04,08,10
- HEX 20,10,08,04
- HEX 00,00,00,00
- M0CODE1F EQU * QUESTION MARK
- HEX 00,00,00,1C
- HEX 22,22,20,10
- HEX 08,08,00,08
- HEX 00,00,00,00
- M0CODE20 EQU * COMMERCIAL AT SIGN
- HEX 00,00,00,00
- HEX 00,1C,22,59
- HEX 55,55,39,02
- HEX 1C,00,00,00
- M0CODE21 EQU * UPPER CASE A
- HEX 00,00,00,1C
- HEX 22,41,41,7F
- HEX 41,41,41,41
- HEX 00,00,00,00
- M0CODE22 EQU * UPPER CASE B
- HEX 00,00,00,1F
- HEX 21,21,3F,41
- HEX 41,41,41,3F
- HEX 00,00,00,00
- M0CODE23 EQU * UPPER CASE C
- HEX 00,00,00,3C
- HEX 42,01,01,01
- HEX 01,01,42,3C
- HEX 00,00,00,00
- M0CODE24 EQU * UPPER CASE D
- HEX 00,00,00,1F
- HEX 21,41,41,41
- HEX 41,41,21,1F
- HEX 00,00,00,00
- M0CODE25 EQU * UPPER CASE E
- HEX 00,00,00,7F
- HEX 01,01,01,1F
- HEX 01,01,01,7F
- HEX 00,00,00,00
- M0CODE26 EQU * UPPER CASE F
- HEX 00,00,00,7F
- HEX 01,01,01,0F
- HEX 01,01,01,01
- HEX 00,00,00,00
- ENDB 00
- M0CODE27 EQU * UPPER CASE G
- HEX 00,00,00,3C
- HEX 42,01,01,01
- HEX 71,41,42,3C
- HEX 00,00,00,00
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- M0CODE28 EQU * UPPER CASE H
- HEX 00,00,00,41
- HEX 41,41,41,7F
- HEX 41,41,41,41
- HEX 00,00,00,00
- M0CODE29 EQU * UPPER CASE I
- HEX 00,00,00,3E
- HEX 08,08,08,08
- HEX 08,08,08,3E
- HEX 00,00,00,00
- M0CODE2A EQU * UPPER CASE J
- HEX 00,00,00,7C
- HEX 10,10,10,10
- HEX 10,10,11,0E
- HEX 00,00,00,00
- M0CODE2B EQU * UPPER CASE K
- HEX 00,00,00,41
- HEX 21,11,09,05
- HEX 0B,11,21,41
- HEX 00,00,00,00
- M0CODE2C EQU * UPPER CASE L
- HEX 00,00,00,01
- HEX 01,01,01,01
- HEX 01,01,01,7F
- HEX 00,00,00,00
- M0CODE2D EQU * UPPER CASE M
- HEX 00,00,00,41
- HEX 63,55,49,41
- HEX 41,41,41,41
- HEX 00,00,00,00
- M0CODE2E EQU * UPPER CASE N
- HEX 00,00,00,41
- HEX 43,45,45,49
- HEX 51,51,61,41
- HEX 00,00,00,00
- M0CODE2F EQU * UPPER CASE O
- HEX 00,00,00,1C
- HEX 22,41,41,41
- HEX 41,41,22,1C
- HEX 00,00,00,00
- M0CODE30 EQU * UPPER CASE P
- HEX 00,00,00,3F
- HEX 41,41,41,3F
- HEX 01,01,01,01
- HEX 00,00,00,00
- M0CODE31 EQU * UPPER CASE Q
- HEX 00,00,00,1C
- HEX 22,41,41,41
- HEX 41,41,22,1C
- HEX 08,30,00,00
- M0CODE32 EQU * UPPER CASE R
- HEX 00,00,00,3F
- HEX 41,41,41,3F
- HEX 09,11,21,41
- HEX 00,00,00,00
- M0CODE33 EQU * UPPER CASE S
- HEX 00,00,00,3E
- HEX 41,01,01,3E
- HEX 40,40,41,3E
- HEX 00,00,00,00
- M0CODE34 EQU * UPPER CASE T
- HEX 00,00,00,7F
- HEX 08,08,08,08
- HEX 08,08,08,08
- HEX 00,00,00,00
- M0CODE35 EQU * UPPER CASE U
- HEX 00,00,00,41
- HEX 41,41,41,41
- HEX 41,41,41,3E
- HEX 00,00,00,00
- M0CODE36 EQU * UPPER CASE V
- HEX 00,00,00,41
- HEX 41,22,22,22
- HEX 14,14,08,08
- HEX 00,00,00,00
- M0CODE37 EQU * UPPER CASE W
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 00,00,00,41
- HEX 41,41,49,49
- HEX 49,49,55,22
- HEX 00,00,00,00
- M0CODE38 EQU * UPPER CASE X
- HEX 00,00,00,41
- HEX 41,22,14,08
- HEX 14,22,41,41
- HEX 00,00,00,00
- M0CODE39 EQU * UPPER CASE Y
- HEX 00,00,00,41
- HEX 41,22,14,08
- HEX 08,08,08,08
- HEX 00,00,00,00
- M0CODE3A EQU * UPPER CASE Z
- HEX 00,00,00,7F
- HEX 41,20,10,08
- HEX 04,02,41,7F
- HEX 00,00,00,00
- M0CODE3B EQU * LEFT BRACKET
- HEX 00,00,00,70
- HEX 10,10,10,10
- HEX 10,10,10,10
- HEX 70,00,00,00
- M0CODE3C EQU * REVERSE SLASH
- HEX 00,00,00,00
- HEX 00,01,02,04
- HEX 08,10,20,40
- HEX 00,00,00,00
- M0CODE3D EQU * RIGHT BRACKET
- HEX 00,00,00,07
- HEX 04,04,04,04
- HEX 04,04,04,04
- HEX 07,00,00,00
- M0CODE3E EQU * HAT (CIRCUMFLEX)
- HEX 00,08,14,22
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- M0CODE3F EQU * UNDERLINE
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,7F,00,00
- M0CODE40 EQU * LEFT ACCENT MARK
- HEX 00,02,04,08
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- M0CODE41 EQU * LOWER CASE A
- HEX 00,00,00,00
- HEX 00,00,1E,20
- HEX 3E,21,21,5E
- HEX 00,00,00,00
- M0CODE42 EQU * LOWER CASE B
- HEX 00,00,00,01
- HEX 01,01,1D,23
- HEX 41,41,23,1D
- HEX 00,00,00,00
- M0CODE43 EQU * LOWER CASE C
- HEX 00,00,00,00
- HEX 00,00,3C,42
- HEX 01,01,42,3C
- HEX 00,00,00,00
- M0CODE44 EQU * LOWER CASE D
- HEX 00,00,00,40
- HEX 40,40,5C,62
- HEX 41,41,62,5C
- HEX 00,00,00,00
- M0CODE45 EQU * LOWER CASE E
- HEX 00,00,00,00
- HEX 00,00,3C,42
- HEX 7F,01,02,7C
- HEX 00,00,00,00
- M0CODE46 EQU * LOWER CASE F
- HEX 00,00,00,30
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 48,08,1C,08
- HEX 08,08,08,1C
- HEX 00,00,00,00
- M0CODE47 EQU * LOWER CASE G
- HEX 00,00,00,00
- HEX 00,00,5E,21
- HEX 21,1E,01,3E
- HEX 41,3E,00,00
- M0CODE48 EQU * LOWER CASE H
- HEX 00,00,00,03
- HEX 02,02,3A,46
- HEX 42,42,42,42
- HEX 00,00,00,00
- M0CODE49 EQU * LOWER CASE I
- HEX 00,00,00,08
- HEX 00,00,0C,08
- HEX 08,08,08,1C
- HEX 00,00,00,00
- M0CODE4A EQU * LOWER CASE J
- HEX 00,00,00,08
- HEX 00,00,0C,08
- HEX 08,08,08,08
- HEX 08,08,06,00
- M0CODE4B EQU * LOWER CASE K
- HEX 00,00,00,03
- HEX 02,02,32,0A
- HEX 06,0A,12,63
- HEX 00,00,00,00
- M0CODE4C EQU * LOWER CASE L
- HEX 00,00,00,0C
- HEX 08,08,08,08
- HEX 08,08,08,1C
- HEX 00,00,00,00
- M0CODE4D EQU * LOWER CASE M
- HEX 00,00,00,00
- HEX 00,00,37,49
- HEX 49,49,49,49
- HEX 00,00,00,00
- ENDB 00
- M0CODE4E EQU * LOWER CASE N
- HEX 00,00,00,00
- HEX 00,00,3B,46
- HEX 42,42,42,42
- HEX 00,00,00,00
- M0CODE4F EQU * LOWER CASE O
- HEX 00,00,00,00
- HEX 00,00,1C,22
- HEX 41,41,22,1C
- HEX 00,00,00,00
- M0CODE50 EQU * LOWER CASE P
- HEX 00,00,00,00
- HEX 00,00,1D,23
- HEX 41,41,23,1D
- HEX 01,01,01,00
- M0CODE51 EQU * LOWER CASE Q
- HEX 00,00,00,00
- HEX 00,00,5C,62
- HEX 41,41,62,5C
- HEX 40,40,40,00
- M0CODE52 EQU * LOWER CASE R
- HEX 00,00,00,00
- HEX 00,00,3B,46
- HEX 02,02,02,02
- HEX 00,00,00,00
- M0CODE53 EQU * LOWER CASE S
- HEX 00,00,00,00
- HEX 00,00,3E,01
- HEX 3E,40,41,3E
- HEX 00,00,00,00
- M0CODE54 EQU * LOWER CASE T
- HEX 00,00,00,04
- HEX 04,04,3F,04
- HEX 04,04,04,38
- HEX 00,00,00,00
- M0CODE55 EQU * LOWER CASE U
- HEX 00,00,00,00
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 00,00,21,21
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 21,21,21,5E
- HEX 00,00,00,00
- M0CODE56 EQU * LOWER CASE V
- HEX 00,00,00,00
- HEX 00,00,63,22
- HEX 14,14,08,08
- HEX 00,00,00,00
- M0CODE57 EQU * LOWER CASE W
- HEX 00,00,00,00
- HEX 00,00,41,49
- HEX 49,49,55,22
- HEX 00,00,00,00
- M0CODE58 EQU * LOWER CASE X
- HEX 00,00,00,00
- HEX 00,00,43,24
- HEX 18,18,24,42
- HEX 00,00,00,00
- M0CODE59 EQU * LOWER CASE Y
- HEX 00,00,00,00
- HEX 00,00,41,41
- HEX 41,22,14,08
- HEX 04,02,01,00
- M0CODE5A EQU * LOWER CASE Z
- HEX 00,00,00,00
- HEX 00,00,3F,11
- HEX 08,04,22,3F
- HEX 00,00,00,00
- M0CODE5B EQU * LEFT BRACE
- HEX 00,00,00,60
- HEX 10,10,10,10
- HEX 08,10,10,10
- HEX 10,60,00,00
- M0CODE5C EQU * DOUBLE VERTICAL BAR
- HEX 00,00,00,1C
- HEX 1C,1C,1C,00
- HEX 1C,1C,1C,1C
- HEX 00,00,00,00
- M0CODE5D EQU * RIGHT BRACE
- HEX 00,00,00,03
- HEX 04,04,04,04
- HEX 08,04,04,04
- HEX 04,03,00,00
- M0CODE5E EQU * APPROXIMATION SIGN
- HEX 00,00,00,00
- HEX 00,00,00,4C
- HEX 32,00,00,00
- HEX 00,00,00,00
- M0CODE5F EQU * RUBOUT
- HEX 00,00,00,3E
- HEX 3E,3E,3E,3E
- HEX 3E,3E,00,00
- HEX 00,00,00,00
- M0CODE60 EQU * UNDERLINE CURSOR
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,FF
- M0CODE61 EQU * CROSSHAIR CURSOR
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,04
- HEX 04,1F,04,04
- M1CODE00 EQU * SPACE
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- M1CODE01 EQU * SHORTER SLASH
- HEX 00,00,00,00
- HEX 00,40,20,10
- HEX 08,04,02,01
- HEX 00,00,00,00
- M1CODE02 EQU * EQUIVALENCE SIGN
- HEX 00,00,00,00
- HEX 00,00,3E,00
- HEX 3E,00,3E,00
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 00,00,00,00
- M1CODE03 EQU * TILDE
- HEX 00,00,4C,32
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- M1CODE04 EQU * ASSIGNMENT ARROW
- HEX 00,00,00,00
- HEX 00,08,0C,7A
- HEX 01,7A,0C,08
- HEX 00,00,00,00
- M1CODE05 EQU * NOT EQUAL SIGN
- HEX 00,00,00,00
- HEX 00,40,20,7F
- HEX 08,7F,02,01
- HEX 00,00,00,00
- M1CODE06 EQU * UP ARROW
- HEX 00,00,00,00
- HEX 00,08,1C,3E
- HEX 08,08,08,08
- HEX 00,00,00,00
- M1CODE07 EQU * RIGHT ARROW
- HEX 00,00,00,00
- HEX 00,00,10,30
- HEX 7F,30,10,00
- HEX 00,00,00,00
- M1CODE08 EQU * DOWN ARROW
- HEX 00,00,00,00
- HEX 00,08,08,08
- HEX 08,3E,1C,08
- HEX 00,00,00,00
- M1CODE09 EQU * LEFT ARROW
- HEX 00,00,00,00
- HEX 00,00,04,06
- HEX 7F,06,04,00
- HEX 00,00,00,00
- M1CODE0A EQU * MULTIPLY SIGN
- HEX 00,00,00,00
- HEX 00,00,24,18
- HEX 18,24,00,00
- HEX 00,00,00,00
- M1CODE0B EQU * UPPER CASE SIGMA
- HEX 00,00,00,7F
- HEX 02,04,08,10
- HEX 08,04,02,7F
- HEX 00,00,00,00
- M1CODE0C EQU * UPPER CASE DELTA
- HEX 00,00,00,00
- HEX 08,08,14,14
- HEX 22,22,41,7F
- HEX 00,00,00,00
- M1CODE0D EQU * LOGICAL UNION
- HEX 00,00,00,00
- HEX 00,00,22,22
- HEX 22,1C,00,00
- HEX 00,00,00,00
- M1CODE0E EQU * LOGICAL INTERSECTION
- HEX 00,00,00,00
- HEX 00,00,1C,22
- HEX 22,22,00,00
- HEX 00,00,00,00
- M1CODE0F EQU * DIVIDE SIGN
- HEX 00,00,00,00
- HEX 00,00,08,00
- HEX 3E,00,08,00
- HEX 00,00,00,00
- M1CODE10 EQU * LOWER CASE ALPHA
- HEX 00,00,00,00
- HEX 00,00,46,49
- HEX 29,11,19,66
- HEX 00,00,00,00
- M1CODE11 EQU * LOWER CASE BETA
- HEX 00,00,00,00
- HEX 18,24,22,1E
- HEX 22,42,42,3E
- HEX 02,02,01,00
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- M1CODE12 EQU * LOWER CASE DELTA
- HEX 00,00,00,0C
- HEX 12,22,04,0C
- HEX 12,22,22,1C
- HEX 00,00,00,00
- ENDB 00
- M1CODE13 EQU * LOWER CASE LAMBDA
- HEX 00,00,00,02
- HEX 04,04,08,08
- HEX 14,14,22,22
- HEX 00,00,00,00
- M1CODE14 EQU * LOWER CASE MU
- HEX 00,00,00,00
- HEX 00,00,24,24
- HEX 24,24,24,5C
- HEX 04,04,03,00
- M1CODE15 EQU * LOWER CASE PI
- HEX 00,00,00,00
- HEX 00,40,3E,15
- HEX 14,14,14,14
- HEX 00,00,00,00
- M1CODE16 EQU * LOWER CASE RHO
- HEX 00,00,00,00
- HEX 00,00,30,48
- HEX 44,44,26,1A
- HEX 02,01,01,00
- M1CODE17 EQU * LOWER CASE SIGMA
- HEX 00,00,00,00
- HEX 00,00,7C,0A
- HEX 11,11,11,0E
- HEX 00,00,00,00
- M1CODE18 EQU * LOWER CASE OMEGA
- HEX 00,00,00,00
- HEX 00,00,22,41
- HEX 49,49,49,36
- HEX 00,00,00,00
- M1CODE19 EQU * LESS THAN OR EQUAL TO
- HEX 00,00,00,00
- HEX 30,0C,03,0C
- HEX 30,00,3F,00
- HEX 00,00,00,00
- M1CODE1A EQU * GREATER THAN OR EQUAL TO
- HEX 00,00,00,00
- HEX 06,18,60,18
- HEX 06,00,7E,00
- HEX 00,00,00,00
- M1CODE1B EQU * THETA
- HEX 00,00,00,1C
- HEX 22,41,41,7F
- HEX 41,41,22,1C
- HEX 00,00,00,00
- M1CODE1C EQU * EMBEDDED LEFT PAREN
- HEX 00,00,00,40
- HEX 20,10,18,14
- HEX 12,14,18,30
- HEX 40,00,00,00
- M1CODE1D EQU * DEGREE SIGN
- HEX 00,00,00,0C
- HEX 12,12,0C,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- M1CODE1E EQU * EMBEDDED RIGHT PAREN
- HEX 00,00,00,01
- HEX 02,04,0C,14
- HEX 24,14,0C,06
- HEX 01,00,00,00
- M1CODE1F EQU * TUTOR ARROW HEAD
- HEX 00,00,00,03
- HEX 05,09,12,24
- HEX 48,24,12,09
- HEX 05,03,00,00
- M1CODE20 EQU * CENTER OF COPYRIGHT
- HEX 00,00,7F,00
- HEX 00,3C,42,01
- HEX 01,42,3C,00
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 00,7F,00,00
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- M1CODE21 EQU * UMLAUT
- HEX 00,00,00,14
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- M1CODE22 EQU * SQUARE
- HEX 00,00,00,00
- HEX 00,00,3E,22
- HEX 22,3E,00,00
- HEX 00,00,00,00
- M1CODE23 EQU * MATRIX MULTIPLY
- HEX 00,00,00,00
- HEX 00,00,0C,12
- HEX 12,0C,00,00
- HEX 00,00,00,00
- M1CODE24 EQU * DIAMOND
- HEX 00,00,00,00
- HEX 00,08,1C,3E
- HEX 7F,3E,1C,08
- HEX 00,00,00,00
- M1CODE25 EQU * VECTOR CROSS PRODUCT
- HEX 00,00,00,00
- HEX 00,41,22,14
- HEX 08,14,22,41
- HEX 00,00,00,00
- M1CODE26 EQU * RIGHT ACCENT MARK
- HEX 00,20,10,08
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- M1CODE27 EQU * CEDILLA
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,20
- HEX 10,08,00,00
- M1CODE28 EQU * MAD HAT
- HEX 00,22,14,08
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- M1CODE29 EQU * UP AND DOWN ARROWS
- HEX 00,00,00,00
- HEX 00,08,1C,3E
- HEX 08,3E,1C,08
- HEX 00,00,00,00
- M1CODE2A EQU * VERTICAL BAR
- HEX 00,00,00,08
- HEX 08,08,08,08
- HEX 08,08,08,08
- HEX 00,00,00,00
- M1CODE2B EQU * EMBEDDED LEFT PAREN
- HEX 00,00,00,40
- HEX 20,10,18,14
- HEX 12,14,18,30
- HEX 40,00,00,00
- M1CODE2C EQU * EMBEDDED RIGHT PAREN
- HEX 00,00,00,01
- HEX 02,04,0C,14
- HEX 24,14,0C,06
- HEX 01,00,00,00
- EJECT
- **********
- * JUMP TABLE FOR PLATO MODE ESCAPE SEQUENCES
- **********
- ESCADR.P EQU *
- DEFB 03H ETX
- DEFW AINIT
- DEFB 11H DC1
- DEFW DC1
- DEFB 12H DC2
- DEFW DC2
- DEFB 13H DC3
- DEFW DC3
- DEFB 14H DC4
- DEFW DC4
- DEFB 0CH FF
- DEFW BULKER
- DEFB 40H AMPERSAND
- DEFW SUPER
- DEFB 32H 2
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- DEFW LCOORD
- DEFB 41H UC A
- DEFW SUB
- DEFB 42H UC B
- DEFW SELECTMM
- DEFB 43H UC C
- DEFW SELECTMM
- DEFB 44H UC D
- DEFW SELECTMM
- DEFB 45H UC E
- DEFW SELECTMM
- DEFB 46H UC F
- DEFW SELECTMM
- DEFB 47H UC G
- DEFW SELECTMM
- DEFB 48H UC H
- DEFW SELECTMM
- DEFB 49H UC I
- DEFW SELECTMM
- DEFB 4AH UC J
- DEFW HOR
- DEFB 4BH UC K
- DEFW VERT
- DEFB 4CH UC L
- DEFW FWD
- DEFB 4DH UC M
- DEFW REV
- DEFB 4EH UC N
- DEFW SIZE0
- DEFB 4FH UC O
- DEFW SIZE2
- DEFB 50H UC P
- DEFW SLDM2C
- DEFB 51H UC Q
- DEFW SSPECF
- DEFB 52H UC R
- DEFW LEXT
- DEFB 53H UC S
- DEFW SLDM2
- DEFB 54H UC T
- DEFW MODE567 (MODE 5)
- DEFB 55H UC U
- DEFW MODE567 (MODE 6)
- DEFB 56H UC V
- DEFW MODE567 (MODE 7)
- DEFB 57H UC W
- DEFW LADDR
- DEFB 59H UC Y
- DEFW LECHO
- DEFB 5AH UC Z
- DEFW LMARG
- DEFB 01H SOH
- DEFW AINIT.G
- DEFB 1BH ESC
- DEFW ESC
- DEFB 0FFH END OF TABLE
- **********
- * JUMP TABLE FOR PLATO MODE CONTROL CODES
- **********
- CTLADR.P EQU *
- DEFB 08H BS
- DEFW BKSP
- DEFB 0DH CR
- DEFW CR
- DEFB 09H HT
- DEFW TAB
- DEFB 0AH LF
- DEFW LF
- DEFB 0BH VT
- DEFW VT
- DEFB 0CH FF
- DEFW FF
- DEFB 19H EM
- DEFW EM.1
- DEFB 1BH ESC
- DEFW ESC
- DEFB 1CH FS
- DEFW FS.1
- DEFB 1DH GS
- DEFW GS.1
- DEFB 1FH US
- DEFW US.1
- DEFB 0FFH END OF TABLE
- ENDB 00
- EJECT
- **********
- * UNIMPLEMENTED OR UNDEFINED COMMANDS COME HERE
- **********
- TEMP EQU *
- RET
- **********
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- * ROUTINES TO EXECUTE CONTROL CODES AND ESCAPE SEQUENCES
- **********
- DC1 EQU *
- LD L,0 SELECT INVERSE VIDEO
- JR DCX
- DC2 EQU *
- LD L,3 SELECT OVERSTRIKE WRITE
- JR DCX
- DC3 EQU *
- LD L,2 SELECT OVERSTRIKE ERASE
- JR DCX
- DC4 EQU *
- LD L,1 SELECT CLEAR WRITE
- DCX EQU *
- CALL MODESET1
- RET
- ESC EQU *
- LD HL,G.ESC SET ESCAPE FLAG
- LD (HL),1
- RET
- LCOORD EQU *
- LD A,2 SELECT COMMAND LOAD COORDINATE
- JR CMDSET
- *
- SSPECF EQU *
- LD A,4 SELECT COMMAND SEL SPEC FN
- JR CMDSET
- *
- LECHO EQU *
- LD A,6 SELECT COMMAND LOAD ECHO
- JR CMDSET
- *
- LADDR EQU *
- LD A,8 SELECT COMMAND LOAD ADDRESS
- JR CMDSET
- *
- LEXT EQU *
- LD A,10 SELECT COMMAND LOAD EXT DATA
- CMDSET EQU *
- LD (CMODE),A SAVE COMMAND MODE
- CMDSET.1 EQU *
- XOR A CLEAR BYTE COUNTER
- LD (NBYTES),A
- RET
- *
- LMARG EQU *
- CALL R.INPX
- LD A,(M.CCR)
- AND 01H
- JR Z,LMARG.1 HORIZONTAL, HL HAS X
- CALL R.INPY GET Y IN HL
- LMARG.1 LD (M.MARGIN),HL
- RET
- *
- SLDM2C EQU * SELECT PLATO DATA MODE 2
- LD A,1 WITH CONVERT
- JR SLDM2.1
- SLDM2 EQU * SELECT PLATO DATA MODE 2
- XOR A WITHOUT CONVERT
- SLDM2.1 LD (CONFLG),A SET/CLEAR CONVERT FLAG
- XOR A CLEAR MODE 2 BYTE COUNT
- LD (NDATAB),A
- LD C,2 SELECT MODE 2
- CALL MODESET2 (LOAD MODE)
- JR CMDSET.1
- *
- FS.1 EQU *
- LD C,0 SELECT MODE 0
- CALL MODESET2 (POINT PLOT)
- JR CMDSET.1
- *
- GS.1 EQU *
- LD C,1 SELECT MODE 1
- CALL MODESET2 (GRAPH)
- LD A,01
- LD (DARK),A SELECT DARK VECTORS
- JR CMDSET.1
- *
- EM.1 EQU *
- LD C,4 SELECT MODE 4
- CALL MODESET2 (BLOCK)
- XOR A CLEAR TWICE FLAG
- LD (MODE4CNT),A
- JR CMDSET.1
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- US.1 EQU *
- LD C,3 SELECT MODE 3
- CALL MODESET2 (ALPHA)
- RET
- MODE567 EQU *
- LD A,C GET ESC SEQ CHAR (54H,55H,56H)
- SUB 4FH CHANGE TO 05, 06, 07
- LD C,A
- CALL MODESET2 SELECT MODE (5, 6 OR 7)
- JR CMDSET.1
- EJECT
- ********************************************************
- * THE FOLLOWING CODE AND DATA ARE UNIQUE TO
- * TIMESHARE AND GRAPHICS OPERATION.
- ********************************************************
- *********
- * ASCII INITIALIZE
- **********
- AINIT.G EQU * GRAPH MODE INIT
- LD HL,001EH SET ALPHA/OVERSTRIKE WRITE
- LD DE,CTLADR.G SELECT GRAPH MODE CTL TABLE
- LD BC,ESCADR.G SELECT GRAPH MODE ESC TABLE
- LD A,1 SET GRAPHIC MODE
- JR AINIT1
- AINIT EQU * TIMESHARE MODE INIT
- LD HL,001AH SET ALPHA/REWRITE
- LD DE,CTLADR.T SELECT TIMESHARE CTL TABLE
- LD BC,ESCADR.T SELECT TIMESHARE ESC TABLE
- XOR A SET TIMESHARE MODE
- AINIT1 EQU *
- LD (CTLADR),DE SELECT CTL TABLE
- LD (ESCADR),BC SELECT ESC TABLE
- LD (TGMODE),A SET TIMESHARE OR GRAPHIC MODE
- LD A,01H SET ERROR PROTOCOL TO STATE 0
- LD (EREG),A
- LD A,(MODE)
- AND 40H SAVE CPM BIT
- LD (MODE),A
- XOR A SET A = 0
- LD (SCALEFG),A SET FOR SCALING
- CALL R.MODE SELECT WRITING MODE
- IN A,(COMMSW) READ COMM SWITCHES
- CPL FORCE APPARENT SWITCH CHANGE
- LD (XCOMMSW),A
- LD HL,IGTASC SELECT IGT ASCII KEYBOARD
- LD (KBAADR),HL
- CALL ASIZE1 SELECT A0 CHARACTER SET
- LD HL,122 SET Y BIAS
- LD (BIAS),HL
- XOR A
- LD HL,256 PUT CROSSHAIR IN CENTER OF
- LD (G.XREG),HL SCREEN
- LD (G.YREG),HL
- CALL AFF CLR SCREEN, HOME, SET ALPHA
- LD A,MRESET0 RESET INTERFACE.
- OUT (CNTLFCN),A
- LD A,MRESET1 RESET PRINTER.
- OUT (CNTLFCN),A
- CALL CHECKID CHECK PRINTER ID
- RET NZ EXIT IF NO PRINTER ATTACHED
- IN A,(CNTLFCN) CLEAR OUT ERROR/REJECT STATUS
- CALL ZEROCNT ZERO OUT SOLENOID COUNTERS
- RET
- **********
- * ASCII IDLE LOOP (TIMESHARE OR GRAPHIC OPERATION)
- **********
- AIDLE EQU * ASCII IDLE
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- CALL R.EXEC TEST FOR RECEIVE/TRANSMIT DATA
- CALL BLINK BLINK THE CURSOR
- JP IDLE
- ENDB 00
- EJECT
- **********
- * ROUTINE TO BLINK THE CURSOR
- **********
- BLINK EQU *
- CALL BLINKTST IS IT TIME TO BLINK
- RET NC JUST EXIT IF NO
- LD A,(G.SUPCUR) IS THE CURSOR SUPPRESSED
- OR A
- JP NZ,PRBLINK1 JUST BLINK PRINT ERROR IF YES
- CALL CUR.SAVE SAVE DATA AT CURSOR POSITION
- LD A,(WEFLAG) SET B = 2 OR 3
- ADD A,2
- LD B,A
- LD C,60H
- LD A,(MODE) TEST MODE
- AND 0BFH
- CP 8
- JR NZ,BLINK1 NORMAL CURSOR IF NOT GIN MODE
- INC C CROSSHAIR CURSOR IF GIN MODE
- BLINK1 LD HL,(CHBASE) WRITE OR ERASE THE CURSOR
- CALL JMPHL
- JP PRBLINK1 BLINK PRINT ERROR IF ON
- * CALLABLE ROUTINE TO TEST FOR TIME TO BLINK.
- * ROUTINE EXITS WITH CARRY CLEAR IF NOT.
- * IF YES, ROUTINE RESETS BLINK COUNTER, TOGGLES THE
- * WRITE/ERASE FLAG AND EXITS WITH CARRY SET.
- BLINKTST EQU *
- LD HL,BLINKCTR TEST BLINK COUNTER
- LD A,(HL)
- OR A
- RET NZ EXIT IF NOT TIME TO BLINK
- LD (HL),10 RESET BLINK COUNTER
- LD HL,WEFLAG TOGGLE WRITE/ERASE FLAG
- LD A,(HL)
- XOR 01
- LD (HL),A
- SCF
- RET
- SPACE 4
- * SAVE DISPLAY DATA AT THE CURSOR POSITION
- CUR.SAVE EQU *
- LD HL,CURSAVED
- BIT 0,(HL)
- RET NZ EXIT IF ALREADY SAVED
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- SET 0,(HL) SET SAVED FLAG
- LD DE,CURDATA+9 POINT TO DATA SAVE AREA
- LD HL,(DMAA) LEFT HALF OF DATA
- CALL CUR.SAV1
- LD HL,(DMA1) RIGHT HALF OF DATA
- CUR.SAV1 EQU *
- LD BC,5 BYTE COUNT
- CUR.SAV2 LDD (DE)=(HL), DECR DE,HL,BC
- RET PO EXIT IF BC=0
- LD A,L LOOP IF HL NOT 0FFH
- INC A
- JR NZ,CUR.SAV2
- BIT 0,H LOOP IF H IS EVEN
- JR Z,CUR.SAV2
- INC H COLUMN OVERFLOW, SO REALIGN
- INC H
- SET 7,H
- JR CUR.SAV2 LOOP
- SPACE 4
- * ERASE CURSOR BY RESTORING SAVED DISPLAY DATA
- CUR.ERAS EQU *
- LD HL,CURSAVED
- BIT 0,(HL)
- RET Z EXIT IF NOTHING SAVED
- RES 0,(HL) CLEAR SAVED FLAG
- LD HL,CURDATA+9 POINT TO DATA SAVE AREA
- LD DE,(DMAA) LEFT HALF OF DATA
- CALL CUR.ERS1
- LD DE,(DMA1) RIGHT HALF OF DATA
- CUR.ERS1 EQU *
- LD BC,5 BYTE COUNT
- CUR.ERS2 LDD (DE)=(HL), DECR DE,HL,BC
- RET PO EXIT IF BC=0
- LD A,E LOOP IF DE NOT 0FFH
- INC A
- JR NZ,CUR.ERS2
- BIT 0,D LOOP IF D IS EVEN
- JR Z,CUR.ERS2
- INC D COLUMN OVERFLOW, SO REALIGN
- INC D
- SET 7,D
- JR CUR.ERS2 LOOP
- EJECT
- **********
- * PROCESS KEYBOARD INPUT
- **********
- KEY EQU *
- CALL KBCON GET ASCII KB DATA IN A AND C
- RET Z IGNORE UNDEFINED KEYS
- ADD A,A TEST FOR SPECIAL CODE
- JP C,SPCODE CARRY, SPECIAL CODE
- KEY1 EQU *
- LD B,C SAVE UNMODIFIED KEY CODE
- LD A,(G.TTYFLG) IS ALL CAPS SELECTED
- OR A
- JR NZ,XMTEST NO, JUMP
- BIT 6,C IF BIT 6 IS SET,
- JR Z,XMTEST
- RES 5,C THEN CLEAR BIT 5
- XMTEST EQU *
- LD A,(LOC.RMT) SKIP CPM TEST IF IN
- OR A LOCAL MODE
- LD A,(MODE) CHECK MODE
- JR NZ,KEY4
- BIT 6,A
- JR NZ,KEY3 JUMP IF IN CPM MODE
- KEY4 AND 0BFH
- CP 8
- JP Z,GIN.KB JUMP IF GIN MODE
- RLCA TEST FOR PLATO MODE.
- JR C,KEY2
- CALL XMIT.1A TRANSMIT CHAR IF NOT LOCAL
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD A,(DUPLEXFG)
- OR A
- JP Z,XJOB PROCESS DATA IF HALF DUPLEX
- LD A,(LOC.RMT)
- OR A
- JP NZ,XJOB PROCESS DATA IF LOCAL
- LD (BS.ERASE),A CLEAR BS ERASE FLAG
- RET
- KEY2 EQU *
- CALL XMIT.1
- KEY3 EQU *
- LD A,1FH
- LD HL,KTPBUF
- CP (HL) TEST FULL BUFFER
- RET Z RETURN IF BUFFER FULL
- CALL KTPSTR
- RET
- RET
- EJECT
- * * * * * * * * * * * * * * * * * * * *
- * THE FOLLOWING KEYS PERFORM SPECIAL FUNCTIONS
- * * * * * * * * * * * * * * * * * * * *
- SPCODE EQU *
- LD C,A
- LD B,0
- LD HL,SPTBL
- ADD HL,BC
- LD E,(HL)
- INC HL
- LD D,(HL)
- EX DE,HL
- JP (HL)
- SPTBL EQU *
- DEFW G.MODE CODE 80
- DEFW G.RESET CODE 81
- DEFW G.CAPS CODE 82
- DEFW G.BREAK CODE 83
- DEFW G.PAGE CODE 84
- DEFW G.ERASE CODE 85
- DEFW G.RUBOUT CODE 86
- DEFW G.CPRINT CODE 87
- *
- G.RESET EQU *
- CALL CUR.ERAS ERASE CURSOR
- CALL ASIZE1 RESET TO SIZE 1 CHARACTERS
- CALL AFF.1 HOME POSITION
- RET
- *
- G.PAGE EQU *
- CALL AFF CLEAR SCREEN, HOME POSITION
- RET
- *
- G.CAPS EQU *
- LD HL,G.TTYFLG TOGGLE TTY CAPS FLAG
- LD A,(HL)
- XOR 01H
- LD (HL),A
- JP DSTAT UPDATE STATUS LINE IF ON
- *
- G.BREAK EQU *
- LD A,(PRINTERR) IS THERE A PRINTER ERROR
- OR A
- JR NZ,G.PRNTCL YES, STOP THE PRINT
- LD A,(LOC.RMT) DO NOTHING IF LOCAL
- OR A
- RET NZ
- LD HL,ASCPKG+5 SEND BREAK
- SET 4,(HL)
- CALL ASCSETUP
- LD HL,8000H WAIT ABOUT 250 MS
- G.BREAK1 EQU *
- DEC HL
- LD A,L
- OR H
- JR NZ,G.BREAK1
- LD HL,ASCPKG+5 CLEAR BREAK
- RES 4,(HL)
- CALL ASCSETUP
- RET
- *
- G.ERASE EQU *
- LD A,01H SET BS ERASE FLAG
- LD (BS.ERASE),A
- LD C,08H LOAD A BS CHARACTER
- JP KEY1 AND GO EXECUTE IT
- *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- G.RUBOUT EQU *
- LD BC,7F7FH LOAD A RUBOUT CHARACTER
- JP XMTEST SKIP OVER CAPS TEST
- *
- G.SCOPY EQU *
- DI SIMULATE A SHIFT-PRINT KEY
- PUSH AF INTERRUPT
- PUSH BC
- PUSH DE
- PUSH HL
- LD HL,403FH
- JP KYBD1
- *
- G.PRINT EQU *
- LD A,(CPRINTFG) IS COMM PRINT ACTIVE
- OR A
- RET NZ CANNOT SCREEN COPY IF YES
- CALL CHECKID CHECK PRINTER ID
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- RET NZ EXIT IF NO PRINTER ATTACHED
- CALL CUR.ERAS ERASE CURSOR
- JP PRINT DO PRINT
- *
- G.CPRINT EQU *
- CALL CHECKID CHECK PRINTER ID
- RET NZ EXIT IF NO PRINTER ATTACHED
- LD HL,CPRINTFG SET COMM PRINT FLAG TO 1 IF
- LD A,(HL) IT IS = 0, ELSE SET IT TO 0.
- LD (HL),1 TURN ON COMM LINE PRINT
- OR A
- JR Z,G.PRNT
- G.PRNTCL EQU *
- XOR A TURN OFF COMM LINE PRINT
- LD (CPRINTFG),A
- CALL RET.MEM RESTORE SAVED MEMORY IF PRINT
- * ERROR FLAG IS SET
- G.PRNT EQU *
- JP DSTAT UPDATE STATUS LINE IF ON
- EJECT
- *********
- * ASCII KEYBOARD TABLE
- **********
- IGTASC EQU *
- HEX 30,31,32,33 0X
- HEX 34,35,36,37
- HEX 38,39,40,5C
- HEX 09,5E,2B,2D
- HEX 7D,1B,FF,85 1X
- HEX 82,FF,0D,0A
- HEX 08,86,83,FF
- HEX 84,FF,FF,FF
- HEX 3C,3E,5B,5D 2X
- HEX 24,25,5F,27
- HEX 2A,28,60,7C
- HEX 09,7E,23,26
- HEX 7B,1B,FF,85 3X
- HEX 82,FF,0D,0A
- HEX 08,86,83,FF
- HEX 81,FF,FF,FF
- HEX 20,61,62,63 4X
- HEX 64,65,66,67
- HEX 68,69,6A,6B
- HEX 6C,6D,6E,6F
- HEX 70,71,72,73 5X
- HEX 74,75,76,77
- HEX 78,79,7A,3D
- HEX 3B,2F,2E,2C
- HEX 20,41,42,43 6X
- HEX 44,45,46,47
- HEX 48,49,4A,4B
- HEX 4C,4D,4E,4F
- HEX 50,51,52,53 7X
- HEX 54,55,56,57
- HEX 58,59,5A,29
- HEX 3A,3F,21,22
- * THE FOLLOWING CODES ARE GENERATED WITH THE CTRL KEY
- HEX FF,FF,FF,FF 8X
- HEX FF,FF,FF,FF
- HEX FF,FF,00,1C
- HEX 09,1E,FF,FF
- HEX FF,1B,FF,85 9X
- HEX 82,FF,0D,0A
- HEX 08,86,83,FF
- HEX 84,80,FF,FF
- HEX FF,FF,1B,1D AX
- HEX FF,FF,1F,FF
- HEX FF,FF,FF,FF
- HEX 09,FF,FF,FF
- HEX FF,1B,FF,85 BX
- HEX 82,FF,0D,0A
- HEX 08,86,83,FF
- HEX 81,80,FF,87
- HEX FF,01,02,03 CX
- HEX 04,05,06,07
- HEX 08,09,0A,0B
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 0C,0D,0E,0F
- HEX 10,11,12,13 DX
- HEX 14,15,16,17
- HEX 18,19,1A,FF
- HEX FF,FF,FF,FF
- HEX FF,FF,FF,FF EX
- HEX FF,FF,FF,FF
- HEX FF,FF,FF,1B
- HEX 1C,1D,1E,1F
- HEX 00,FF,FF,FF FX
- HEX FF,FF,FF,FF
- HEX FF,FF,FF,FF
- HEX FF,FF,FF,FF
- EJECT
- **********
- * JUMP TABLE FOR GRAPH MODE ESCAPE SEQUENCES
- **********
- ESCADR.G EQU *
- DEFB 07H BEL
- DEFW BEL
- DEFB 08H BS
- DEFW BS
- DEFB 0DH CR
- DEFW ESC
- DEFB 18H CAN
- DEFW CAN
- DEFB 60H REVERSE ACCENT
- DEFW VECTNORM
- DEFB 61H LC A
- DEFW VECTDOT
- DEFB 63H LC C
- DEFW VECTSDSH
- DEFB 64H LC D
- DEFW VECTLDSH
- DEFB 11H DC1
- DEFW DC1
- DEFB 12H DC2
- DEFW DC2
- DEFB 13H DC3
- DEFW DC3
- DEFB 14H DC4
- DEFW DC4
- DEFB 05H ENQ
- DEFW ENQ
- DEFB 17H ETB
- DEFW G.SCOPY
- DEFB 0CH FF
- DEFW AFF
- DEFB 1DH GS
- DEFW GS
- DEFB 09H HT
- DEFW HTAB
- DEFB 0AH LF
- DEFW ESC
- DEFB 3BH SEMICOLON
- DEFW ASIZE1
- DEFB 3AH COLON
- DEFW ASIZE1
- DEFB 39H 9
- DEFW ASIZE1
- DEFB 38H 8
- DEFW ASIZE1
- DEFB 37H 7
- DEFW ASIZE2
- DEFB 1AH SUB
- DEFW ASUB
- DEFB 1FH US
- DEFW US
- DEFB 0BH VT
- DEFW AVT
- DEFB 00H NUL
- DEFW ESC
- DEFB 02H STX
- DEFW PINIT
- DEFB 03H ETX
- DEFW AINIT
- DEFB 1BH ESC
- DEFW ESC
- DEFB 0FFH END OF TABLE
- **********
- * JUMP TABLE FOR GRAPH MODE CONTROL CODES
- **********
- CTLADR.G EQU *
- DEFB 0DH CR
- DEFW ACR
- DEFB 0AH LF
- DEFW ALF
- DEFB 08H BS
- DEFW BS
- DEFB 1BH ESC
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- DEFW ESC
- DEFB 1FH US
- DEFW US
- DEFB 1CH FS
- DEFW FS
- DEFB 1DH GS
- DEFW GS
- DEFB 09H HT
- DEFW HTAB
- DEFB 0BH VT
- DEFW AVT
- DEFB 07H BEL
- DEFW BEL
- DEFB 19H EM
- DEFW EM
- DEFB 0FFH END OF TABLE
- SPACE 4
- **********
- * JUMP TABLE FOR TIMESHARE MODE ESCAPE SEQUENCES
- **********
- ESCADR.T EQU *
- DEFB 01H SOH
- DEFW AINIT.G
- DEFB 02H STX
- DEFW PINIT
- DEFB 08H BS
- DEFW BS.3
- DEFB 1BH ESC
- DEFW ESC
- DEFB 11H (DC1 = CONTROL Q)
- DEFW STOCMD STORE COMMAND (CURSOR ADDRESSING)
- DEFB 12H (DC2 = CONTROL R)
- DEFW TPENAB TOUCH PANEL ENABLE
- DEFB 13H (DC3 = CONTROL S)
- DEFW TPDISAB TOUCH PANEL DISABLE
- DEFB 14H (DC4 = CONTROL T)
- DEFW CPMON CPM MODE BIT ON
- DEFB 15H (CONTROL U)
- DEFW CPMOFF CPM MODE BIT OFF
- DEFB 0FFH END OF TABLE
- **********
- * JUMP TABLE FOR TIMESHARE MODE CONTROL CODES
- **********
- CTLADR.T EQU *
- DEFB 0DH CR
- DEFW ACR
- DEFB 0AH LF
- DEFW ALF
- DEFB 08H BS
- DEFW BS
- DEFB 09H HT
- DEFW HTAB
- DEFB 0BH VT
- DEFW AVT
- DEFB 0CH FF
- DEFW AFF
- DEFB 07H BEL
- DEFW BEL
- DEFB 1BH ESC
- DEFW ESC
- DEFB 0FFH END OF TABLE
- EJECT
- *
- ENDB 00
- EJECT
- **********
- * SET UP FOR DOTTED AND DASHED VECTORS.
- **********
- VECTNORM EQU *
- LD HL,DASH
- LD (HL),0
- RET
- VECTDOT EQU *
- LD HL,DASH
- LD (HL),1
- LD HL,VECTAB
- LD A,(HL)
- LD (WSEGLEN),A
- INC HL
- LD A,(HL)
- LD (ESEGLEN),A
- RET
- VECTSDSH EQU *
- LD HL,DASH
- LD (HL),1
- LD HL,VECTAB+2
- LD A,(HL)
- LD (WSEGLEN),A
- INC HL
- LD A,(HL)
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD (ESEGLEN),A
- RET
- VECTLDSH EQU *
- LD HL,DASH
- LD (HL),1
- LD HL,VECTAB+4
- LD A,(HL)
- LD (WSEGLEN),A
- INC HL
- LD A,(HL)
- LD (ESEGLEN),A
- RET
- * GRAPHICS MODE DASHED VECTORS GO HERE.
- G.LINE1 EQU *
- RET
- VECTAB EQU *
- HEX 03,03 DOTTED VECTOR COUNTS
- HEX 08,03 SHORT DASHED VECTOR COUNTS
- HEX 10,04 LONG DASHED VECTOR COUNTS
- EJECT
- **********
- * ASCII ALPHA MODE EXECUTION
- **********
- ALPHMODE EQU *
- LD A,C GET CHAR
- CP 7FH IGNORE RUBOUT CHARACTER
- RET Z
- SUB 20H BIAS CHAR
- LD C,A
- LD A,(M.MODE) PUT W/E BITS IN B REG.
- LD B,A
- CALL ACHARGEN DISPLAY THE CHARACTER
- JP HTAB.1 MOVE TO NEXT COLUMN
- **********
- * ASCII MODE CHARACTER GENERATOR.
- * ON ENTRY THE CHAR-20H IS IN THE C REG.
- * AND DESIRED WRITE/ERASE BITS ARE IN THE B REG.
- **********
- ACHARGEN EQU *
- PUSH BC TEMP SAVE CHAR AND W/E BITS
- CALL CUR.ERAS ERASE THE CURSOR
- POP BC GET SAVED CHAR AND W/E BITS
- LD HL,(CHBASE) DISPLAY THE CHARACTER
- JP (HL) CHGEN.S1 OR CHGEN.S2
- CHGEN.S2 EQU * 8 BY 16 CHARS
- EXX SET DATA MASK
- LD L,00H
- EXX
- INC C GET CHAR+1
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD E,0
- JR CHGENS1
- CHGEN.S1 EQU * 6 BY 14 CHARS
- EXX SET DATA MASK
- LD L,0C0H
- EXX
- INC C GET CHAR+1
- LD E,C
- CHGENS1 EQU *
- LD D,0
- LD L,C SET IX TO BOTTOM OF CHAR DATA
- LD H,D
- ADD HL,HL
- ADD HL,HL
- ADD HL,HL
- SBC HL,DE
- ADD HL,HL
- DEC HL
- EX DE,HL
- LD IX,(G.MEMSEL)
- ADD IX,DE
- LD A,B GET W/E BITS
- EXX
- LD C,00H SET UP XOR MASK
- BIT 0,A CHECK WRITE/ERASE BIT
- JR NZ,CHGENS1B
- DEC C C = 0FFH
- CHGENS1B EQU *
- LD DE,0FFFFH
- BIT 1,A CHECK OVERSTRIKE/NORMAL BIT
- JR NZ,CHGENS1D
- LD E,L NORMAL, SO PUT DATA MASK IN E
- LD A,(BP) CHECK BIT POSITION
- AND 07H
- JR Z,CHGENS1D DONE IF 0
- LD B,A POSITION DATA MASK
- LD A,D
- SCF
- CHGENS1C RL E
- RLA
- DJNZ CHGENS1C
- LD D,A
- CHGENS1D EQU * FALL INTO CHARACTER GENERATOR
- EXX
- JP HPLOTA
- ENDB 00
- LENGTH2 EQU *-FWA2 END OF SECOND CHECKSUM AREA
- EJECT BUFFERS AND DATA STORE AREAS
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * *
- * W A R N I N G *
- * *
- * THE PROGRAM BEFORE THIS VARIABLE AREA MUST NOT *
- * EXTEND BEYOND ADDRESS 22A0 HEX. THE LOAD ROUTINE *
- * RESIDENT IN THE ROM WHICH LOADS FROM THE PLATO
- * SYSTEM, USES ADDRESS 22B3 HEX AS THE TOP OF THE
- * PROCESSOR STACK, AND ADDRESSES DOWN TO 22A1 HEX
- * MAY BE DESTROYED AS THE LOADER ROUTINE USES THE
- * STACK FOR CALL'7S AND STORES. *
- * *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- SPACE 3
- ****************************************
- * VARIABLES SET OR ACCESSED BY THE *
- * ROM RESIDENT PROGRAM. *
- * NOTE...THESE ADDRESSES MUST BE FIXED *
- * AND THEIR VALUES CANNOT BE CHANGED *
- * BY R.INIT *
- ****************************************
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LDSOURCE EQU 22C7H LOAD SOURCE FLAG (-1 = DISK)
- CKSUMTBL EQU 22C8H START ADDR OF CHECKSUM TABLE
- CHECKSUM EQU 22CAH CHECKSUM SET BY LOADER
- LOADFLAG EQU 22CBH 3CH=CODE IS LOADED
- RESETFLG EQU 22CCH 3CH=DO SHORT RESET
- MODE EQU 22CDH ASCII RESIDENT OPERATING MODE
- * (0X=ASCII, 4X ASCII/CPM,
- * 8X=PLATO, CX=PLATO/CPM)
- LOADINFO EQU 22CEH LOAD INFORMATION
- * (BIT 0, 0=RS232, 1=LONG LINE)
- * (BIT 1, 0=INTERNAL, 1=EXTERNAL)
- * (BIT 2, 0=PLATO, 1=ASCII)
- * (BITS 4-3, 0X=HOST, 10=ROM, 11=DISK)
- * (BITS 7-5, ASCII BAUD RATE)
- RUNINFO EQU 22CFH RUN INFORMATION
- * (SAME BITS AS IN LOADINFO)
- ****************************************
- * PLATO VARIABLES *
- * NOTE...THESE ADDRESSES MUST BE FIXED *
- ****************************************
- M.LDFILE EQU 22E5H LOAD FILE NUMBER SET BY LOADER
- BEGVAR1 EQU 22E6H START OF FIRST VARIABLE AREA
- M.SBTYPE EQU 22E6H TERMINAL SUBTYPE
- M.CONFIG EQU 22E7H TERMINAL CONFIGURATION
- M.M0 EQU 22E8H STARTING ADDRESS OF M0
- M.VERS EQU 22EAH CONTROLWARE VERSION - CHANGES
- * WITH NEW PRODUCTION VERSION
- VERMOD EQU 22EAH
- DEFS 22EAH-*+0
- DEFB VERS.
- M.TYPE EQU 22EBH TERMINAL ID CODE
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- M.CLOCK EQU 22ECH REAL TIME CLOCK
- M.EXTPA EQU 22EEH EXTERNAL INT. PROC. ADDRESS
- M.MARGIN EQU 22F0H MARGIN USED FOR CARR RET
- M.JOBS EQU 22F2H JOB STACK COUNT
- M.CCR EQU 22F4H CHARACTER PLOTTING PARAMETERS
- M.MODE EQU 22F6H TERMINAL OPERATING MODE
- M.DIR EQU 22F8H DIRECTION OF COORDINATE STEP
- M.KSW EQU 22FAH DEVICE INPUT DIRECTOR
- M.ENAB EQU 22FCH INTERRNAL INTERRUPT MASK
- * 22FEH (UNUSED)
- MOD5A EQU 2300H MODE 5 ADDRESS
- MOD6A EQU 2302H MODE 6 ADDRESS
- MOD7A EQU 2304H MODE 7 ADDRESS
- *
- MEM2 EQU 2306H M2 CHARACTER SET ADDRESS
- MEM3 EQU 2308H M3 CHARACTER SET ADDRESS
- MEM4 EQU 230AH M4 CHARACTER SET ADDRESS
- MEM5 EQU 230CH M5 CHARACTER SET ADDRESS
- MEM6 EQU 230EH M6 CHARACTER SET ADDRESS
- MEM7 EQU 2310H M7 CHARACTER SET ADDRESS
- * 2312H AND 2313H RESERVED
- M.HALT EQU 2314H USER PROGRAM HALT MESSAGE
- * (2 BYTES)
- M.STATUS EQU 2316H USER PROGRAM EXECUTION STATUS
- * (2 BYTES)
- * 2318H THROUGH 231FH NOT USED
- ENDVAR1 EQU 2320H END OF FIRST VARIABLE AREA
- DEFS 2320H-*+0
- ENDB 03 NO LOAD OR CHECKSUM
- EJECT
- FWA3 EQU * START OF THIRD CHECKSUM AREA
- *
- * INTERRUPT VECTOR TABLE
- * LOWER 8 BITS OF INTERRUPT VECTOR FIXED AT 00
- * UPPER 8 BITS INITIALIZED IN PROGRAM TO (100H+OFFSET)/100H.
- * THIS INTERRUPT VECTOR TABLE IS MOVED TO ADDRESS
- * 0100 HEX IN THE INITIALIZATION OF THE RESIDENT.
- *
- IVT EQU *
- DEFW BADINT PLATO CLA CHARACTER READY
- DEFW BADINT PLATO CLA CHARACTER REQUEST
- DEFW KYBD KEYBOARD DATA
- DEFW TP TOUCH PANEL DATA
- DEFW BADINT EXTERNAL I/O TIMEOUT
- DEFW BADINT SHORT INTERVAL
- DEFW EXTI EXTERNAL CHANNEL
- DEFW LINT LONG INTERVAL
- DEFW BADINT SERIAL I/O CHARACTER REQUEST
- DEFW BADINT SERIAL I/O EXT/STATUS CHANGE
- DEFW EXTI SERIAL I/O CHARACTER READY
- DEFW EXTI SERIAL I/O ERROR
- DEFW ASCCREQ ASCII COMM CHARACTER REQUEST
- DEFW ASCXTCHG ASCII COMM EXT/STATUS CHANGE
- DEFW ASCCRDY ASCII COMM CHARACTER READY
- DEFW ASCERR ASCII COMM ERROR
- BADINT JR BADINT ILLEGAL INTERRUPT
- IVT.LEN EQU *-IVT INT. VECTOR LENGTH
- **********
- * ASCII HORIZONTAL PLOT
- **********
- HPLOTA EQU *
- LD HL,(DMAA)
- LD DE,(DMA1)
- LD A,(HEIGHT)
- LD B,A
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- JP COMCG4 PLOT CHARACTER.
- JMPTBL EQU *
- JP INIT
- JP POINT
- JP LINE
- JP CHARS
- JP BLOCK
- JP INPX
- JP INPY
- JP OUTX
- JP OUTY
- JP TX.STOR
- JP MODESET
- JP STEPX
- JP STEPY
- JP WE
- JP DIR
- JP INPUT
- JP SSF0
- JP CCR
- JP EXTX
- JP EXEC
- JP GJOB
- JP XJOB
- JP RETURN
- JP CONVERT
- JT.LEN EQU *-JMPTBL
- *
- * * * * * * * * * * * * * * * * * * *
- *
- * 'C'P/'M 'ESCAPE COMMAND - 'CRUSOR ADDRESSING
- *
- * * * * * * * * * * * * * * * * * * *
- STOCMD EQU *
- LD A,1
- LD (ESCCOM),A CURSOR ADDRESSING STORE COMMAND
- LD (G.ESC),A SET ESC SEQUENCE FLAG
- JR ESCRET
- EX.ESCC EQU *
- LD A,(ESCDATF) CHECK ESCAPE SEQUENCE FLAG
- AND A
- JR NZ,EX.ESCC1 JUMP IF NOW ON SECOND CHAR
- LD A,C
- LD (ESCDAT1),A SAVE Y POSITION CHAR
- LD A,1
- LD (ESCDATF),A INCREMENT FLAG
- SCF SET CARRY FLAG
- RET
- EX.ESCC1 LD A,C
- LD (ESCDAT2),A SAVE X POSITION CHARACTER
- CALL CUR.ERAS ERASE PRESENT CURSOR
- LD A,(ESCDAT1)
- RLCA
- LD C,A SAVE 2 " Y
- RLCA
- LD B,A SAVE 4 " Y
- LD H,0
- LD D,0
- LD L,A MOVE 4 " Y TO HL
- ADD HL,HL GET 8 " Y
- LD E,B MOVE 4 " Y TO DE
- ADD HL,DE
- LD E,C
- ADD HL,DE ADD 2 " Y SO (HL) = 14 " Y
- LD DE,498
- EX DE,HL
- OR A CLEAR CARRY FLAG
- SBC HL,DE
- CALL R.OUTY
- LD A,(ESCDAT2) LOAD X VALUE
- RLCA
- LD E,A MOVE 2 " X
- LD D,0
- LD H,0
- LD L,A MOVE 2 " X TO HL
- ADD HL,HL GET 4 " X
- ADD HL,DE ADD 2 " X
- CALL R.OUTX
- LD A,0
- LD (ESCDATF),A RESET ESCAPE SEQUENCE FLAG
- LD (ESCCOM),A RESET ESC COMMAND FLAG
- LD (G.ESC),A RESET ESC SEQUENCE FLAG
- SCF
- ESCRET EQU *
- RET
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- * * * * * * * * * * * * * * * *
- * 'TOUCH 'PANEL 'ENABLE/'DISABLE
- * * * * * * * * * * * * * * * *
- TPENAB EQU *
- LD A,(M.ENAB)
- SET 5,A CHANGE TOUCH PANEL BIT
- LD L,A
- LD H,04H
- CALL R.SSF USE SSF TO ENABLE
- LD A,20H
- LD (TPSTATE),A STORE STATE TO LEAVE TOUCH
- * PANEL IN WHEN REMOVE STATELINE
- JR ESCRET
- TPDISAB EQU *
- LD A,(STATLINE)
- AND A
- JR NZ,TPDISAB2
- LD A,(M.ENAB)
- RES 5,A
- LD L,A
- LD H,04H
- CALL R.SSF USE SSF TO DISABLE
- TPDISAB2 LD A,0 STORE STATE TO LEAVE TOUCH PANEL
- LD (TPSTATE),A IN WHEN REMOVE STATLINE
- JR ESCRET
- CPMON EQU *
- LD A,(MODE)
- OR 40H SET CPM MODE BIT
- LD (MODE),A
- JR ESCRET
- CPMOFF EQU *
- LD A,(MODE)
- RES 6,A RESET CPM MODE BIT
- LD (MODE),A
- JR ESCRET
- * * * * * * * * * * * * * * * * * * * *
- *
- * 'C'P/'M 'COMMAND 'TABLE
- *
- * * * * * * * * * * * * * * * * * * * *
- CPMCMDT EQU *
- DEFW CPMREV 00 SEND REVISIONS NUMBER
- DEFW CPMREL 02 FORCE CONTROLWARE RELOAD
- DEFW CPMCKTP 04 CHECK BUFFERS - KEY/TP
- DEFW CPMCCOM 06 - COMM
- DEFW CPMCEXT 08 - EXTERNAL
- DEFW CPMKTP 0A SEND BYTE - KEY/TP
- DEFW CPMCOM 0C - COMM
- DEFW CPMEXT 0E - EXT
- DEFW CPMEIN 10 EXTERNAL - IN
- DEFW CPMEOUT 12 - OUT
- DEFW CPMESEL 14 - SELECT
- DEFW CPMSST 16 SERIAL - STATUS
- DEFW CPMSIN 18 - IN
- DEFW CPMSOUT 1A - OUT
- DEFW CPMSINIT 1C - INITIALIZE
- DEFW CPMPST 1E PRINTER - STATUS
- DEFW CPMPDATO 20 - DATA OUT
- DEFW CPMPCMD 22 - COMMAND
- DEFW CPMPDATI 24 - DATA IN
- DEFW CPMSCR 26 CHAR TO SCREEN
- DEFW CPMACOM 28 ASCII BYTE TO COMM
- DEFW CPMPCOM1 2A PLATO BYTE TO COMM - SOURCE
- DEFW CPMPCOM2 2C - DATA
- DEFW CPMIN 2E CPU IN
- DEFW CPMOUT1 30 CPU OUT - ADDR
- DEFW CPMOUT2 32 -DATA
- DEFW CPMADD1 34 LOAD RAM ADDR - LOW
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- DEFW CPMADD2 36 - HIGH
- DEFW CPMRD 38 READ RAM
- DEFW CPMWRT 3A WRITE RAM - DATA
- CPMTLEN EQU 3AH CPM COMMAND TABLE LENGTH
- * * * * * * * * * * * * * * * * * * * *
- * CPM RETURNS
- * * * * * * * * * * * * * * * * * * * *
- CPMRET EQU *
- LD A,41H LOAD DONE CODE
- OUT (FDDATA),A SEND TO CPM
- JP RETURN RETURN FROM INTERRUPT
- CPMDRET EQU * DATA RETURN ( DATA IN A )
- OUT (FDDATA),A SEND TO CPM
- JP RETURN RETURN FROM INTERRUPT
- * * * * * * * * * *@* * * * * * * * * *
- * CONTROLWARE REVISION NUMBER
- * * * * * * * * * * * * * * * * * * *
- CPMREV EQU *
- LD A,(M.VERS) READ UP REVISION NUMBER
- JR CPMDRET JUMP TO RETURN DATA TO CPM
- * * * * * * * * * *@* * * * * * * * * *
- * FORCE CONTROLWARE RELOAD
- * * * * * * * * * * * * * * * * * * *
- CPMREL EQU *
- LD A,0
- LD (LOADFLAG),A RESET FLAGS
- LD (RESETFLG),A
- LD A,41H
- OUT (FDDATA),A SEND DONE TO CPM
- LD HL,000
- LD A,7FH SWITCH TO ROM
- OUT (MNTSW),A
- JP (HL) JUMP TO 0000H
- * * * * * * * * * *@* * * * * * * * * *
- * CHECK IF ANYTHING IN CPM BUFFERS
- * * * * * * * * * * * * * * * * * * *
- CPMCKTP EQU * KEYBOARD/TOUCH PANEL BUFFER
- LD A,(KTPBUF) READ UP NUMBER OF ENTRIES
- JR CPMDRET JUMP TO SEND TO CPM
- CPMCCOM EQU * COMM LINE BUFFER
- LD A,(COMBUF) READ UP NUMBER OF BYTES
- JR CPMDRET JUMP TO SEND TO CPM
- CPMCEXT EQU * EXTERNAL CHANNEL BUFFER
- LD A,(EXTBUF) READ UP NUMBER OF ENTRIES
- JR CPMDRET JUMP TO SEND TO CPM
- * * * * * * * * * *@* * * * * * * * * *
- * SEND ONE BYTE TO CPM FROM BUFFERS
- * * * * * * * * * * * * * * * * * * *
- CPMKTP EQU * FROM KEYBOARD/TOUCH PANEL BUFFER
- LD HL,KTPBUF
- LD C,1FH BUFFER LENGTH
- JP CPMBRD JUMP TO SUBROUTINE TO READ AND OUTPUT
- CPMCOM EQU * FROM COMM LINE BUFFER
- LD HL,COMBUF
- LD C,7FH LENGTH
- JR CPMBRD
- CPMEXT EQU * FROM EXTERNAL BUFFER
- LD HL,EXTBUF
- LD C,7FH LENGTH
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- JR CPMBRD
- CPMBRD EQU *
- XOR A ZERO OUT A REGISTER
- OR (HL) READ IN CHARACTER COUNT
- JR Z,BUFEMP JUMP IF BUFFER EMPTY
- DEC (HL) DECREMENT CHARACTER COUNT
- INC HL
- INC HL STEP TO INDEX
- LD A,C MASK OUT INDEX WITH BUFFER LENGTH
- AND (HL) GET INDEX
- INC (HL) INCREMENT INDEX
- INC HL
- LD E,A CALCULATE BYTE LOCATION
- LD D,0
- ADD HL,DE
- LD A,(HL) READ BYTE
- JP CPMDRET JUMP TO SEND DATA TO CPM
- BUFEMP EQU *
- LD A,0FFH LOAD BUFFER EMPTY CODE
- JP CPMDRET JUMP TO SEND TO CPM
- * * * * * * * * * *@* * * * * * * * * *
- * CPM EXTERNAL CHANNEL
- * * * * * * * * * * * * * * * * * * *
- CPMEIN EQU *
- LD A,(EXT.IN) FIND CHANNEL TO INPUT FROM
- LD C,A
- IN A,(C) INPUT FROM EXTERNAL CHANNEL
- JP CPMDRET JUMP TO SEND TO CPM
- CPMEOUT EQU *
- LD A,(EXT.OUT) FIND CHANNEL TO OUTPUT TO
- LD C,A
- OUT (C),A OUT TO EXTERNAL CHANNEL
- JP CPMRET SEND DONE TO CPM
- CPMESEL EQU *
- IN A,(FDDATA) INPUT CHANNEL TO SELECT
- LD (EXT.IN),A STORE CHANNEL NUMBER
- LD (EXT.OUT),A
- JP CPMRET SEND DONE TO CPM
- * * * * * * * * * *@* * * * * * * * * *
- * CPM SERIAL CHANNEL
- * * * * * * * * * * * * * * * * * * *
- CPMSST EQU *
- LD A,10H
- OUT (SERCTRL),A
- IN A,(SERSTAT) INPUT SERIAL STATUS
- JP CPMDRET JUMP TO SEND TO CPM
- CPMSIN EQU *
- IN A,(SERDATI) INPUT SERIAL DATA
- JP CPMDRET JUMP TO SEND TO CPM
- CPMSOUT EQU *
- IN A,(FDDATA) INPUT DATA FROM CPM
- OUT (SERDATO),A OUTPUT TO SERIAL CHANNEL
- JP CPMRET JUMP TO TELL CPM DONE
- CPMSINIT EQU * SERIAL CHANNEL INITIALIZATION
- IN A,(FDDATA) INPUT INIT. INFO.
- LD C,A SAVE INFO IN C REGISTER
- AND 03
- LD D,A SAVE PARITY BITS
- LD A,04
- AND C FIND STOP BITS
- RLCA
- OR D ADD BACK PARITY BITS
- OR 44H ADD "16 BITS
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD (SERINIT+2),A PUT IN TABLE
- LD A,C
- AND 18H FIND WORD LENGTH BITS
- RLCA
- RLCA POSITION FOR TABLE
- LD D,A SAVE WORD LENGTH
- OR 8AH ADD DTR, EN XMIT BITS
- LD (SERINIT+4),A PUT IN TABLE
- LD A,D
- RLCA
- OR 1 ADD RCVR ENABLE BITS
- LD (SERINIT+6),A PUT IN TABLE
- LD A,C
- AND 0E0H FIND SERIAL RATE
- OUT (SERRATE),A OUTPUT SERIAL RATE
- LD C,SERCTRL
- LD HL,SERINIT LOAD START OF INIT TABLE
- LD B,08 LOAD LENGTH OF INIT TABLE
- OTIR OUTPUT TABLE
- JP CPMRET SEND DONE TO CPM
- * SERIAL INITIALIZATION INFORMATION BYTE
- * BIT 0 0 = PARITY DISABLED
- * 1 = PARITY ENABLED
- * BIT 1 0 = ODD PARITY
- * 1 = EVEN PARITY
- * BIT 2 0 = 1 STOP BIT
- * 1 = 2 STOP BITS
- * BITS 3 AND 4 WORD LENGTH
- * 0 = 5 BITS
- * 1 = 6 BITS
- * 2 = 7 BITS
- * 3 = 8 BITS
- * BITS 5, 6 AND 7 BAUD RATE
- * 0 = 150
- * 1 = 300
- * 2 = 600
- * 3 = 1200
- * 4 = 2400
- * 5 = 4800
- * 6 = 9600
- * 7 = 19,200
- * * * * * * * * * *@* * * * * * * * * *
- * CPM PRINTER COMMANDS
- * * * * * * * * * * * * * * * * * * *
- CPMPST EQU *
- IN A,(CNTLFCN) INPUT PRINTER STATUS
- JP CPMDRET JUMP TO SEND TO CPM
- CPMPDATO EQU *
- IN A,(FDDATA) INPUT DAT FROM CPM
- OUT (DATAFCN),A SEND DATA TO PRINTER
- JP CPMRET JUMP TO SEND DONE TO CPM
- CPMPCMD EQU *
- IN A,(FDDATA) INPUT COMMAND FROM CPM
- OUT (CNTLFCN),A SEND TO PRINTER
- JP CPMRET JUMP TO SEND DONE TO CPM
- CPMPDATI EQU *
- IN A,(DATAFCN) INPUT DATA FROM PRINTER
- JP CPMDRET JUMP TO SEND TO CPM
- * * * * * * * * * *@* * * * * * * * * *
- * CPM CHARACTER TO SCREEN (PLUS ESCAPE SEQUENCES)
- * * * * * * * * * * * * * * * * * * *
- CPMSCR EQU *
- LD HL,RXBUF BUFFER TO STORE IN
- LD A,7FH
- CP (HL)
- JP Z,BUFFULL JUMP IF BUFFER IS FULL
- INC (HL) INCREMENT INDEX COUNT
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- INC HL STEP TO INPUT INDEX
- AND (HL)
- INC (HL) INCREMENT INPUT INDEX
- INC HL
- INC HL STEP TO START OF STORE AREA
- LD E,A
- LD D,0
- ADD HL,DE CALCULATE STORE LOCATION
- IN A,(FDDATA) INPUT DATA
- LD (HL),A STORE DATA IN BUFFER
- LD HL,M.JOBS
- INC (HL) INCREMENT JOB COUNT
- JP CPMRET JUMP TO SEND DONE TO CPM
- * * * * * * * * * *@* * * * * * * * * *
- * SEND BYTE TO ASCII COMM
- * * * * * * * * * * * * * * * * * * *
- CPMACOM EQU *
- IN A,(FDDATA)
- LD C,A
- LD A,(TXBUF)
- XOR 7
- LD A,40H
- JP Z,CPMDRET
- CALL XMIT.1A
- JP CPMRET
- * * * * * * * * * *@* * * * * * * * * *
- * SEND BYTE TO PLATO COMM
- * * * * * * * * * * * * * * * * * * *
- CPMPCOM1 EQU *
- IN A,(FDDATA) INPUT SOURCE INFO FROM CPM
- LD (CPMDAT),A SAVE
- JP CPMRET JUMP TO SEND DONE TO CPM
- CPMPCOM2 EQU *
- LD A,(CPMDAT) READ BACK UP SOURCE INFO
- RRCA
- RRCA SHIFT TO UPPER BITS
- LD H,A
- IN A,(FDDATA) INPUT DATA FROM CPM
- LD L,A
- CALL FIFO.ST CALL SUBROUTINE TO STORE
- * IN OUTPUT BUFFER
- JR Z,BUFFULL JUMP IF BUFFER FULL
- JP CPMRET JUMP TO SEND DONE TO CPM
- BUFFULL EQU *
- LD A,40H LOAD BUFFER FULL CODE
- JP CPMDRET JUMP TO SEND TO CPM
- * * * * * * * * * *@* * * * * * * * * *
- * DIRECT IN/OUT FROM TERMINAL CPU
- * * * * * * * * * * * * * * * * * * *
- CPMIN EQU *
- IN A,(FDDATA) INPUT ADDR FROM CPM
- LD C,A
- IN A,(C) INPUT FROM ADDR
- JP CPMDRET JUMP TO SEND TO CPM
- CPMOUT1 EQU *
- IN A,(FDDATA) INPUT ADDR
- LD (CPMDAT),A SAVE
- JP CPMRET JUMP TO SEND DONE TO CPM
- CPMOUT2 EQU *
- LD A,(CPMDAT) READ ADDR
- LD C,A
- IN A,(FDDATA) INPUT DATA
- OUT (C),A OUTPUT
- JP CPMRET JUMP TO SEND DONE TO CPM
- * * * * * * * * * *@* * * * * * * * * *
- * CPM TERMINAL RAM READ/WRITE
- * * * * * * * * * * * * * * * * * * *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- CPMADD1 EQU *
- IN A,(FDDATA) INPUT LOW BYTE OF ADDR
- LD (CPMDAT),A SAVE IT
- JP CPMRET JUMP TO SEND DONE TO CPM
- CPMADD2 EQU *
- IN A,(FDDATA) INPUT HIGH BYTE OF ADDRESS
- LD (CPMDAT+1),A SAVE IT
- JP CPMRET JUMP TO SEND DONE TO CPM
- CPMRD EQU *
- LD HL,(CPMDAT) LOAD ADDR TO READ FROM
- LD A,(HL) READ RAM
- INC HL INCREMENT ADDRESS
- LD (CPMDAT),HL SAVE NEW ADDRESS
- JP CPMDRET JUMP TO SEND DATA TO CPM
- CPMWRT EQU *
- IN A,(FDDATA) READ IN DATA TO WRITE FROM CPM
- LD HL,(CPMDAT) READ RAM ADDRESS
- LD (HL),A WRITE TO RAM
- INC HL INCREMENT ADDRESS
- LD (CPMDAT),HL SAVE NEW ADDRESS
- JP CPMRET JUMP TO SEND DONE TO CPM
- EJECT
- * * * * * * * * * * * * * * * * * * * *
- * ROUTINES TO EXECUTE CONTROL CODES AND ESCAPE SEQUENCES
- * * * * * * * * * * * * * * * * * * * *
- **********
- * SOUND AUDIBLE ALARM AND CLEAR BYPASS.
- **********
- BEL EQU *
- LD A,01H SOUND AUDIBLE ALARM
- OUT (MISCTL),A
- XOR A CLEAR BYPASS
- LD (BYPASS),A
- LD (DARK),A DISABLE DARK VECTOR
- RET
- **********
- * BACKSPACE CURSOR ONE CHARACTER POSITION. IF AT BEGINNING
- * OF LINE, GO TO LAST CHARACTER POSITION ON LINE ABOVE. IF
- * AT TOP LINE, WRAP TO BOTTOM LINE WITHIN AREA DEFINED BY
- * (PAGEND). (BYPASS) IS ALSO CLEARED.
- **********
- BS EQU *
- CALL CUR.ERAS ERASE CURSOR
- XOR A CLEAR BYPASS
- LD (BYPASS),A
- CALL R.INPX IS X < WIDTH OF CHAR
- LD DE,(WIDTH)
- OR A
- SBC HL,DE
- JR C,BS.1 YES, JUMP
- CALL R.OUTX NO, JUST BACK UP X
- JR BS.2
- BS.1 EQU *
- LD HL,(LINEND) YES, GO TO END OF LINE
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- CALL R.OUTX
- CALL AVT.1 AND DO A VERTICAL TAB
- BS.2 EQU *
- LD A,(BS.ERASE) IS BS ERASE FLAG SET
- OR A
- RET Z ALL DONE IF NOT
- LD BC,0100H ERASE THE PRESENT CHARACTER
- CALL ACHARGEN BY WRITING A SPACE OVER IT
- BS.3 EQU *
- XOR A CLEAR THE BS ERASE FLAG
- LD (BS.ERASE),A
- RET
- **********
- * MOVE CURSOR UP ONE LINE. IF AT TOP LINE, WRAP CURSOR TO
- * BOTTOM LINE WITHIN AREA DEFINED BY (PAGEND).
- * (BYPASS) IS ALSO CLEARED.
- **********
- AVT EQU *
- CALL CUR.ERAS ERASE CURSOR
- XOR A CLEAR BYPASS
- LD (BYPASS),A
- AVT.1 EQU *
- CALL R.INPY IS Y+(HEIGHT)>=513-(HEIGHT)
- LD DE,(HEIGHT)
- ADD HL,DE
- EX DE,HL (DE=Y+HEIGHT, HL=HEIGHT)
- LD BC,513
- SBC HL,BC
- ADD HL,DE
- JR NC,AVT.1A NO, JUST MOVE Y UP
- LD DE,(PAGEND) YES, WRAP TO BOTTOM
- AVT.1A EQU *
- EX DE,HL UPDATE Y
- JP R.OUTY
- **********
- * DO A CARRIAGE RETURN BY MOVING CURSOR TO LEFTMOST X
- * POSITION. IF CR/LF IS SPECIFIED IN (STRAP), ALSO DO
- * A LINE FEED FUNCTION. (BYPASS) IS ALSO CLEARED.
- **********
- ACR EQU *
- CALL ACR.1 DO CR, CLR BYPASS, SET ALPHA
- LD A,(STRAP) IS CR/LF SELECTED
- BIT 0,A
- RET Z EXIT IF NOT
- * CALLABLE ROUTINE TO DO A LINE FEED FUNCTION, INCLUDING
- * SCROLL IF IN TIMESHARE MODE.
- ALF.1 EQU *
- CALL R.INPY DE=Y-(HEIGHT)
- LD DE,(HEIGHT)
- OR A
- SBC HL,DE
- EX DE,HL
- LD HL,(PAGEND) IS Y-(HEIGHT)<(PAGEND)
- SCF
- SBC HL,DE
- JR NC,ALF.1A YES, AT BOTTOM LINE
- EX DE,HL NO, JUST MOVE Y DOWN ONE LINE
- JP R.OUTY
- ALF.1A EQU *
- LD A,(TGMODE) CHECK TIMESHARE OR GRAPHIC
- OR A
- JR Z,SCROLL JUMP IF TIMESHARE
- * EXTERNAL ENTRY TO SET Y TO TOP LINE OF DISPLAY.
- ALF.2 EQU *
- LD HL,512
- LD DE,(HEIGHT)
- OR A
- SBC HL,DE
- JP R.OUTY
- * CALLABLE ROUTINE TO SCROLL PAGE UP ONE DISPLAY LINE.
- * ROUTINE SCROLLS DATA BETWEEN TOP OF PAGE AND Y=(PAGEND)
- * UP ONE DISPLAY LINE AND CLEARS THE BOTTOM DISPLAY LINE
- * IN THIS RANGE. THIS ROUTINE TAKES ABOUT 220 MILLISECONDS
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- * TO SCROLL 34 LINES OF ASCII SIZE CHARACTERS.
- SCROLL EQU *
- LD HL,(HEIGHT) SET BC=512-(PAGEND+HEIGHT)
- LD DE,(PAGEND) (NUMBER OF BYTES TO MOVE)
- ADD HL,DE
- EX DE,HL
- LD HL,512
- SBC HL,DE
- LD B,H
- LD C,L
- LD DE,8000H INITIALIZE DE FOR SCROLL
- SCROLL1 EQU *
- PUSH DE SAVE ADDRESS FOR LATER USE
- PUSH BC SAVE BYTE COUNT FOR LATER USE
- LD HL,(HEIGHT) HL=FROM ADDRESS
- LD H,D
- LDIR
- LD BC,(HEIGHT) NOW CLEAR BOTTOM LINE
- DEC BC
- LD H,D
- LD L,E
- INC DE
- LD (HL),0
- LDIR
- POP BC
- POP DE
- INC D REPEAT FOR ALL COLUMNS
- INC D
- JR NZ,SCROLL1
- RET
- **********
- * DO A LINE FEED FUNCTION BY MOVING THE CURSOR DOWN ONE
- * CHARACTER LINE IF NOT ALREADY AT BOTTOM LINE OF AREA
- * DEFINED BY (PAGEND). 'IF ALREADY AT BOTTOM LINE, DO NOT
- * MOVE CURSOR, BUT SCROLL PAGE UP ONE CHARACTER LINE IF IN
- * TIMESHARE MODE. IF IN GRAPHIC MODE WITH CURSOR AT BOTTOM
- * CHARACTER LINE, THE CURSOR WILL WRAP TO THE TOP LINE.
- * (BYPASS) IS ALSO CLEARED. ALSO IF LF/CR IS SELECTED BY
- * (STRAP), A CARRIAGE RETURN FUNCTION IS PERFORMED.
- **********
- ALF EQU *
- CALL CUR.ERAS ERASE CURSOR
- XOR A CLEAR BYPASS
- LD (BYPASS),A
- CALL ALF.1 DO THE LINE FEED
- LD A,(STRAP) IS LF/CR SELECTED
- BIT 1,A
- RET Z EXIT IF NOT
- * CALLABLE ROUTINE TO DO A CARRIAGE RETURN FUNCTION BY
- * SETTING THE X COORDINATE TO 0, CLEARING BYPASS AND
- * SELECTING ALPHA MODE.
- ACR.1 EQU *
- CALL US.2 CLEAR BYPASS, SELECT ALPHA
- LD HL,0
- JP R.OUTX
- **********
- * MOVE CURSOR TO THE RIGHT ONE CHARACTER POSITION. IF AT
- * END OF LINE, DO A CARRIAGE RETURN AND LINE FEED
- * (INCLUDING SCROLL OR PAGE WRAP IF NECESSARY).
- **********
- HTAB EQU *
- CALL CUR.ERAS ERASE CURSOR
- XOR A CLEAR BYPASS
- LD (BYPASS),A
- HTAB.1 EQU *
- CALL R.INPX DE=X+(WIDTH)
- LD DE,(WIDTH)
- ADD HL,DE
- EX DE,HL
- LD HL,(LINEND) IS X+(WIDTH)>(LINEND)
- SBC HL,DE
- JR C,HTAB.2 YES, AT END OF LINE
- EX DE,HL NO, JUST MOVE X RIGHT ONE CHAR
- JP R.OUTX
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HTAB.2 EQU * END OF LINE, SO
- CALL ACR.1 DO CARRIAGE RETURN
- JP ALF.1 AND LINE FEED
- **********
- * CLEAR SCREEN, CLEAR BYPASS, SELECT ALPHA MODE AND SET
- * CURSOR TO LEFTMOST POSTION ON TOP CHARACTER LINE.
- **********
- AFF EQU *
- CALL CUR.ERAS ERASE CURSOR
- CALL BULKER ERASE SCREEN
- CALL DSTAT REDISPLAY STATUS LINE IF ON
- AFF.1 EQU *
- CALL US.2 CLEAR BYPASS, SET ALPHA
- CALL ACR.1 DO CARRIAGE RETURN
- JP ALF.2 SET TO TOP LINE
- **********
- * SET BYPASS
- **********
- CAN EQU *
- LD HL,BYPASS SET BYPASS
- LD (HL),1
- RET
- **********
- * TRANSMIT TERMINAL STATUS (IF NOT IN GIN MODE), TRANSMIT
- * X AND Y COORDINATE, AND OPTIONALLY SEND CR OR CR,EOT
- * DEPENDING ON (STRAP) WORD. SET ALPHA MODE IF IN GIN MODE.
- **********
- ENQ EQU *
- LD A,(MODE) IF NOT GIN MODE THEN
- AND 0BFH
- CP 8
- JR Z,ENQ.1
- LD A,(TSTAT) SEND TERMINAL STATUS
- LD C,A
- LD A,(CPRINTFG) CHECK IF PRINTING FROM COMM
- OR A LINE
- JR NZ,ENQ.0 JUMP IF YES
- CALL CHECKID CHECK PRINTER ID
- JR NZ,ENQ.0 JUMP IF NO PRINTER ATTACHED
- IN A,(CNTLFCN) CHECK PRINTER STATUS
- AND 39H
- JR NZ,ENQ.0 JUMP IF STATUS ERROR
- RES 4,C INDICATE PRINTER AVAILABLE
- ENQ.0 EQU *
- CALL XMIT.1A
- ENQ.1 CALL R.INPX GET X COORD
- CALL HILO AND SEND IN 2 BYTES
- CALL R.INPY GET Y COORD
- LD DE,(BIAS) SUBTRACT THE BIAS
- OR A (CLEAR CARRY)
- SBC HL,DE
- CALL HILO AND SEND IN 2 BYTES
- LD A,(STRAP) TEST GIN TRANSMISSION
- BIT 2,A
- JR Z,ENQ.2 JUMP IF SEND NOTHING AUTO
- PUSH AF SAVE STRAP VALUE
- LD C,0DH SEND CAR RET
- CALL XMIT.1A
- POP AF GET SAVED STRAP
- BIT 3,A
- JR Z,ENQ.2 SEND CR ONLY
- LD C,04H SEND EOT
- CALL XMIT.1A
- ENQ.2 EQU *
- CALL GIN.EXIT DISABLE TP, SAVE CURSOR POS.
- LD HL,MODE TEST MODE
- LD A,(HL)
- AND 0BFH
- CP 8
- RET NZ EXIT IF NOT GIN MODE
- LD (HL),3 SET ALPHA MODE
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- RET
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- * CALLABLE ROUTINE TO EXIT FROM GIN MODE. CROSSHAIR CURSOR
- * POSITION IS SAVED AND TOUCH PANEL IS DISABLED.
- GIN.EXIT EQU *
- LD A,(MODE) TEST MODE
- AND 0BFH
- CP 8
- RET NZ JUST EXIT IF NOT GIN MODE
- CALL CUR.ERAS ERASE THE CURSOR
- CALL R.INPX SAVE CROSSHAIR POSITION
- LD (G.XREG),HL
- INC HL ADJUST FOR CROSSHAIR OFFSET
- INC HL
- CALL R.OUTX
- CALL R.INPY
- LD (G.YREG),HL
- INC HL
- INC HL
- CALL R.OUTY
- LD A,(STATLINE) DO NOT DISABLE TOUCH PANEL
- OR A IF STATUS LINE
- RET NZ IS DISPLAYED
- LD H,04H LOAD INTERRUPT MASK
- LD A,(M.ENAB)
- RES 5,A DISABLE TOUCH PANEL
- LD L,A
- CALL R.SSF
- RET
- ENDB 00 LOAD AND CHECKSUM
- * CALLABLE ROUTINE TO TRANSMIT CURRENT X OR Y POSITION OF
- * THE GIN CROSSHAIR CURSOR. ON ENTRY, THE COORDINATE IS IN
- * HL. THE POSITION IS TRANSMITTED AS TWO CHARACTERS.
- HILO EQU *
- LD A,(MODE) CHECK MODE
- AND 0BFH
- CP 8
- JR NZ,HILO.2 NO BIAS IF NOT GIN MODE
- INC HL BIAS FOR CENTER OF CROSSHAIR
- INC HL
- RES 1,H LIMIT COORD TO 511 MAXIMUM
- HILO.2 LD A,(SCALEFG) IF SCALING THEN
- OR A
- JR NZ,HILO.1
- ADD HL,HL DOUBLE COORD VALUE
- HILO.1 LD A,1FH GET LOWER 5 BITS
- AND L
- PUSH AF AND TEMP SAVE
- ADD HL,HL GET UPPER 5 BITS IN H REG.
- ADD HL,HL
- ADD HL,HL
- LD A,H
- AND 1FH MASK TO 5 BITS
- OR 20H BIAS VALUE
- LD C,A
- CALL XMIT.1A SEND UPPER BITS
- POP AF GET SAVED LOWER BITS
- OR 20H BIAS VALUE
- LD C,A
- CALL XMIT.1A SEND LOWER BITS
- RET
- **********
- * SELECT BLOCK WRITE/ERASE MODE
- **********
- EM EQU *
- CALL CUR.ERAS ERASE CURSOR
- LD A,01 SUPPRESS THE CURSOR
- LD (G.SUPCUR),A
- XOR A CLEAR BYPASS
- LD (BYPASS),A
- LD A,0B1H SET TERMINAL STATUS
- LD (TSTAT),A
- CALL GIN.EXIT DISABLE TP, SAVE CURSOR POS.
- JP EM.1
- **********
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- * SELECT POINT PLOT MODE
- **********
- FS EQU *
- CALL CUR.ERAS ERASE CURSOR
- LD A,01 SUPPRESS THE CURSOR
- LD (G.SUPCUR),A
- XOR A CLEAR BYPASS
- LD (BYPASS),A
- LD A,0B1H SET TERMINAL STATUS
- LD (TSTAT),A
- CALL GIN.EXIT DISABLE TP, SAVE CURSOR POS.
- JP FS.1
- **********
- * SELECT GRAPH MODE
- **********
- GS EQU *
- CALL CUR.ERAS ERASE CURSOR
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD A,01 SUPPRESS THE CURSOR
- LD (G.SUPCUR),A
- XOR A CLEAR BYPASS
- LD (BYPASS),A
- LD A,0B9H SET TERMINAL STATUS
- LD (TSTAT),A
- CALL GIN.EXIT DISABLE TP, SAVE CURSOR POS.
- JP GS.1
- **********
- * SELECT ALPHA MODE
- **********
- US EQU *
- LD A,(MODE) IS THIS GIN MODE
- AND 0BFH
- CP 8
- RET Z YES - EXIT
- US.2 EQU *
- CALL CUR.ERAS ERASE THE CURSOR
- XOR A CLEAR BYPASS
- LD (BYPASS),A
- LD (G.SUPCUR),A ENABLE THE CURSOR
- LD A,0B5H SET TERMINAL STATUS
- LD (TSTAT),A
- CALL GIN.EXIT DISABLE TP, SAVE CURSOR POS.
- JP US.1 SELECT ALPHA MODE
- **********
- * SELECT ASCII SIZE CHARACTERS.
- **********
- ASIZE1 EQU *
- CALL CUR.ERAS ERASE CURSOR
- LD HL,A0CODE00 SELECT SIZE 1
- LD (G.MEMSEL),HL
- LD HL,CHGEN.S1
- LD (CHBASE),HL
- LD HL,504 85 CHARS PER LINE
- LD (LINEND),HL 34 LINES PER PAGE
- LD HL,36 SET LINEND, PAGEND, HEIGHT
- LD (PAGEND),HL AND WIDTH ACCORDINGLY
- LD HL,14
- LD (HEIGHT),HL
- LD HL,6
- LD (WIDTH),HL
- XOR A SET SIZE TO ZERO
- LD (G.SIZE),A (SIZE 1 CHARS)
- RET
- **********
- * SELECT PLATO SIZE CHARACTERS.
- **********
- ASIZE2 EQU *
- CALL CUR.ERAS ERASE CURSOR
- LD HL,M0CODE00 POINT TO IST CHAR DATA
- LD (G.MEMSEL),HL
- LD HL,CHGEN.S2
- LD (CHBASE),HL
- LD HL,504 64 CHARS PER LINE
- LD (LINEND),HL 30 LINES PER PAGE
- LD HL,32 SET LINEND, PAGEND, HEIGHT
- LD (PAGEND),HL AND WIDTH ACCORDINGLY
- LD HL,16
- LD (HEIGHT),HL
- LD HL,8
- LD (WIDTH),HL
- LD A,1 INDICATE SIZE 2 CHARS
- LD (G.SIZE),A
- RET
- **********
- * SELECT GIN MODE, SET BYPASS, ENABLE THE TOUCH PANEL
- * AND SET UP GIN CURSOR.
- **********
- ASUB EQU *
- CALL CUR.ERAS ERASE CURSOR
- XOR A ENABLE CURSOR DISPLAY
- LD (G.SUPCUR),A
- INC A SET BYPASS
- LD (BYPASS),A
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD H,04H LOAD INTERRUPT MASK
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD A,(M.ENAB)
- OR 20H ENABLE TOUCH PANEL
- LD L,A
- CALL R.SSF
- LD A,(MODE)
- AND 40H
- OR 08H SELECT GIN MODE
- LD (MODE),A
- LD HL,(G.XREG) GET GIN CURSOR POS.
- CALL R.OUTX
- LD HL,(G.YREG)
- CALL R.OUTY
- RET
- ENDB 00 LOAD AND CHECKSUM
- EJECT
- EJECT
- * * * * * * * * * * * * * * * * * * * *
- *
- * GIN MODE CURSOR POSITIONING VIA TOUCH PANEL
- *
- * * * * * * * * * * * * * * * * * * * *
- GIN.TP EQU *
- PUSH DE SAVE TP DATA ON STACK
- CALL CUR.ERAS ERASE CURSOR
- POP DE RESTORE DATA
- PUSH DE SAVE DATA AGAIN
- CALL GIN.TP1 GET Y COORD
- CALL R.OUTY
- POP DE DATA IN DE ONCE AGAIN
- LD A,E
- RRCA
- RRCA
- RRCA
- RRCA
- LD E,A
- CALL GIN.TP1 GET X COORD
- CALL R.OUTX
- RET
- *
- GIN.TP1 EQU *
- LD A,0FH MASK WITH LOWER 4 BITS
- AND E
- LD L,A
- LD H,00 HL = TP VALUE * 32
- ADD HL,HL
- ADD HL,HL
- ADD HL,HL
- ADD HL,HL
- ADD HL,HL
- LD DE,14 ADD 14 (BIAS TO SQAURE CENTER)
- ADD HL,DE
- RET
- * * * * * * * * * * * * * * * * * * * *
- *
- * GIN MODE CURSOR POSITIONING VIA KEYBOARD
- * AND GIN MODE TRANSMISSION
- *
- * ON ENTRY, B=UNMODIFIED ASCII KEY CODE
- * C=CAPS MODIFIED ASCII KEY CODE
- *
- * * * * * * * * * * * * * * * * * * * *
- GIN.KB EQU *
- XOR A CLEAR THE BS ERASE FLAG
- LD (BS.ERASE),A
- LD A,C IS CHAR A CR
- CP 0DH
- JR Z,GIN.XMT SEND LAST KEY IF YES
- LD A,C SAVE GIN CHAR KEY
- LD (GIN.KEY),A
- LD HL,1 ASSUME FINE GRID
- BIT 5,B CHECK FOR SHIFTED KEY
- JR NZ,GIN.2 FINE GRID IF UNSHIFTED
- ADD HL,HL COARSE GRID IF SHIFTED
- ADD HL,HL
- GIN.2 LD (DOTS),HL SAVE GRID MOVEMENT VALUE
- RES 5,B CLEAR BIT 5
- LD HL,MOVTAB SEARCH CURSOR MOVE TABLE
- GIN.3 EQU * FOR THE CHAR
- LD A,(HL)
- CP 0FFH
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- JR Z,GIN.XMT JUMP IF NOT A CURSOR MOVE KEY
- CP B CHECK FOR MATCH
- JR Z,MOVCURS JUMP IF MATCH
- INC HL UPDATE TO NEXT TABLE ENTRY
- INC HL
- INC HL
- JR GIN.3
- MOVCURS EQU *
- INC HL MATCH FOUND
- LD E,(HL) JUMP TO CURSOR MOVE ROUTINE
- INC HL
- LD D,(HL)
- PUSH DE TEMP SAVE ADDRESS
- CALL CUR.ERAS ERASE THE CURSOR
- POP HL THEN GET SAVED ADDRESS
- CALL JMPHL AND DO THE JUMP
- RET
- GIN.XMT EQU *
- LD A,(GIN.KEY) SEND LAST KEY STORED
- LD C,A
- CALL XMIT.1A
- CALL ENQ.1 SEND CURSOR POSITION
- RET
- MOVTAB EQU * TABLE OF CURSOR MOVE KEYS
- DEFB 41H UC A
- DEFW WEST
- DEFB 43H UC C
- DEFW SEAST
- DEFB 44H UC D
- DEFW EAST
- DEFB 45H UC E
- DEFW NEAST
- DEFB 51H UC Q
- DEFW NWEST
- DEFB 57H UC W
- DEFW NORTH
- DEFB 58H UC X
- DEFW SOUTH
- DEFB 5AH UC Z
- DEFW SWEST
- DEFB 0FFH END OF TABLE
- SEAST EQU *
- CALL SOUTH
- EAST EQU *
- CALL R.INPX
- LD DE,(DOTS)
- ADD HL,DE
- CALL R.OUTX
- RET
- NEAST EQU *
- CALL EAST
- NORTH EQU *
- CALL R.INPY
- LD DE,(DOTS)
- ADD HL,DE
- CALL R.OUTY
- RET
- NWEST EQU *
- CALL NORTH
- WEST EQU *
- CALL R.INPX
- LD DE,(DOTS)
- OR A
- SBC HL,DE
- CALL R.OUTX
- RET
- SWEST EQU *
- CALL WEST
- SOUTH EQU *
- CALL R.INPY
- LD DE,(DOTS)
- OR A
- SBC HL,DE
- CALL R.OUTY
- RET
- ENDB 00 LOAD AND CHECKSUM
- EJECT
- * * * * * * * * * * * * * * * * * * * *
- * SELECT OR DESELECT STATUS LINE DISPLAY MODE
- * * * * * * * * * * * * * * * * * * * *
- G.MODE EQU *
- LD A,(MODE) IGNORE IF GIN MODE
- CP 8
- RET Z
- LD HL,STATLINE
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD A,(HL) TOGGLE STATUS LINE FLAG
- XOR 20H
- LD (HL),A
- JR NZ,G.MODE2 JUMP IF SELECT
- LD A,(TPSTATE)
- AND A
- JR NZ,STAT.ERS IF PREVIOUSLY ENABLE LEAVE ENABLE
- LD H,04H ENABLE OR DISABLE TOUCH PANEL
- LD A,(M.ENAB)
- RES 5,A
- LD L,A
- CALL R.SSF
- * CLEAR STATUS LINE
- * CLEARS FROM Y=16 THROUGH Y=31 ACROSS ENTIRE SCREEN.
- STAT.ERS EQU *
- LD H,80H
- STAT.ER1 EQU *
- INC H
- LD D,H
- LD L,0E0H
- LD E,0E1H
- LD BC,15
- LD (HL),0
- LDIR
- INC H
- JR NZ,STAT.ER1
- RET
- G.MODE2 EQU *
- LD A,(M.ENAB)
- AND 20H
- LD (TPSTATE),A SAVE PRESENT TP STATE
- LD A,(M.ENAB)
- SET 5,A
- LD L,A ENABLE TOUCH PANEL INTERRUPTS
- LD H,04H
- CALL R.SSF
- JP DSTAT JUMP TO DISPLAY STATUS LINE
- *
- * CPM EXTERNAL INTERRUPT HANDLER
- *
- EXTICPM EQU *
- IN A,(FDCMND) INPUT CPM STATUS
- LD C,A SAVE FOR COMMAND INFO
- BIT 0,A
- JP NZ,EXTI00 RETURN IF NOT CPM INTERRUPT
- LD A,CPMTLEN
- SUB C
- JP C,EXTI00 RETURN IF ILLEGAL COMMAND
- LD HL,CPMCMDT ADDR OF COMMAND TABLE
- LD D,0
- LD E,C INDEX INTO TABLE
- ADD HL,DE
- LD E,(HL) LOAD JUMP ADDRESS
- INC HL
- LD D,(HL)
- EX DE,HL MOVE ADDRESS TO HL REGISTERS
- JP (HL) GO TO PARTICULAR COMMAND
- * CPM KEYBOARD/TOUCH PANEL BUFFER STORE
- * ON ENTRY C = DATA HL = ADDRESS OF BUFFER
- KTPSTR EQU * KEYBOARD/TOUCH PANEL BUFFER STORE
- INC (HL) INCREMENT DIFFERENCE COUNT
- INC HL STEP TO INPUT INDEX
- AND (HL)
- INC (HL) INCREMENT INPUT POINTER
- INC HL STEP TO START OF STORE AREA
- INC HL
- LD E,A
- LD D,00 ADD INDEX
- ADD HL,DE,
- LD (HL),C STORE KEY
- RET
- TPCPM EQU *
- LD B,E SAVE TOUCH DATA
- LD A,(LOC.RMT)
- OR A
- RET NZ RETURN IF IN LOCAL MODE
- LD A,(MODE) CHECK IF IN CPM MODE
- BIT 6,A
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- RET Z RETURN IF NOT IN CPM MODE
- LD HL,KTPBUF LOAD BUFFER ADDRESS
- LD A,(HL)
- CP 1FH
- RET Z RETURN IF FULL
- CP 1EH
- RET Z RETURN IF TOO FULL FOR TOUCH INPUT
- LD A,1FH
- LD C,TPESCK
- CALL KTPSTR STORE TOUCH PANEL ESC KEY
- LD HL,KTPBUF
- LD A,1FH
- LD C,B MOVE TOUCH DATA BACK INTO C
- CALL KTPSTR STORE TOUCH DATA
- RET
- * INTERPRET WHAT TO DO WITH TOUCH PANEL DATA
- TOUCH EQU *
- LD A,(MODE) ARE WE IN GIN MODE
- AND 0BFH
- CP 8
- JP Z,GIN.TP YES, HANDLE AS GIN INPUT
- LD A,(STATLINE)
- XOR 20H
- JR NZ,TPCPM IF STATUS LINE NOT DISPLAYED JUMP CPMTEST
- * UPDATE STATUS LINE DISPLAY VIA THE TOUCH PANEL.
- * ON ENTRY E7-E4 IS X COORD AND E3-E0 IS Y COORD.
- STAT.UP EQU *
- LD A,E CHECK Y COORD
- AND 0EH
- JR NZ,TPCPM JUMP TO CPMTEST IF Y>1
- LD A,E SET BC=X COORD DIV 2
- RLCA
- RLCA
- RLCA
- AND 7
- CP 7 IGNORE TOUCH IF X TOO LARGE
- JP NC,TPCPM JUMPT TO CPMTEST IF X TOO LARGE
- LD C,A
- LD B,0
- ADD A,C SET DE=3*(X COORD DIV 2)
- ADD A,C
- LD E,A
- LD D,B
- LD HL,STATTBL+2 FIND THE FIELD TO CHANGE
- ADD HL,DE
- LD A,(HL) GET NO. OF FIELD VALUES
- LD HL,STATUS
- ADD HL,BC
- INC (HL) INCR SELECTED FIELD VALUE
- SUB (HL)
- JR NZ,STAT.UP1
- LD (HL),A RESET IF OVERFLOW
- STAT.UP1 EQU *
- LD A,C CHECK WHICH FIELD WAS CHANGED
- DEC A
- JR Z,STAT.F1 FIELD 1
- SUB 4
- JR Z,STAT.F5 FIELD 5
- DEC A
- JR NZ,DSTAT NOT FIELD 6
- * UPDATE FIELD 6 (TTY/GRAPH FIELD)
- STAT.F6 EQU *
- LD A,(TGMODE) WHICH MODE
- OR A
- JR NZ,STAT.F6A
- CALL AINIT TIMESHARE MODE INIT
- JR DSTAT
- STAT.F6A EQU *
- CALL AINIT.G GRAPHICS MODE INIT
- JR DSTAT
- * UPDATE FIELD 5 (SCALE FIELD)
- STAT.F5 EQU *
- LD HL,0 UPDATE BIAS IN CASE SCALE FLAG
- LD A,(SCALEFG) WAS CHANGED
- OR A
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- JR NZ,STAT.F5A
- LD HL,122
- STAT.F5A EQU *
- LD (BIAS),HL
- JR DSTAT
- * UPDATE FIELD 1 (BAUD RATE FIELD)
- STAT.F1 EQU *
- LD A,(ASCSPEED) UPDATE (RUNINFO) IN CASE
- LD C,A BAUD RATE WAS CHANGED
- RRCA
- RRCA
- RRCA
- LD B,A
- LD HL,RUNINFO
- LD A,(HL)
- AND 1FH
- OR B
- LD (HL),A
- LD B,0 UPDATE BAUD RATE
- LD HL,BAUDRATE
- ADD HL,BC
- LD A,(HL)
- OUT (ASCRATE),A
- LD HL,ASCPKG+1 POINT TO REG. 4 OUTPUT WORD
- LD A,(HL) ASSUME X64 CLOCK
- OR 0C0H
- LD (HL),A
- LD A,C CHECK RATE VALUE
- CP 7
- JR NZ,STAT.F1A JUMP IF NOT EXT CLK
- LD A,(HL) EXT CLK, SO SET X1 CLOCK
- AND 3FH
- LD (HL),A
- STAT.F1A EQU *
- CALL ASCSETUP OUTPUT PACKAGE TO SIO
- * DISPLAY THE CURRENT VALUES ON THE STATUS LINE
- DSTAT EQU *
- LD A,(MODE) CHECK MODE
- RLCA
- RET C NO DISPLAY IF PLATO OPERATION
- LD A,(STATLINE) SEE IF STATUS LINE IS ON
- OR A
- RET Z JUST EXIT IF NOT
- LD A,(M.ENAB) ENABLE THE TOUCH PANEL
- SET 5,A
- LD L,A
- LD H,04H
- CALL R.SSF
- CALL CUR.ERAS ERASE THE CURSOR
- CALL SAV.OP SAVE CURSOR POSITION
- LD HL,6
- CALL R.OUTX
- LD HL,16
- CALL R.OUTY
- CALL STAT.ERS ERASE STATUS LINE
- LD HL,STATUS
- PUSH HL
- LD C,8 NO. OF FIELDS IN STATUS LINE
- LD HL,STATTBL
- DSTAT1 EQU *
- LD E,(HL) FIND THE CURRENT FIELD INFO
- INC HL
- LD D,(HL) DE=ADDRESS OF MESSAGE
- INC HL
- INC HL
- EX (SP),HL
- LD B,(HL) B=CURRENT FIELD FLAG VALUE
- INC HL
- EX (SP),HL
- INC B
- JR DSTAT3
- DSTAT2 EQU *
- LD A,(DE)
- INC DE
- OR A
- JR NZ,DSTAT2
- DSTAT3 EQU *
- DJNZ DSTAT2
- DSTAT4 EQU *
- PUSH BC NOW DISPLAY THE WORD
- PUSH HL
- CALL DMSG DISPLAY THE FIELD MESSAGE
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- DSTAT6 EQU *
- CALL R.INPX ADVANCE TO THE NEXT FIELD
- DSTAT7 EQU *
- INC HL
- LD A,L
- AND 3FH
- CP 6
- JR NZ,DSTAT7
- CALL R.OUTX
- POP HL
- POP BC
- DEC C
- JR NZ,DSTAT1
- POP HL JUNK STATUS POINTER
- JP RET.OP RESTORE SAVED CURSOR POSITION
- * CALLABLE ROUTINE TO DISPLAY A FIELD MESSAGE.
- * ON ENTRY, DE=FWA OF MESSAGE.
- * (DMAA)=STARTING DISPLAY ADDRESS, (DMA1)=(DMAA)+200H.
- * (DMAA) AND (DMA1) ARE UPDATED FOR EACH CHARACTER DISPLAYED
- DMSG EQU *
- LD A,(DE) GET CHAR
- OR A
- RET Z EXIT IF 0
- LD C,A CHAR TO C
- LD B,1 SET W/E BITS IN B FOR REWRITE
- PUSH DE
- CALL ACHARGEN DISPLAY THE CHAR
- CALL HTAB.1 MOVE TO NEXT COLUMN
- POP DE
- INC DE
- JR DMSG
- * CALLABLE ROUTINE TO SAVE CURSOR POSITION.
- SAV.OP EQU *
- CALL R.INPX
- LD (G.XREG),HL
- CALL R.INPY
- LD (G.YREG),HL
- RET
- * CALLABLE ROUTINE TO RESTORE SAVED CURSOR POSITION.
- RET.OP EQU *
- CALL CUR.ERAS RESTORE DATA AT CURSOR POS.
- LD HL,(G.XREG)
- CALL R.OUTX
- LD HL,(G.YREG)
- JP R.OUTY
- * BAUD RATE TABLE
- BAUDRATE EQU *
- DEFB 00H 75/75
- DEFB 24H 150/150
- DEFB 48H 300/300
- DEFB 6CH 600/600
- DEFB 90H 1200/1200
- DEFB 0B4H 2400/2400
- DEFB 80H 1200/75
- DEFB 0FCH EXT/EXT
- * DATA FOR STATUS LINE FIELDS
- STATTBL EQU *
- DEFW LNLOCMSG
- DEFB 2
- DEFW BAUDMSG
- DEFB 8
- DEFW CAPSMSG
- DEFB 2
- DEFW PARMSG
- DEFB 3
- DEFW DUPMSG
- DEFB 2
- DEFW SCALEMSG
- DEFB 2
- DEFW TGMSG
- DEFB 2
- DEFW PRINTMSG
- DEFB 2
- LNLOCMSG EQU *
- HEX 2C,29,2E,25,00 LINE
- HEX 2C,2F,23,21,2C,00 LOCAL
- BAUDMSG EQU *
- HEX 17,15,00 75
- HEX 11,15,10,00 150
- HEX 13,10,10,00 300
- HEX 16,10,10,00 600
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 11,12,10,10,00 1200
- HEX 12,14,10,10,00 2400
- HEX 11,12,10,10,0F,17,15,00 1200/75
- HEX 25,38,34,0D,23,2C,2B,00 EXT-CLK
- SCALEMSG EQU *
- HEX 33,23,21,2C,25,00 SCALE
- HEX 35,2E,33,23,21,2C,25,00 UNSCALE
- CAPSMSG EQU *
- HEX 23,21,30,33,00 CAPS
- HEX 21,2C,2C,00 ALL
- PARMSG EQU *
- HEX 25,36,25,2E,00 EVEN
- HEX 2F,24,24,00 ODD
- HEX 2E,2F,0D,30,21,32,00 NO-PAR
- DUPMSG EQU *
- HEX 28,21,2C,26,00 HALF
- HEX 26,35,2C,2C,00 FULL
- TGMSG EQU *
- HEX 34,34,39,00 TTY
- HEX 27,32,21,30,28,00 GRAPH
- PRINTMSG EQU *
- HEX 00 BLANK MESSAGE
- HEX 30,32,29,2E,34,00 PRINT
- PAP.MSG EQU *
- HEX 30,21,30,25,32,00 PAPER
- DES.MSG EQU *
- HEX 24,25,33,25,2C,25,23,34,00 DESELECT
- REJ.MSG EQU *
- HEX 32,25,2A,25,23,34,00 REJECT
- ENDB 00 LOAD AND CHECKSUM
- EJECT COMMUNICATIONS PRINT
- * PRINT ALPHANUMERIC DATA FROM COMMUNICATION LINE.
- * ON ENTRY, C CONTAINS ASCII CHARACTER TO PRINT.
- * IF NO PRINTER STATUS PROBLEM, THE CHARACTER IS SENT
- * TO THE PRINTER. IF A STATUS PROBLEM EXISTS, AN
- * ERROR MESSAGE IS DISPLAYED AND COMMUNICATIONS PRINT
- * IS DESELECTED.
- CPRINT EQU *
- LD A,(CPRINTFG) IS COMM PRINT ACTIVE
- OR A
- RET Z JUST EXIT IF NO
- LD DE,CPRINTXT SET ERROR EXIT
- CALL WAITOK WAIT FOR DATA REQUEST
- LD A,C OUTPUT CHARACTER
- OUT (DATAFCN),A
- CPRINTXT EQU *
- RET
- SPACE 4
- * WAIT FOR DATA REQUEST TO RETURN (OK TO SEND).
- * IF ERROR, JUNK RETURN ADDRESS AND JUMP TO
- * ADDRESS IN DE REG.
- *
- * IF NORMAL RETURN IS TAKEN, ONLY THE A-REGISTER
- * IS CHANGED.
- WAITOK IN A,(CNTLFCN) READ PRINTER STATUS
- AND 3FH MASK OUT THE UPPER 2 BITS
- CP 04H CHECK FOR DATA REQUEST
- RET Z RETURN IF OK
- AND 39H
- JR Z,WAITOK LOOP IF NO ERRORS
- POP HL JUNK RETURN ADDRESS
- EX DE,HL TAKE ERROR EXIT (IN DE)
- JP (HL)
- * BLINK PRINT ERROR MESSAGE IF A PRINTER ERROR EXISTS.
- * CALLABLE ENTRY POINT.
- PRBLINK EQU *
- CALL BLINKTST IS IT TIME TO BLINK
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- RET NC JUST EXIT IF NO
- PRBLINK1 EQU *
- LD A,(CPRINTFG) IS COMM PRINT ACTIVE
- OR A
- JR NZ,PRCHECK CHECK STATUS IF YES
- LD A,(PRINTERR) NO, IS PRINT ERROR FLAG SET
- OR A
- RET Z NO, JUST EXIT
- PRCHECK EQU *
- IN A,(CNTLFCN) GET PRINTER STATUS
- AND 39H
- JP Z,RET.MEM RESTORE SAVED MEMORY AND CLEAR
- * PRINT ERROR FLAG(STATUS OK)
- * PRINT ERROR EXISTS, SO BLINK ERROR MESSAGE.
- PUSH AF SAVE STATUS
- CALL SAV.MEM SAVE DATA AT DISPLAY LOCATION
- * IF NOT ALREADY SAVED
- POP AF GET SAVED STATUS
- RRCA
- LD DE,REJ.MSG SET -REJECT- MESSAGE
- JR NC,PRBLINK5 JUMP IF REJECT
- LD A,SECSTAT REQUEST SECONDARY STATUS
- OUT (CNTLFCN),A
- PRBLINK4 EQU *
- IN A,(CNTLFCN) READ BASIC STATUS
- BIT 3,A
- JR Z,PRBLINK4 WAIT FOR DATA AVAILABLE
- IN A,(DATAFCN) READ SECONDARY STATUS
- BIT 1,A
- LD DE,PAP.MSG SET -PAPER- MESSAGE
- JR NZ,PRBLINK5 JUMP IF PAPER FAULT
- LD DE,DES.MSG SET -DESELECT- MESSAGE
- PRBLINK5 EQU *
- LD A,(WEFLAG)
- OR A
- JR Z,DISPLAY SHOW ERROR IF W/E FLAG=ERASE
- * CLEAR THE ERROR MESSAGE AREA.
- * F1F0..F1FF, F3F0..F3FF, .. ,FFF0..FFFF.
- CLEAR EQU *
- LD H,0F1H
- CLEAR1 EQU *
- LD D,H
- LD L,0F0H
- LD E,0F1H
- LD BC,15
- LD (HL),0
- LDIR
- INC H
- INC H
- BIT 7,H
- JR NZ,CLEAR1
- RET
- * DISPLAY ERROR MESSAGE
- DISPLAY EQU *
- PUSH DE TEMP SAVE MESSAGE FWA
- CALL CUR.ERAS ERASE CURSOR
- CALL SAV.OP SAVE X AND Y
- LD HL,454 SET X AND Y FOR MESSAGE
- CALL R.OUTX
- LD HL,2
- CALL R.OUTY
- POP DE GET SAVED MESSAGE FWA
- CALL DMSG DISPLAY THE MESSAGE
- JP RET.OP RESTORE X AND Y
- EJECT
- * SAVE SCREEN MEMORY IF PRINT ERROR FLAG IS CLEAR.
- * SET PRINT ERROR FLAG.
- SAV.MEM EQU *
- LD HL,PRINTERR CHECK PRINT ERROR FLAG
- LD A,(HL)
- OR A
- RET NZ EXIT IF ALREADY SAVED
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD (HL),1 SET PRINT ERROR FLAG
- LD HL,0F1F0H
- LD DE,S.MEM
- S.MEM1 LD BC,10H
- LDIR
- LD BC,1F0H
- ADD HL,BC
- BIT 7,H
- JR NZ,S.MEM1
- RET
- * RESTORE SAVED SCREEN MEMORY IF PRINT ERROR FLAG IS SET.
- * CLEAR PRINT ERROR FLAG.
- RET.MEM EQU *
- LD HL,PRINTERR CHECK PRINT ERROR FLAG
- LD A,(HL)
- OR A
- RET Z EXIT IF NOT SAVED
- LD (HL),0 CLEAR PRINT ERROR FLAG
- LD HL,S.MEM
- LD DE,0F1F0H
- RET.M1 LD BC,10H
- LDIR
- LD BC,1F0H
- EX DE,HL
- ADD HL,BC
- EX DE,HL
- BIT 7,D
- JR NZ,RET.M1
- RET
- * ZERO OUT THE SOLENOID COUNTERS.
- ZEROCNT EQU *
- LD A,80H
- LD (PAUSE),A
- LD HL,SLCNTR
- LD B,24
- XOR A
- G.PRT0 LD (HL),A
- INC HL
- DJNZ G.PRT0
- RET
- * READ PRINTER ID.
- * IF ID=37H (PRINTER PRESENT) THEN EXIT WITH ZERO FLAG SET.
- * OTHERWISE EXIT WITH ZERO FLAG CLEAR.
- CHECKID EQU *
- LD A,READID READ PRINTER ID
- OUT (CNTLFCN),A
- IN A,(DATAFCN)
- CP 37H
- RET
- EJECT PERFORM A SCREEN COPY
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * *@* *
- *
- * PERFORM A SCREEN COPY.
- *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * *@* *
- PRINT EQU *
- LD (SAVESTK),SP SAVE STACK POINTER.
- XOR A CLEAR TURNOFF FLAG.
- LD (TURNOFF),A
- * CHECK IF THE TIMER IS ON IN THE PRINTER. IF SO,
- * THEN THE PREVIOUS SCREEN COPY EXCEEDED THE DUTY
- * CYCLE AND A REDUCED SPEED COPY MUST BE DONE.
- LD A,SECSTAT REQUEST SECONDARY STATUS.
- OUT (CNTLFCN),A
- NOP WAIT A BIT.
- IN A,(DATAFCN) READ SECONDARY STATUS.
- BIT 7,A CHECK TIMER BIT.
- CALL Z,ZEROCNT TIMER OFF, ZERO COUNTERS.
- * PRINT SOME BLANK LINES.
- LD B,10 10 LINE FEEDS.
- LFLOOP EQU *
- PUSH BC
- CALL PR.IDLE
- POP BC
- LD A,C.LF
- OUT (DATAFCN),A
- DJNZ LFLOOP
- * TURN ON GRAPHICS MODE
- GMODE EQU *
- LD HL,BUFFER CLEAR PRINT LINE
- LD (HL),C.ENQ
- INC HL
- LD (HL),40H
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD DE,BUFFER+2 TO ADDRESS
- LD BC,133 NUMBER OF BYTES
- LDIR
- CALL ANROW1 OUTPUT THE LINE
- * INITIALIZE SCREEN COPY COUNTERS.
- LD HL,0200H SET UP NUMBER OF ROWS TO PRINT
- LD (ROWCOUNT),HL
- LD HL,8000H SET UP DISPLAY MEMORY ADDRESS
- LD (ROW),HL
- * COPY THE SCREEN A ROW AT A TIME.
- NEWROW EQU *
- CALL ANROW PRINT A ROW
- LD DE,(ROWCOUNT) UPDATE NO. OF ROWS REMAINING.
- DEC DE
- LD (ROWCOUNT),DE
- LD A,D CHECK IF DONE.
- OR E
- JR Z,GDONE DONE PRINTING SCREEN IMAGE.
- LD A,(TURNOFF) CHECK IF TURNED OFF.
- AND A
- JR NZ,GDONE
- LD HL,(ROW) UPDATE SCREEN ADDRESS TO USED.
- INC HL
- LD (ROW),HL
- JR NEWROW GO PRINT THE NEXT ROW.
- *
- * DONE WITH THE PRINT. PRINT A BLANK ROW,
- * DO A FORM FEED AND EXIT.
- *
- GDONE EQU *
- CALL PR.IDLE
- LD A,C.LF
- OUT (DATAFCN),A
- CALL PR.IDLE
- LD A,C.FF
- OUT (DATAFCN),A
- * CHECK TO SEE IF DUTY CYCLE EXCEEDED. IF SO,
- * TURN ON THE TIMER SO THAT A RECENT NEXT SCREEN
- * COPY WILL BE START AT HALF SPEED.
- GDONE1 EQU *
- LD A,(PAUSE)
- AND A CHECK IF OVER DUTY CYCLE (>0)
- RET M NOT OVER DUTY CYCLE, EXIT.
- LD A,STIMER START TIMER UP.
- OUT (CNTLFCN),A
- RET
- ENDB 00 LOAD AND CHECKSUM
- EJECT IDLE LOOP WHILE PRINTING A SCREEN
- *
- * CHECK COMM LINE AND KEYBOARD WHILE IN THE PROCCESS
- * OF PRINTING A SCREEN.
- *
- PR.IDLE EQU *
- IN A,(CNTLFCN)
- LD D,A SAVE STATUS FOR STATERR.
- AND 3FH
- CP 04H
- RET Z
- AND 39H
- JP NZ,STATERR
- LD A,(MODE) CHECK PLATO/ASCII OPERATION
- RLCA
- CALL C,R.EXEC PROCESS PLATO JOBS.
- * DO NOT PROCESS JOBS IN GRAPHIC
- * OPERATION WHILE SCREEN COPY IS
- * ACTIVE, SO GIN XMIT WILL WAIT
- * UNTIL SCREEN COPY IS DONE.
- JR PR.IDLE
- * DELAY FOR ABOUT 10 MILLISECONDS IF (PAUSE) IS NON-
- * ZERO. USED TO MISS A PRINT CYCLE SO THAT THE DUTY
- * CYCLE IS NOT EXCEEDED.
- DELAY EQU *
- LD A,(PAUSE)
- AND A
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- RET M
- LD HL,12000 ABOUT 60 MS
- DLOOP EQU *
- DEC HL
- LD A,H
- OR L
- JR NZ,DLOOP
- RET
- EJECT PRINT A ROW OF DOTS.
- * PRINT A ROW OF THE SCREEN.
- * ON ENTRY, HL=START SCREEN MEMORY LOCATION.
- ANROW LD B,40H ONE ROW OF MEMORY ADDRESS
- LD HL,(ROW) GET CURRENT MEMORY ADDRESS.
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- * PRINT A SINGLE ROW.
- * FIRST CHECK IF ALL DOTS ARE 0 IN THIS ROW OR NOT.
- ALOOP LD A,(HL)
- OR A
- JP NZ,ARETURN DATA NOT ALL ZERO
- INC H
- INC H
- DJNZ ALOOP
- *
- * PRINT A NULL ROW SINCE ALL DOTS ARE 0.
- CALL PR.IDLE
- LD A,05H
- OUT (DATAFCN),A
- CALL WAITOK
- LD A,C.LF
- OUT (DATAFCN),A
- RET
- * NON ZERO DOTS EXIST IN THIS ROW.
- * LOOP THRU THE LINE 21 TIMES, PACKING 3 BYTES INTO
- * 4 PRINTER OUTPUT CHARACTERS EACH LOOP. THEN
- * PICK UP THE RAMAINING BYTE FROM THIS ROW OF THE
- * SCREEN.
- ARETURN LD HL,(ROW)
- LD DE,BUF1 START DATA AREA OF ROW.
- LD B,21 SET LOOP COUNTER TO 21
- LOOP1 LD A,(HL)
- LD C,A
- AND 3FH LOWER 6 BITS
- OR 40H ADD BIT 7 FOR GRAPHIC DATA
- LD (DE),A STORE THE 1ST 6 BITS IN BUFFER
- INC H THE 2ND DISPL MEMORY IS 8200
- INC H
- INC DE
- LD A,C
- AND 0C0H
- LD C,A
- LD A,(HL)
- AND 0FH
- OR C
- LD C,(HL)
- RLCA
- RLCA
- OR 40H
- LD (DE),A
- INC H
- INC H
- INC DE
- LD A,C
- AND 0F0H
- LD C,A
- LD A,(HL)
- AND 03H
- OR C
- LD C,(HL)
- RLCA
- RLCA
- RLCA
- RLCA
- OR 40H
- LD (DE),A
- INC DE
- LD A,C
- AND 0FCH
- RRCA
- RRCA
- OR 40H
- LD (DE),A
- INC DE
- INC H
- INC H
- DJNZ LOOP1
- * PICK UP THE LAST BYTE OF THE SCREEN ROW.
- LD A,(HL)
- LD C,A
- AND 3FH
- OR 40H
- LD (DE),A
- INC DE
- LD A,C
- AND 0C0H
- RLCA
- RLCA
- OR 40H
- LD (DE),A
- * CALCULATE TOTAL DOTS FOR EACH SOLENOID, STORING
- * THE TOTAL IN (SLCNTR). THEN CHECK FOR DUTY CYCLE
- * EXCEEDED.
- LD A,255
- LD (PAUSE),A FLAG DUTY CYCLE NOT EXCEEDED.
- LD A,12 512 DOTS FOR 12 SOLENOIDS
- LD (KEEPER),A
- LD DE,BUF1
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- LD HL,SLCNTR CNTR ADDRESS OF FIRST SOLENOID
- LOP0 LD B,7 7X6=42 DOTS PER SOLENOID
- LOP1 LD A,(DE)
- LD C,6
- LOP2 RRCA
- JR NC,LOP2A
- INC (HL)
- JR NZ,LOP2A
- INC HL
- INC (HL)
- DEC HL
- LOP2A DEC C
- JR NZ,LOP2
- INC DE
- DJNZ LOP1
- INC HL
- LD A,(HL) GET UPPER BYTE OF COUNT.
- CP 10 IS DUTY CYCLE EXCEEDED
- JR C,LOPNE NOT EXCEEDED.
- XOR A
- LD (PAUSE),A FLAG EXCEEDED.
- LOPNE EQU *
- INC HL
- LD A,(KEEPER)
- DEC A
- LD (KEEPER),A
- JR NZ,LOP0
- * AT THIS POINT, (PAUSE) IS 255 IF NO DUTY CYCLE
- * PROBLEM, 0 IF EXCEEDED.
- *
- * SUBTRACT OFF A ROW FROM THE SOLENIOD AVERAGE TO
- * PRODUCE 128 ROW RUNNING AVERAGE.
- *
- DCOUT1 EQU *
- LD A,(PAUSE) GET DUTY CYCLE FLAG.
- LD B,12 NUMBER OF SOLENOIDS TO CHECK.
- LD HL,SLCNTR
- DCLP2 EQU *
- PUSH HL
- LD E,(HL) GET CURRENT SOLENOID COUNTER.
- INC HL
- LD D,(HL)
- LD H,D
- LD L,E
- ADD HL,HL DOUBLE TO GET COUNT/128 IN H.
- LD L,H PICK OFF COUNT/128.
- LD H,0
- EX DE,HL
- SBC HL,DE
- EX DE,HL
- POP HL GET SLCNTR POINTER BACK.
- LD (HL),E STORE UPDATED COUNTER.
- INC HL
- LD (HL),D
- INC HL
- DJNZ DCLP2
- *
- * SEND A ROW OF DOTS TO THE PRINTER.
- ANROW1 EQU *
- CALL PR.IDLE PROCESS CPU UNTIL READY.
- CALL DELAY DELAY IF NEEDED.
- LD A,C.LF PLANT LINE FEED AT END OF BUF.
- LD (BUF2),A
- LD C,DATAFCN
- LD B,94
- LD HL,BUFFER
- LD DE,STATERR ERROR EXIT
- OUTLP CALL WAITOK
- OUTI
- JR NZ,OUTLP
- RET
- EJECT STATUS ERROR ROUTINE
- * FLAG STATUS ERROR AND WAIT FOR STATUS TO BE
- * CORRECTED OR FOR STOP OR SHIFT-STOP TO BE PRESSED
- * ON THE KEYBOARD.
- STATERR EQU *
- LD A,01H SOUND ALARM
- OUT (MISCFCN),A
- CALL SAV.MEM SAVE DISPLAY MEMORY AND SET
- * PRINT ERROR FLAG
- STATERR1 EQU *
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- CALL R.EXEC EXECUTE COMM LINE DATA
- CALL PRBLINK BLINK PRINT ERROR MESSAGE
- LD A,(PRINTERR) HAS ERROR BEEN CORRECTED
- OR A
- JR Z,STATERR2 JUMP IF YES
- LD A,(TURNOFF) HAS STOP OR SH-STOP BEEN
- OR A PUSHED
- JR Z,STATERR1 LOOP IF NO
- STATERR2 EQU *
- CALL RET.MEM RESTORE SAVED MEMORY AND CLEAR
- * PRINT ERROR FLAG
- LD SP,(SAVESTK) GET SAVED STACK POINTER.
- RET RETURN TO IDLE
- ENDB 00 LOAD AND CHECKSUM
- EJECT
- * SMALL SIZE 6 BY 14 CHARACTERS
- *
- A0CODE00 EQU * SPACE
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00
- A0CODE01 EQU * EXCLAMATION MARK
- HEX 00,00,04,04
- HEX 04,04,04,04
- HEX 00,00,04,00
- HEX 00,00
- A0CODE02 EQU * DOUBLE QUOTES
- HEX 00,00,0A,0A
- HEX 0A,00,00,00
- HEX 00,00,00,00
- HEX 00,00
- A0CODE03 EQU * NUMBER SIGN
- HEX 00,00,0A,0A
- HEX 1F,0A,1F,0A
- HEX 0A,00,00,00
- HEX 00,00
- A0CODE04 EQU * DOLLAR SIGN
- HEX 00,00,04,0E
- HEX 15,05,0E,14
- HEX 15,0E,04,00
- HEX 00,00
- A0CODE05 EQU * PERCENT SIGN
- HEX 00,00,00,00
- HEX 03,13,08,04
- HEX 02,19,18,00
- HEX 00,00
- A0CODE06 EQU * AMPERSAND
- HEX 00,00,04,0A
- HEX 0A,04,16,09
- HEX 09,09,16,00
- HEX 00,00
- A0CODE07 EQU * SINGLE QUOTE
- HEX 00,00,08,04
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00
- A0CODE08 EQU * LEFT PAREN
- HEX 00,00,10,08
- HEX 04,04,04,04
- HEX 04,04,08,10
- HEX 00,00
- A0CODE09 EQU * RIGHT PAREN
- HEX 00,00,01,02
- HEX 04,04,04,04
- HEX 04,04,02,01
- HEX 00,00
- A0CODE0A EQU * ASTERISK
- HEX 00,00,00,00
- HEX 04,15,0A,0A
- HEX 15,04,00,00
- HEX 00,00
- A0CODE0B EQU * PLUS
- HEX 00,00,00,00
- HEX 00,04,04,1F
- HEX 04,04,00,00
- HEX 00,00
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- A0CODE0C EQU * COMMA
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,06,06,04
- HEX 02,00
- A0CODE0D EQU * MINUS
- HEX 00,00,00,00
- HEX 00,00,00,1F
- HEX 00,00,00,00
- HEX 00,00
- A0CODE0E EQU * PERIOD
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,06,06,00
- HEX 00,00
- A0CODE0F EQU * SLASH
- HEX 00,00,00,00
- HEX 00,10,08,04
- HEX 02,01,00,00
- HEX 00,00
- A0CODE10 EQU * NUMERAL ZERO
- HEX 00,00,00,0E
- HEX 11,11,19,15
- HEX 13,11,0E,00
- HEX 00,00
- A0CODE11 EQU * NUMERAL ONE
- HEX 00,00,00,04
- HEX 06,04,04,04
- HEX 04,04,0E,00
- HEX 00,00
- A0CODE12 EQU * NUMERAL TWO
- HEX 00,00,00,0E
- HEX 11,10,08,04
- HEX 02,01,1F,00
- HEX 00,00
- A0CODE13 EQU * NUMERAL THREE
- HEX 00,00,00,0E
- HEX 11,10,0C,10
- HEX 10,11,0E,00
- HEX 00,00
- A0CODE14 EQU * NUMERAL FOUR
- HEX 00,00,00,10
- HEX 18,14,12,1F
- HEX 10,10,10,00
- HEX 00,00
- A0CODE15 EQU * NUMERAL FIVE
- HEX 00,00,00,1F
- HEX 01,01,0F,10
- HEX 10,10,0F,00
- HEX 00,00
- A0CODE16 EQU * NUMERAL SIX
- HEX 00,00,00,0C
- HEX 02,01,0F,11
- HEX 11,11,0E,00
- HEX 00,00
- A0CODE17 EQU * NUMERAL SEVEN
- HEX 00,00,00,1F
- HEX 10,08,08,04
- HEX 04,02,02,00
- HEX 00,00
- A0CODE18 EQU * NUMERAL EIGHT
- HEX 00,00,00,0E
- HEX 11,11,0E,11
- HEX 11,11,0E,00
- HEX 00,00
- A0CODE19 EQU * NUMERAL NINE
- HEX 00,00,00,0E
- HEX 11,11,11,1E
- HEX 10,08,06,00
- HEX 00,00
- A0CODE1A EQU * COLON
- HEX 00,00,00,00
- HEX 00,06,06,00
- HEX 00,06,06,00
- HEX 00,00
- A0CODE1B EQU * SEMICOLON
- HEX 00,00,00,00
- HEX 00,06,06,00
- HEX 00,06,06,02
- HEX 01,00
- A0CODE1C EQU * LESS THAN
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- HEX 00,00,00,00
- HEX 08,04,02,01
- HEX 02,04,08,00
- HEX 00,00
- A0CODE1D EQU * EQUALS
- HEX 00,00,00,00
- HEX 00,00,1F,00
- HEX 1F,00,00,00
- HEX 00,00
- A0CODE1E EQU * GREATER THAN
- HEX 00,00,00,00
- HEX 02,04,08,10
- HEX 08,04,02,00
- HEX 00,00
- A0CODE1F EQU * QUESTION MARK
- HEX 00,00,0E,11
- HEX 11,08,04,04
- HEX 04,00,04,00
- HEX 00,00
- A0CODE20 EQU * COMMERCIAL AT
- HEX 00,00,00,00
- HEX 00,0E,11,1D
- HEX 1D,09,02,1C
- HEX 00,00
- A0CODE21 EQU * UPPER CASE A
- HEX 00,00,04,0A
- HEX 11,11,1F,11
- HEX 11,11,11,00
- HEX 00,00
- A0CODE22 EQU * UPPER CASE B
- HEX 00,00,0F,11
- HEX 11,0F,11,11
- HEX 11,11,0F,00
- HEX 00,00
- A0CODE23 EQU * UPPER CASE C
- HEX 00,00,0E,11
- HEX 01,01,01,01
- HEX 01,11,0E,00
- HEX 00,00
- A0CODE24 EQU * UPPER CASE D
- HEX 00,00,07,09
- HEX 11,11,11,11
- HEX 11,09,07,00
- HEX 00,00
- A0CODE25 EQU * UPPER CASE E
- HEX 00,00,1F,01
- HEX 01,01,0F,01
- HEX 01,01,1F,00
- HEX 00,00
- A0CODE26 EQU * UPPER CASE F
- HEX 00,00,1F,01
- HEX 01,01,0F,01
- HEX 01,01,01,00
- HEX 00,00
- A0CODE27 EQU * UPPER CASE G
- HEX 00,00,0E,11
- HEX 11,01,01,1D
- HEX 11,11,0E,00
- HEX 00,00
- A0CODE28 EQU * UPPER CASE H
- HEX 00,00,11,11
- HEX 11,11,1F,11
- HEX 11,11,11,00
- HEX 00,00
- A0CODE29 EQU * UPPER CASE I
- HEX 00,00,1F,04
- HEX 04,04,04,04
- HEX 04,04,1F,00
- HEX 00,00
- A0CODE2A EQU * UPPER CASE J
- HEX 00,00,1C,08
- HEX 08,08,08,08
- HEX 08,09,06,00
- HEX 00,00
- A0CODE2B EQU * UPPER CASE K
- HEX 00,00,11,11
- HEX 09,05,03,03
- HEX 05,09,11,00
- HEX 00,00
- ENDB 00 LOAD AND CHECKSUM
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- A0CODE2C EQU * UPPER CASE L
- HEX 00,00,01,01
- HEX 01,01,01,01
- HEX 01,01,1F,00
- HEX 00,00
- A0CODE2D EQU * UPPER CASE M
- HEX 00,00,11,1B
- HEX 15,11,11,11
- HEX 11,11,11,00
- HEX 00,00
- A0CODE2E EQU * UPPER CASE N
- HEX 00,00,11,13
- HEX 13,15,15,19
- HEX 19,19,11,00
- HEX 00,00
- A0CODE2F EQU * UPPER CASE O
- HEX 00,00,0E,11
- HEX 11,11,11,11
- HEX 11,11,0E,00
- HEX 00,00
- A0CODE30 EQU * UPPER CASE P
- HEX 00,00,0F,11
- HEX 11,11,0F,01
- HEX 01,01,01,00
- HEX 00,00
- A0CODE31 EQU * UPPER CASE Q
- HEX 00,00,0E,11
- HEX 11,11,11,11
- HEX 11,11,0E,08
- HEX 10,00
- A0CODE32 EQU * UPPER CASE R
- HEX 00,00,0F,11
- HEX 11,11,0F,03
- HEX 05,09,11,00
- HEX 00,00
- A0CODE33 EQU * UPPER CASE S
- HEX 00,00,0E,11
- HEX 01,01,0E,10
- HEX 10,11,0E,00
- HEX 00,00
- A0CODE34 EQU * UPPER CASE T
- HEX 00,00,1F,04
- HEX 04,04,04,04
- HEX 04,04,04,00
- HEX 00,00
- A0CODE35 EQU * UPPER CASE U
- HEX 00,00,11,11
- HEX 11,11,11,11
- HEX 11,11,0E,00
- HEX 00,00
- A0CODE36 EQU * UPPER CASE V
- HEX 00,00,11,11
- HEX 11,11,0A,0A
- HEX 0A,04,04,00
- HEX 00,00
- A0CODE37 EQU * UPPER CASE W
- HEX 00,00,11,11
- HEX 11,11,11,11
- HEX 15,1B,11,00
- HEX 00,00
- A0CODE38 EQU * UPPER CASE X
- HEX 00,00,11,11
- HEX 0A,04,04,0A
- HEX 0A,11,11,00
- HEX 00,00
- A0CODE39 EQU * UPPER CASE Y
- HEX 00,00,11,11
- HEX 11,0E,04,04
- HEX 04,04,04,00
- HEX 00,00
- A0CODE3A EQU * UPPER CASE Z
- HEX 00,00,1F,11
- HEX 10,08,04,02
- HEX 01,11,1F,00
- HEX 00,00
- A0CODE3B EQU * LEFT BRACKET
- HEX 00,00,1C,04
- HEX 04,04,04,04
- HEX 04,04,04,1C
- HEX 00,00
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- A0CODE3C EQU * REVERSE SLASH
- HEX 00,00,00,00
- HEX 00,01,02,04
- HEX 08,10,00,00
- HEX 00,00
- A0CODE3D EQU * RIGHT BRACKET
- HEX 00,00,07,04
- HEX 04,04,04,04
- HEX 04,04,04,07
- HEX 00,00
- A0CODE3E EQU * HAT
- HEX 00,00,00,04
- HEX 0A,11,00,00
- HEX 00,00,00,00
- HEX 00,00
- A0CODE3F EQU * UNDERLINE
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 1F,00
- A0CODE40 EQU * SMALL REVERSE SLASH
- HEX 00,00,04,08
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00
- A0CODE41 EQU * LOWER CASE A
- HEX 00,00,00,00
- HEX 00,0E,10,1E
- HEX 11,11,1E,00
- HEX 00,00
- A0CODE42 EQU * LOWER CASE B
- HEX 00,00,01,01
- HEX 01,0D,13,11
- HEX 11,13,0D,00
- HEX 00,00
- A0CODE43 EQU * LOWER CASE C
- HEX 00,00,00,00
- HEX 00,0E,11,01
- HEX 01,11,0E,00
- HEX 00,00
- A0CODE44 EQU * LOWER CASE D
- HEX 00,00,10,10
- HEX 10,1E,11,11
- HEX 11,11,1E,00
- HEX 00,00
- A0CODE45 EQU * LOWER CASE E
- HEX 00,00,00,00
- HEX 00,0E,11,1F
- HEX 01,01,1E,00
- HEX 00,00
- A0CODE46 EQU * LOWER CASE F
- HEX 00,00,0C,12
- HEX 02,07,02,02
- HEX 02,02,07,00
- HEX 00,00
- A0CODE47 EQU * LOWER CASE G
- HEX 00,00,00,00
- HEX 10,0E,11,11
- HEX 0E,01,0E,11
- HEX 0E,00
- A0CODE48 EQU * LOWER CASE H
- HEX 00,00,01,01
- HEX 01,0D,13,11
- HEX 11,11,11,00
- HEX 00,00
- A0CODE49 EQU * LOWER CASE I
- HEX 00,00,04,00
- HEX 00,06,04,04
- HEX 04,04,0E,00
- HEX 00,00
- A0CODE4A EQU * LOWER CASE J
- HEX 00,00,04,00
- HEX 00,06,04,04
- HEX 04,04,04,04
- HEX 03,00
- A0CODE4B EQU * LOWER CASE K
- HEX 00,00,01,01
- HEX 01,11,09,07
- HEX 05,09,11,00
- HEX 00,00
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- A0CODE4C EQU * LOWER CASE L
- HEX 00,00,06,04
- HEX 04,04,04,04
- HEX 04,04,0E,00
- HEX 00,00
- A0CODE4D EQU * LOWER CASE M
- HEX 00,00,00,00
- HEX 00,1B,15,15
- HEX 15,15,15,00
- HEX 00,00
- A0CODE4E EQU * LOWER CASE N
- HEX 00,00,00,00
- HEX 00,0D,13,11
- HEX 11,11,11,00
- HEX 00,00
- A0CODE4F EQU * LOWER CASE O
- HEX 00,00,00,00
- HEX 00,0E,11,11
- HEX 11,11,0E,00
- HEX 00,00
- A0CODE50 EQU * LOWER CASE P
- HEX 00,00,00,00
- HEX 00,0F,11,11
- HEX 11,11,0F,01
- HEX 01,01
- A0CODE51 EQU * LOWER CASE Q
- HEX 00,00,00,00
- HEX 00,1E,11,11
- HEX 11,11,1E,10
- HEX 10,10
- A0CODE52 EQU * LOWER CASE R
- HEX 00,00,00,00
- HEX 00,0D,13,01
- HEX 01,01,01,00
- HEX 00,00
- A0CODE53 EQU * LOWER CASE S
- HEX 00,00,00,00
- HEX 00,1E,01,0E
- HEX 10,11,0E,00
- HEX 00,00
- A0CODE54 EQU * LOWER CASE T
- HEX 00,00,04,04
- HEX 04,1F,04,04
- HEX 04,04,18,00
- HEX 00,00
- A0CODE55 EQU * LOWER CASE U
- HEX 00,00,00,00
- HEX 00,11,11,11
- HEX 11,11,0E,00
- HEX 00,00
- A0CODE56 EQU * LOWER CASE V
- HEX 00,00,00,00
- HEX 00,11,11,0A
- HEX 0A,04,04,00
- HEX 00,00
- A0CODE57 EQU * LOWER CASE W
- HEX 00,00,00,00
- HEX 00,11,11,11
- HEX 15,15,0A,00
- HEX 00,00
- A0CODE58 EQU * LOWER CASE X
- HEX 00,00,00,00
- HEX 00,11,0A,04
- HEX 04,0A,11,00
- HEX 00,00
- A0CODE59 EQU * LOWER CASE Y
- HEX 00,00,00,00
- HEX 00,11,11,11
- HEX 12,0C,08,04
- HEX 02,01
- A0CODE5A EQU * LOWER CASE Z
- HEX 00,00,00,00
- HEX 00,1F,11,08
- HEX 04,12,1F,00
- HEX 00,00
- A0CODE5B EQU * LEFT BRACE
- HEX 00,00,18,04
- HEX 04,04,04,02
- HEX 04,04,04,04
- HEX 18,00
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- A0CODE5C EQU * ELONGATED COLON
- HEX 00,00,06,06
- HEX 06,06,00,06
- HEX 06,06,06,00
- HEX 00,00
- A0CODE5D EQU * RIGHT BRACE
- HEX 00,00,03,04
- HEX 04,04,04,08
- HEX 04,04,04,04
- HEX 03,00
- A0CODE5E EQU * APPROXIMATE
- HEX 00,00,12,0D
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00
- A0CODE5F EQU * RUBOUT
- HEX 00,00,00,1F
- HEX 1F,1F,1F,1F
- HEX 1F,1F,00,00
- HEX 00,00
- A0CODE60 EQU * UNDERLINE CURSOR
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,3F
- A0CODE61 EQU * CROSSHAIR CURSOR
- HEX 00,00,00,00
- HEX 00,00,00,00
- HEX 00,04,04,1F
- HEX 04,04
- EJECT CONTROLWARE VARIABLES AND BUFFERS.
- ****************************************
- * CONTROLWARE VARIABLES *
- ****************************************
- STRAP DEFB 04H GRAPHICS MODE STRAP OPTIONS
- * BIT 0 = CR/LF
- * BIT 1 = LF/CR
- * BIT 2 = GIN XMIT CR
- * BIT 3 = GIN XMIT EOT
- * THE ABOVE VARIABLE IS PRESET AND IS NOT CHANGED.
- * THE FOLLOWING FOUR BYTES ARE USED AS AN END FLAG
- * FOR THE DISK LOADER, AND MUST ALWAYS BE THE LAST
- * FOUR BYTES OF THE BINARY LOAD FILE.
- HEX 45,4E,44,46
- LENGTH3 EQU *-FWA3 LENGTH OF THIRD CHECKSUM AREA
- ENDB 00 LOAD AND CHECKSUM
- * * * * *
- *
- * SERIAL INTERFACE INITIALIZATION TABLE
- *
- * * * * *
- SERINIT EQU * SERIAL INITIALIZATION TABLE
- DEFB 00H SELECT CMD REGISTER
- DEFB 04H SELECT T/R COMMAND REG
- DEFB 44H "16 CLOCK, 1 STOP BYTE, NO PARTITY
- DEFB 05H SELECT XMIT COMMAND REGISTER
- DEFB 0EAH 8 BITS/CHAR, EN XMIT/RTS
- DEFB 03H SELECT CRC COMMAND REG
- DEFB 0C1H 8 BITS/CHAR, EN RCVR
- DEFB 10H SELECT REGISTER 0
- BEGVAR2 EQU * START OF SECOND VARIABLE AREA
- BLOCKX EQU BEGVAR2 BEGINNING X COORD. FOR MODE 4
- BLOCKY EQU BLOCKX+2 BEGINNING Y COORD. FOR MODE
- XEND EQU BLOCKY+2 ENDING X COORD. FOR MODES 1,4
- YEND EQU XEND+2 ENDING Y COORD. FOR MODES 1,4
- SAVEL EQU YEND+2 FOR BLOCK MODE
- SAVER EQU SAVEL+2 FOR BLOCK MODE
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- * THE ABOVE FLAGS MUST BE IN THIS ORDER FOR BLOCK MODE.
- BIAS EQU SAVER+2 Y COORD BIAS FOR GRAPHICS MODE
- BLINKCTR EQU BIAS+2 CURSOR BLINK COUNTER
- BP EQU BLINKCTR+1 X COORDINATE BIT POSITION
- BS.ERASE EQU BP+1 BACKSPACE ERASE FLAG
- * 00=BKSP W/O ERASE
- * 01=BKSP WITH ERASE
- BYPASS EQU BS.ERASE+1 BYPASS FLAG (00=OFF, 01=ON)
- CG.ADR EQU BYPASS+1 CHARACTER GENERATOR ADDRESS
- CHBASE EQU CG.ADR+2 ASCII CHAR GEN ADDRESS
- CHFWA EQU CHBASE+2 CHARACTER DATA FWA
- CKSUM EQU CHFWA+2 IDLE RAM CHECKSUM
- CKSUMADD EQU CKSUM+1 CURRENT CHECKSUM ADDRESS
- CKSUMTAD EQU CKSUMADD+2 CURRENT CHECKSUM TABLE ADDRESS
- CKSUMWC EQU CKSUMTAD+2 CURRENT CHECKSUM WORD COUNT
- CKSMFG EQU CKSUMWC+2 STORE OR TEST CHECKSUM FLAG
- CMODE EQU CKSMFG+1 COMMAND MODE
- * 00=OFF, 02=LDC, 04=SSF,
- * 06=LDE, 08=LDA, 0A=EXT
- CONFLG EQU CMODE+1 DATA CHARACTER CONVERT FLAG
- * 00=NO CONVERT, 01=CONVERT
- CTLADR EQU CONFLG+1 CONTROL CODE TABLE ADDRESS
- CURSAVED EQU CTLADR+2 CURSOR DATA SAVED FLAG
- * 00=NOT SAVED, 01=SAVED
- DARK EQU CURSAVED+1 DARK VECTOR FLAG
- * 00=NORMAL WRITE, NONZERO=DARK
- DASH EQU DARK+1 DASH/SOLID VECTOR FLAG
- * 00=SOLID, NONZERO=DASH
- DMAA EQU DASH+1 DISPLAY MEMORY ADDRESS
- DMA1 EQU DMAA+2 DISPLAY MEMORY ADDRESS + 200H
- DMA2 EQU DMA1+2 DISPLAY MEMORY ADDRESS + 400H
- DOTS EQU DMA2+2 DOT MOVEMENT FOR GIN MODE
- E.CNTR EQU DOTS+2 ERROR PROTOCOL CHAR COUNTER
- ECLOCK EQU E.CNTR+1 ERROR PROTOCOL TIMER
- EREG EQU ECLOCK+2 ERROR PROTOCOL STATE
- * 01=STATE 0 (NON ERROR CONTROL)
- * 02=STATE 1 (ERROR CONTROL)
- * 04=STATE 2 (ABORT)
- * BIT 7 = TEMP SAVE FOR CARRY
- * BIT 6 = ACK FLAG
- ESEGLEN EQU EREG+1 ERASE SEGMENT LENGTH COUNT
- ESCADR EQU ESEGLEN+1 ESC SEQUENCE TABLE ADDRESS
- EXT.IN EQU ESCADR+2 EXTERNAL INPUT DEVICE ADDRESS
- EXT.OUT EQU EXT.IN+1 EXTERNAL OUTPUT DEVICE ADDRESS
- G.ESC EQU EXT.OUT+1 ESCAPE FLAG (00=CLEAR, 01=SET)
- G.MEMSEL EQU G.ESC+1 ADDRESS OF ASCII CHAR TABLE
- G.SIZE EQU G.MEMSEL+2 ASCII CHARACTER SIZE FLAG
- * 00=ASCII SIZE, 01=PLATO SIZE
- G.SUPCUR EQU G.SIZE+1 CURSOR SUPPRESS FLAG
- * 00=NOT SUPPRESS, 01=SUPPRESS
- G.XREG EQU G.SUPCUR+1 TEMP SAVE FOR X COORDINATE
- G.YREG EQU G.XREG+2 TEMP SAVE FOR Y COORDINATE
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- GIN.KEY EQU G.YREG+2 LAST GIN CHARACTER KEY
- HEIGHT EQU GIN.KEY+1 CHARACTER MATRIX HEIGHT (DOTS)
- CGPARM EQU HEIGHT+2 CHARACTER GENERATION PARMS
- HIX EQU CGPARM+4 COORDINATE HI X BYTE
- HIY EQU HIX+2 COORDINATE HIGH Y BYTE
- KBAADR EQU HIY+2 KB TO ASCII CONVERT TABLE ADDR
- LINEND EQU KBAADR+2 ENDING X COORD (6X84)
- LMASK EQU LINEND+2 BLOCK MODE LEFT MASK
- LOX EQU LMASK+1 COORDINATE LOW X BYTE
- LOY EQU LOX+1 COORDINATE LOW Y BYTE
- MEMREG EQU LOY+1 MODE 2 MEMORY ADDRESS
- MEMSEL EQU MEMREG+2 CHARACTER MEMORY SELECT ADDR.
- MMASK EQU MEMSEL+2 BLOCK MODE MIDDLE MASK
- MODE4CNT EQU MMASK+1 DATA WORD COUNT FOR BLOCK MODE
- MREG EQU MODE4CNT+1 ERROR PROTOCOL REGISTER
- NBYTES EQU MREG+1 GET3 ROUTINE BYTE COUNT
- NCHARS EQU NBYTES+1 CHARACTER CONVERSION COUNT
- NDATAB EQU NCHARS+1 DATA WORD COUNT FOR MODE 2
- NREG EQU NDATAB+1 ERROR PROTOCOL REGISTER
- PAGEND EQU NREG+1 ENDING Y COORD (512-14X34)
- PRINTERR EQU PAGEND+2 PRINT ERROR FLAG
- * 00=NO ERROR, 01=ERROR
- RMASK EQU PRINTERR+1 BLOCK MODE RIGHT MASK
- SCOPYFLG EQU RMASK+1 SCREEN COPY ACTIVE FLAG
- * 00=OFF, 01=ON
- SIZE EQU SCOPYFLG+1 CHARACTER SIZE
- STATLINE EQU SIZE+2 STATUS LINE ACTIVE FLAG
- * 00 = NOT ACTIVE, 20H = ACTIVE
- TSTAT EQU STATLINE+1 GRAPH MODE TERMINAL STATUS WD
- TXBUSY EQU TSTAT+1 TRANSMIT BUSY FLAG
- * 00=NOT BUSY, 01=BUSY
- USERFLG EQU TXBUSY+1 USER PROGRAM RUNNING FLAG
- * 00=NO, 01=YES
- VDMA1 EQU USERFLG+1 DMAA-200H FOR VERTICAL CHARS
- VDMA2 EQU VDMA1+2 DMAA-400H FOR VERTICAL CHARS
- VECFLG EQU VDMA2+2 VECTOR PARAMETER FLAG
- WEFLAG EQU VECFLG+1 CURSOR WRITE/ERASE FLAG
- * 00=WRITE, 20H=ERASE
- WIDTH EQU WEFLAG+1 CHARACTER MATRIX WIDTH (DOTS)
- WSEGLEN EQU WIDTH+2 WRITE SEGMENT LENGTH
- XCOMMSW EQU WSEGLEN+1 OLD VALUE OF COMM SWITCHES
- XDELTA EQU XCOMMSW+1 X COORDINATE DELTA
- XREG EQU XDELTA+2 CURRENT 9 BIT X COORDINATE
- YDELTA EQU XREG+2 Y COORDINATE DELTA
- YREG EQU YDELTA+2 CURRENT 9 BIT Y COORDINATE
- ESCCOM EQU YREG+2 ESCAPE COMMAND (CURSOR ADDRESSING)
- TPSTATE EQU ESCCOM+1 TOUCH PANEL STATE BEFORE DISPLAY LINE ADDED
- * 00 = NOT ACTIVE 20H = ACTIVE
- ESCDATF EQU TPSTATE+1 ESCAPE DATA FLAG
- * (0=NONE 1=ONE DATA BYTE)
- ESCDAT1 EQU ESCDATF+1
- ESCDAT2 EQU ESCDAT1+1 ESCAPE DATA
- * THE FOLLOWING VARIABLES ARE USED BY THE STATUS LINE
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- * AND MUST BE IN THE ORDER SHOWN.
- STATUS EQU ESCDAT2+1
- LOC.RMT EQU STATUS LOCAL/REMOTE FLAG
- * 00=ON LINE, 01=LOCAL
- ASCSPEED EQU STATUS+1 ASCII BAUD RATE SELECTED
- * 00=75, 01=150, 02=300,
- * 03=600, 04=1200, 05=2400,
- * 06=1200/75, 07=EXT CLK
- G.TTYFLG EQU STATUS+2 TTY CAPS LOCK FLAG
- * 00=CAPS, 01=ALL
- PARITY EQU STATUS+3 PARITY MODE FLAG
- * 00=EVEN, 01=ODD, 02=NONE
- DUPLEXFG EQU STATUS+4 FULL/HALF DUPLEX FLAG
- * 00=HALF, 01=FULL
- SCALEFG EQU STATUS+5 SCALE FLAG
- * 00=SCALE, 01=UNSCALE
- TGMODE EQU STATUS+6 TIMESHARE/GRAPHICS MODE FLAG
- * 00=TIMESHARE, 01=GRAPHICS
- CPRINTFG EQU STATUS+7 COMM LINE PRINT FLAG
- * 00=NO PRINT, 01=PRINT
- ****************************************
- * USER BUFFER *
- ****************************************
- USBUF EQU STATUS+8 (19 BYTES)
- * USBUF DIFFERENCE COUNT
- * USBUF+1 INPUT INDEX
- * USBUF+2 OUTPUT INDEX
- * USBUF+3 BUFFER STORE AREA (16 BYTES)
- ****************************************
- * RECEIVE BUFFER *
- ****************************************
- RXBUF EQU USBUF+19 (131 BYTES)
- * RXBUF DIFFERENCE COUNT
- * RXBUF+1 INPUT INDEX
- * RXBUF+2 OUTPUT INDEX
- * RXBUF+3 BUFFER STORE AREA (128 BYTES)
- ****************************************
- * TRANSMIT BUFFER *
- ****************************************
- TXBUF EQU RXBUF+131 (11 BYTES)
- * TXBUF DIFFERENCE COUNT
- * TXBUF+1 INPUT INDEX
- * TXBUF+2 OUTPUT INDEX
- * TXBUF+3 BUFFER STORE AREA (8 BYTES)
- **************************************
- * CPM KEYBOARD/TOUCH PANEL BUFFER
- **************************************
- KTPBUF EQU TXBUF+11 (35 BYTE)
- * KTPBUF DIFFERENCE CONT
- * KTPBUF+1 INPUT INDEX
- * KTPBUF+2 OUTPUT INDEX
- * KTPBUF+3 BUFFER STORAGE AREA (32 BYTE)
- **************************************
- * CPM COMM BUFFER
- **************************************
- COMBUF EQU KTPBUF+35 (131 BYTE)
- * COMBUF DIFFERENCE CONT
- * COMBUF+1 INPUT INDEX
- * COMBUF+2 OUTPUT INDEX
- * COMBUF+3 BUFFER STORAGE AREA (128 BYTE)
- **************************************
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- * CPM EXTERNAL INTERRUPT BUFFER
- **************************************
- EXTBUF EQU COMBUF+131 (131 BYTE)
- * EXTBUF DIFFERENCE CONT
- * EXTBUF+1 INPUT INDEX
- * EXTBUF+2 OUTPUT INDEX
- * EXTBUF+3 BUFFER STORAGE AREA (128 BYTE)
- ****************************************
- * DATA STORE FOR PROCESSING *
- ****************************************
- DWORD EQU EXTBUF+131 (5 BYTE)
- ****************************************
- * EXTERNAL DEVICE DATA STORE *
- ****************************************
- EXTD EQU DWORD+5 (2 BYTES)
- ****************************************
- * ASCII COMM PORT CONTROL PACKAGE *
- ****************************************
- ASCPKG EQU EXTD+2 (8 BYTES)
- ****************************************
- * SCRATCH AREA *
- ****************************************
- SAVE1 EQU ASCPKG+8 (2 BYTES)
- SAVE2 EQU SAVE1+2 (12 BYTES)
- SAVE8 EQU SAVE2+12 (2 BYTES)
- SAVE0F EQU SAVE8+2 (16 BYTES)
- SAVE1F EQU SAVE0F+16 (16 BYTES)
- SAVE2F EQU SAVE1F+16 (16 BYTES)
- SAVE3F EQU SAVE2F+16 (16 BYTES)
- SAVE4F EQU SAVE3F+16 (16 BYTES)
- SAVE5F EQU SAVE4F+16 (16 BYTES)
- CPMDAT EQU SAVE5F+16 (2 BYTE)
- ****************************************
- * TEMP SAVE FOR CURSOR DATA *
- ****************************************
- *CURDATA EQU CPMDAT+2 (10 BYTES)
- EJECT PRINTER VARIABLES AND BUFFERS.
- ****************************************
- * PRINTER VARIABLES AND BUFFERS *
- ****************************************
- BUFFER EQU CURDATA+10 ENQ CODE PLUS 6 SPACES
- BUF1 EQU BUFFER+7 PRINT DATA BUFFER (86 BYTES)
- S.MEM EQU BUF1 SCREEN SAVE AREA (128 BYTES)
- BUF2 EQU BUF1+86
- *
- KEEPER EQU BUF1+128 COUNTER FOR SCREEN COPY
- ROWCOUNT EQU KEEPER+1 ROW COUNTER FOR SCREEN COPY
- ROW EQU ROWCOUNT+2 ROW FWA FOR SCREEN COPY
- PAUSE EQU ROW+2 POSITIVE=SLOW PRINT.
- TURNOFF EQU PAUSE+1 NON ZERO FLAGS COPY TURNED OFF
- SAVESTK EQU TURNOFF+1 SAVED ENTRY STACK POINTER.
- SLCNTR EQU SAVESTK+2 SOLENOID DUTY CYCLE COUNTERS
- * (24 BYTES FOR 12 COUNTERS)
- ****************************************
- * PROCESSOR STACK *
- ****************************************
- * 64 BYTES RESERVED FOR STACK
- ZSTACK EQU SLCNTR+24+64
- ENDVAR2 EQU ZSTACK END OF SECOND VARIABLE AREA
- ENDRES EQU 3800H FIRST ADDRESS AVAILABLE BEYOND
- * /--- BLOCK NORTHS 00 000 73/00/00 00.00
- * THE END OF THE RESIDENT.
- END
- $EOF
plato/source/plaopl/cpmasc.txt ยท Last modified: 2023/08/05 18:54 by Site Administrator