AIST2
IDENT AIST2
*WIDTH 62
ORG 0040H
OFFSET EQU *-40H
SPACE 15
* ASCII IST2 CONTROLWARE
SPACE 2
* VERSION 00
SPACE 4
* COPYRIGHT CONTROL DATA CORPORATION 1979
* FOR INTERNAL USE ONLY
* NOT A RELEASED PRODUCT
EJECT
SPACE 2
*
* INPUT FUNCTION CODES
*
MNTSW EQU 00 MAINTAINENCE SWITCHES
KBDATA EQU 01 KEY BOARD DATA
TPDATA EQU 02 TOUCH PANEL DATA
IDLO EQU 03 ID CODE, LOWER 8 BITS
IDUP EQU 04 ID CODE, UPPER 8 BITS
EXTDATI EQU 05 INPUT EXTERNAL DEVICE DATA
EXTSTAT EQU 06 INPUT EXTERNAL DEVICE STATUS
SYSSTAT EQU 07 TERMINAL INTERNAL STATUS
CLADATA EQU 08 COMMUNICATIONS LINE DATA
*
* OUTPUT FUNCTION CODES
*
PNLLTS EQU 00 MAINTENANCE PANEL LIGHTS
CLAL EQU 01 OUTPUT LOWER DATA BITS
CLAU EQU 02 OUTPUT UPPER DATA BITS
BLKERS EQU 03 DISPLAY BULK ERASE
INTMSK EQU 04 SYSTEM INTERRUPT MASK
MISCTL EQU 05 MISCELLANEOUS CONTROL
EXTDATO EQU 06 OUTPUT EXTERNAL DATA
EXTCNTO EQU 07 OUTPUT EXTERNAL CONTROL
*
EJECT EXTERNAL EQUATES
SPACE 5
* USER JUMP TABLE ADDRESSES
SPACE 2
FWA1 EQU * START OF FIRST CHECKSUM AREA
R.INIT JP INIT
R.DOT JP POINT
R.LINE JP LINE
R.CHARS JP CHARS
R.BLOCK JP BLOCK
R.INPX JP INPX
R.INPY JP INPY
R.OUTX JP OUTX
R.OUTY JP OUTY
R.XMIT JP TX.STOR
R.MODE JP MODESET
R.STEPX JP STEPX
R.STEPY JP STEPY
R.WE JP WE
R.DIR JP DIR
R.INPUT JP INPUT
R.SSF JP SSF0
R.CCR JP CCR
R.EXTOUT JP EXTX
R.EXEC JP EXEC
R.GJOB JP GJOB
R.XJOB JP XJOB
R.RETURN JP RETURN
R.CHRCV JP CONVERT
EJECT
ORG 00F0H+OFFSET
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
*
* INTERRUPT VECTOR TABLE
* LOWER 8 BITS OF INTERRUPT VECTOR FIXED AT 00
* UPPER 8 BITS INITIALIZED IN PROGRAM TO (100H+OFFSET)/100H.
*
ORG 0100H+OFFSET
SERCHAN DEFS 2 SERIAL CHANNEL
CLACRDY DEFS 2 CLA CHAR READY
CLACREQ DEFS 2 CLA CHARACTER REQUEST
KYBRD DEFS 2 KEYBOARD DATA
THPNL DEFS 2 TOUCH PANEL
SINTERV DEFS 2 SHORT INTERVAL
EXTCH DEFS 2 EXTERNAL CHANNEL
LINTERV DEFS 2 LONG INTERVAL
FWA2 EQU * START OF SECOND CHECKSUM AREA
EJECT TERMINAL INITIALIZATION
* * * * * * * * * * * * * * * * * * * * *
*
* TERMINAL INITIALIZATION
*
* * * * * * * * * * * * * * * * * * * * *
* ASCII 401X AND PLATO INITIALIZE
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,(RESETFLG) IS THIS A SIMPLE RESET
XOR 3CH
JR NZ,INIT1 JUMP IF NO
* INITIALIZE AFTER SIMPLE RESET
IN A,(EXTSTAT) IS CARRIER ON
BIT 4,A
JR NZ,INIT1 JUMP IF NO (DO FULL INIT)
LD A,(MODE) ARE WE IN PLATO MODE
RLCA
JR NC,INIT0 JUMP IF ASCII MODE
CALL SENDNAK PLATO, SO SEND NAK SEQUENCE
LD HL,0382H SEND RESET STATUS TO PLATO
CALL R.XMIT
INIT0 EQU *
CALL INIT3 INIT INTS AND CHECKSUM
JP IDLE
* INITIALIZE AFTER LOAD
INIT1 EQU *
XOR A SET ASCII MODE
LD (MODE),A
LD A,3CH SET SIMPLE RESET FLAG
LD (RESETFLG),A
LD A,01 SOUND BEEPER
OUT (MISCTL),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 HL,SERCHN LOAD INTERRUPT VECTORS
LD (SERCHAN),HL
LD HL,KYBD
LD (KYBRD),HL
LD HL,TP
LD (THPNL),HL
LD HL,EXTI
LD (EXTCH),HL
LD HL,LINT
LD (LINTERV),HL
LD HL,EXTI0
LD (M.EXTPA),HL
CALL INIT3 INIT INTS AND CHECKSUM
CALL AINIT ASCII INIT
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 HL,M.TYPE SET TERMINAL TYPE
IN A,(MNTSW) GET SWITCHES 6(TP PRESENT)
LD B,A AND 5(32K) AND PUT INTO
AND 60H BITS 5 AND 4 OF M.TYPE
RRCA
OR 07H SET ASCII TERMINAL TYPE
LD (HL),A IN BITS 3..0
LD A,B GET SWITCHES AGAIN
AND 03H GET KB/TP AND TEST BITS
CP 02H IF NO TEST BUT KB/TP
JR NZ,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.
LD HL,184 MESSAGE
CALL R.OUTX
LD HL,TRMRDY
CALL R.CHARS
LD HL,VER DISPLAY VERSION NO.
CALL R.CHARS
CALL AFF.1 HOME CURSOR
JP IDLE
INIT3 EQU *
LD HL,100H+OFFSET SET INT. TABLE ADDRESS
LD A,H (UPPER BITS)
LD I,A INTO INT. VECTOR
IM 2 SET FOR MODE 2 INTERRUPTS
LD HL,0445H ENABLE KEYBOARD, LONG INTERVAL
CALL R.SSF AND SERIAL CHANNEL INTERRUPTS.
LD A,(SC.OC) ENABLE CHAR READY INTERRUPT.
OUT (EXTCNTO),A
CALL CHKSUM.I INITIALIZE MEMORY CHECKSUM
EI
RET
EJECT
**********
* PLATO INITIALIZE
**********
PINIT EQU *
LD A,80H SET PLATO OPERATIONS
LD (MODE),A
XOR A SET (M.KSW) TO PUT INPUT DATA
LD (M.KSW),A INTO THE TRANSMIT BUFFER
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 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
CALL R.CHARS
LD A,01 SET ERROR PROTOCOL TO STATE 0
LD (EREG),A
LD A,20 INIT WORD COUNTER
LD (E.CNTR),A
LD C,06H SEND ACK
CALL XMIT.1
LD C,0+20H SEND 0 (WORD COUNT)
CALL XMIT.1
RET
*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 *
HEX 54,05,12,0D
HEX 09,0E,01,0C
HEX 2D,52,05,01
HEX 04,19,3F,00
*VERSION (CHANGE WITH NEW PRODUCTION BINARY)
VER EQU *
HEX 2D,1B,1B 00
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
VERSION DEFB 00 00
EJECT
* * * * * * * * * * * * * * * * * * * *
*
* LONG INTERVAL INTERRUPT PROCESSOR
*
* * * * * * * * * * * * * * * * * * * *
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 HL,LINT.CTR INCREMENT LONG INT. CNTR.
INC (HL)
LD A,(HL)
CP 21 HAVE 21 COUNTS GONE BY
JP NZ,R.RETURN NO, JUST EXIT
LD (HL),0 YES, RESET CNTR.
LD HL,(M.CLOCK) AND INCREMENT (M.CLOCK)
INC HL
LD (M.CLOCK),HL
JP R.RETURN
EJECT
EJECT
* * * * * * * * * * * * * * * * * * * *
*
* SERIAL CHANNEL INTERRUPT PROCESSOR
*
* * * * * * * * * * * * * * * * * * * *
SERCHN EQU *
PUSH AF
PUSH BC
PUSH DE
PUSH HL
IN A,(EXTSTAT) INPUT SERIAL CHAN STATUS
RRA TEST FOR INTERRUPT PENDING
JP NC,R.RETURN NONE, RETURN TO PROCESSING
RRA TEST FOR CHAR RDY
RRA
JR NC,SERCHN1 NOT RDY, SERCHN1
*CHARACTER READY
IN A,(EXTDATI) INPUT DATA
LD C,A
LD A,(MODE) IF PLATO OPERATIONS THEN
RLCA
JR NC,SERCHN0
CALL ERRCHK CALL PLATO ERROR PROTOCOL
JP C,R.RETURN EXIT IF CHAR TO BE IGNORED
SERCHN0 EQU *
RES 7,C MASK TO 7 BITS
LD HL,RXBUF RECEIVE BUFFER ADDRESS
LD A,0FFH LOAD MASK FOR INDEX
CP (HL) TEST FOR FULL BUFF
JP Z,R.RETURN FULL,RETURN
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)
INC (HL)
JP R.RETURN
SERCHN1 EQU *
RLA TEST FOR CHAR REQ
JP NC,R.RETURN NO CHAR REQ, RETURN
*CHARACTER REQUEST
IN A,(EXTSTAT) CHECK FOR CLEAR TO SEND
BIT 5,A
JR Z,SERCHN2 JUST EXIT IF CTS OFF
LD HL,TXBUF LOAD ADDRESS OF TRANSMIT BUFF
XOR A TEST FOR EMPTY
OR (HL) BUFFER
JR Z,SERCHN2 NO DATA, SERCHN2
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 (EXTDATO),A OUTPUT DATA
SERCHN2 EQU *
LD A,(SC.OC) TURN OFF CHAR REQ INT
OUT (EXTCNTO),A
JP R.RETURN RETURN TO PROCESSING
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
AND 7FH MASK FOR DATA BITS
LD L,A LOAD KEYBOARD DATA
LD H,40H OP CODE AND CATAGORY
CALL FIFO.ST AND STORE FOR TRANSMIT
JR RETURN
SPACE 4
* * * * * * * * * * * * * * * * * * * * *
*
* 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
CALL FIFO.ST AND STORE FOR TRANSMIT
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 HL,(M.EXTPA) LOAD PROCESSOR ADDR.
JP (HL)
*
EXTI0 EQU *
LD A,(EXT.IN) LOAD EXTERNAL DEVICE ADDRESS
LD C,A
AND 1CH TEST FOR SERIAL OR PARALLEL
LD A,C
JR Z,EXTI1
ADD A,1DH ADD BITS FOR PARALLEL
*
EXTI1 EQU *
ADD A,03
LD C,A
IN L,(C) INPUT FROM EXTERNAL CHANNEL
LD H,82H LOAD OP CODE AND USER/PLATO
CALL FIFO.ST AND STORE FOR TRANSMIT
SPACE 4
* * * * * * * * * * * * * * * * * * * * *
*
* RESTORE ALL REGISTERS AND ENABLE INTERRUPTS
*
* * * * * * * * * * * * * * * * * * * * *
SPACE 1
RETURN EQU *
POP HL
POP DE
POP BC
POP AF
EI ENABLE SYSTEM INTERRUPTS
RET
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
EJECT
* * * * * * * * * * * * * * * * * * * *
*
* MAIN IDLE LOOP
*
* * * * * * * * * * * * * * * * * * * *
IDLE EQU *
CALL CHKSUM CHECKSUM MEMORY DURING IDLE
JR NZ,BLOCKF JUMP IF BAD CHECKSUM
LD A,(MODE) TEST FOR OPERATING MODE
RLCA
JP NC,AIDLE ASCII IDLE IF BIT 7 CLEAR
**********
* PLATO OPERATIONS IDLE LOOP
**********
PIDLE EQU *
LD A,(EREG) CHECK TIME OUT
AND 04 IF COMM ERROR STATE
CALL NZ,TIMOUT
CALL R.EXEC TEST FOR RECEIVE OR XMIT DATA
JR IDLE LOOP TO IDLE
**********
* PLATO COMMUNICATIONS ERROR STATE TIME OUT
**********
TIMOUT EQU *
LD A,(CLK.1) HAS TIME OUT EXPIRED
ADD A,1
LD (CLK.1),A
RET NC
LD A,(CLK.2)
INC A
LD (CLK.2),A
SUB 20H
RET NZ NO, EXIT
XOR A YES, RESET TIME OUT
LD (CLK.1),A
LD (CLK.2),A
LD C,95H SEND NAK
CALL XMIT.1
LD A,(MREG) SEND WC+20H
ADD A,20H
LD C,A
CALL XMIT.1
RET
**********
* 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 AND TRANSMIT DATA UNTIL RECEIVE BUFFER
* IS EMPTY.
**********
EXEC EQU *
LD A,(LOC.RMT) CHECK FOR LOCAL
OR A
JR NZ,EXEC1 JUMP IF YES
IN A,(EXTSTAT) CHECK FOR CARRIER
BIT 4,A
JR Z,EXEC1 JUMP IF ON
LD A,0DEH SET ERROR LIGHT
OUT (PNLLTS),A
EXEC1 EQU *
LD A,(M.JOBS) TEST FOR RECEIVE DATA
OR A
CALL NZ,PROCESS
LD A,(TXBUF) TEST FOR TRANSMIT DATA
OR A
JR Z,EXEC2 NO DATA, JUMP
IN A,(EXTSTAT) TEST FOR CHAR REQ
BIT 1,A
JR Z,EXEC2 JUMP IF OFF
LD A,(SC.OC) ENEBLE CHAR REQ INT
INC A
OUT (EXTCNTO),A
EXEC2 EQU *
LD A,(M.JOBS) CHECK FOR RECEIVE DATA AGAIN
OR A
JR NZ,EXEC LOOP IF MORE
RET
**********
* 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,0FFH MASK OUT INDEX WITH BUFF LEN
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 *
CALL ESCCTL CHECK FOR ESC SEQ OR CTL CODE
RET C EXIT IF YES
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)
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
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
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
XOR A CLEAR FLAG
LD (G.ESC),A
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 *
CP 0DH IS CHAR A CR
JR NZ,MATCH1 NO, JUMP
LD (CRLFFG),A YES, SET SCROLL FLAG
JR MATCH2
MATCH1 EQU *
CP 0AH IS CHAR A LF
JR Z,MATCH2 YES, JUMP
CALL SCROLLCL NO, CLEAR SCROLL FLAG
MATCH2 EQU *
INC HL
LD E,(HL)
INC HL MATCH, JUMP TO BUILD COMMAND
LD D,(HL)
EX DE,HL
LD DE,M.CCR
JP (HL)
*
SCROLLCL EQU *
XOR A CLEAR SCROLL FLAG
LD (CRLFFG),A
RET
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
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
EJECT
**********
* 'THE FOLLOWING ROUTINE TRANSFERS DATA IN HL TO THE
* TRANSMIT BUFFER. KEYBOARD DATA IS CONVERTED TO ASCII.
* THE SPECIAL SEQUENCE OF SHIFT-SUP(ETB) FOLLOWED BY
* SHIFT-STOP(DC1) IS DETECTED AND CAUSES THE TERMINAL
* TO PERFORM AN ASCII MODE INITIALIZATION.
**********
TX.STOR EQU *
LD E,L SAVE DATA IN DE
LD D,H
ADD HL,HL IS THIS KYBD DATA
LD A,07H
AND H
JR NZ,TX.STOR3 NO, JUMP
CALL KBCON CONVERT CHAR TO ASCII IN C
RET Z IGNORE UNDEFINED KEYS
LD A,17H IS CODE AN ETB
CP C
JR Z,TX.STOR1 YES, JUMP
LD A,(SH.SUP) NO, IS SH.SUP FLAG SET
OR A
JR Z,TX.STOR2 NO, JUMP
XOR A CLEAR SH.SUP FLAG
LD (SH.SUP),A
LD A,11H IS CODE A DC1
CP C
JR NZ,TX.STOR2 NO, JUMP
XOR A YES, SET ASCII MODE
LD (MODE),A
JP R.INIT DO ASCII INITIALIZE
TX.STOR1 EQU *
LD A,1 SET SH.SUP FLAG
LD (SH.SUP),A
TX.STOR2 EQU *
CALL XMIT.1 SEND THE CHAR
RET AND EXIT.
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 * ASCII MODE ENTRY
LD A,(LOC.RMT)
OR A
RET NZ JUST EXIT IF LOCAL
XMIT.1 EQU * PLATO MODE ENTRY
IN A,(EXTSTAT) CHECK FOR CLEAR TO SEND
BIT 5,A
JR Z,XMIT.3 JUST EXIT IF CTS OFF
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
INC HL POINT TO BUFFER AREA
INC HL
LD E,A ADD THE INPUT INDEX
LD D,00H
ADD HL,DE
LD A,(MODE) CHECK ASCII/PLATO MODE
RLCA
LD A,C
JR NC,XMIT.2 SKIP PARITY IF ASCII
OR A PLATO, SO SET EVEN PARITY
JP PE,XMIT.2
XOR 80H
XMIT.2 EQU *
LD (HL),A STORE DATA IN TXBUF
XMIT.3 EQU *
LD A,(SC.OC) SET CREQ ENABLE
INC A
OUT (EXTCNTO),A
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)
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,(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 PLATO ERROR RECOVERY PROTOCOL DURING
* TRANSFERS FROM THE DSN NETWORK TO THE TERMINAL.
* '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 IGNORE THE CHARACTER.
**********
ERRCHK EQU *
LD A,06H IF CHAR=ACK THEN
CP C
JR NZ,E001
LD A,(EREG) SET ACK FLAG
OR 80H
LD (EREG),A
SCF
RET AND EXIT(IGNORE)
E001 LD A,(EREG) ELSE IF STATE=0
RRA (INITIAL STATE) THEN
JR NC,E100
LD A,C IF CHAR PARITY OK
OR A
JP PO,E006
LD A,(EREG) AND ACK FLAG=1 THEN
RLA
JR NC,E006
E002 EQU *
LD A,0DFH CLEAR ERR LIGHT
OUT (PNLLTS),A
LD A,C IF (CHAR AND 7FH) >= 20H
AND 7FH
SUB 20H
JP M,E003
LD (MREG),A THEN SAVE BIASED CHAR
LD (NREG),A AT M AND N
LD A,02H AND SET STATE=1
LD (EREG),A (EXPECTING DATA)
E003 EQU *
LD A,(EREG) CLEAR ACK FLAG
AND 0FH
LD (EREG),A
SCF AND EXIT(IGNORE)
RET
E006 EQU *
LD A,(EREG) ELSE CLEAR ACK FLAG
AND 0FH
LD (EREG),A
RET AND EXIT(OK)
E100 EQU *
RRA IF NOT STATE 1 THEN JUMP
JP NC,E200
LD A,C IF CHAR PARITY OK THEN JUMP
OR A
JP PE,E104
SENDNAK EQU *
LD A,0DEH SET ERR LIGHT
OUT (PNLLTS),A
XOR A SET STATE=2(ERROR)
OR 04H AND CLEAR ACK FLAG
LD (EREG),A
LD C,95H SEND NAK
CALL XMIT.1
LD A,(MREG) SEND M+20H
ADD A,20H
LD C,A
CALL XMIT.1
XOR A RESET 250 MS TIMEOUT
LD (CLK.1),A
LD (CLK.2),A
SCF AND EXIT(IGNORE)
RET
E104 EQU * STATE=1 AND NO PAR ERR, SO
LD A,(EREG) IF ACK FLAG=1 THEN
AND 80H
JR Z,E105
LD A,C STRIP CHAR PAR BIT
OR A
RLA
RRCA
SUB 20H SET N = CHAR-20H
LD (NREG),A
JR E003 AND GO CLEAR ACK FLAG
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 =
LD B,60H N+1 MOD 96
CP B
JP NZ,E106
XOR A
E106 LD (NREG),A
LD (MREG),A
LD A,(EREG) MARK AS OK CHAR
AND 0BFH
LD (EREG),A
JR E109
E107 EQU * M<>N, SO
INC A SET N = N+1 MOD 96
LD C,60H
CP C
JR NZ,E108
XOR A
E108 LD (NREG),A
LD A,(EREG) AND MARK TO IGNORE CHAR
OR 40H
LD (EREG),A
E109 EQU * NOW TEST THE CHAR COUNTER.
LD A,(E.CNTR) IF E.CNTR<>1 THEN
DEC A
JR Z,E110
LD (E.CNTR),A DECREMENT E.CNTR
LD A,(EREG) PUT MARK IN CARRY FLAG
RLCA
RLCA
RET AND EXIT
E110 EQU * COUNTER=0, SO
LD B,C
LD A,14H SET E.CNTR=20
LD (E.CNTR),A
LD C,06H SEND ACK
E111 CALL XMIT.1
JR C,E111
LD A,(MREG) SEND M+20H
ADD A,20H
LD C,A
E113 CALL XMIT.1
JR C,E113
LD C,B
LD A,(EREG) PUT MARK IN CARRY FLAG
RLCA
RLCA
RET AND EXIT
E200 EQU * ERROR STATE
LD A,C IF PAR OK THEN
OR A
JP PO,E201
LD A,(EREG) IF ACK FLAG=1 THEN
RLCA
JP C,E002
JR E202
E201 EQU *
LD A,(EREG) ELSE CLEAR ACK FLAG
AND 0FH
LD (EREG),A
E202 EQU *
SCF EXIT(IGNORE)
RET
EJECT PROCESS LDM COMMAND
* * * * * * * * * * * * * * * * * * * * *
*
* 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 80H
OR C
LD (MODE),A
JP CG.SEL SELECT CHARACTER GENERATOR
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
LD A,(MODE) IF PLATO OPER. THEN
RLCA
JP C,CG.SEL SELECT CHARACTER GENERATOR
RET
MODESET2 EQU * LOCAL ENTRY TO SET MODE BITS
LD A,(MODE) GET OLD MODE BITS
AND 80H CLEAR OLD MODE BITS
JR Z,MODSET2A JUMP IF ASCII MODE
XOR A CLEAR BYPASS IN PLATO MODE
LD (BYPASS),A
LD A,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)
*
* * * * * * * * * * * * * * * * * * * * *
SPACE 1
LDC EQU *
CALL GETXY GET COORDINATES
CALL R.OUTX SET COORDINATES
EX DE,HL
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
*
* =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
RET
*
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
* ADDRESS MUST BE 22EAH-2311H OR 3300H-7FFFH
CHKRG EQU *
EX DE,HL ADDRESS TO DE
LD HL,3300H
SCF
SBC HL,DE
JR NC,CHKRG0 JUMP IF <3300H
EX DE,HL ADDRESS BACK TO HL
BIT 7,H
RET Z EXIT IF OK (<8000H)
CHKRG0 EQU * ADDRESS IS <3300H
LD HL,22EAH
SCF
SBC HL,DE
JR NC,CHKRG1 JUMP IF <22EAH (ERROR)
LD HL,2312H
SBC HL,DE (CARRY IS ALREADY SET)
EX DE,HL ADDRESS BACK TO HL
RET NC EXIT IF OK (<2312H)
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
LD (HL),E AND STORE DATA BYTE
AND 1CH TEST FOR SERIAL OR PARALLEL
RET Z CAN NOT SELECT SERIAL CHANNEL
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
LD A,C
JR Z,SSF4
ADD A,1DH ADD FOR PARALLEL CHANNEL
SSF4 EQU *
ADD A,03 ADD FOR SERIAL CHANNEL
LD C,A
IN L,(C) INPUT FROM DEVICE
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 M,TX.STOR STORE FOR TRANSMIT TO 'PLATO
POP HL FOR M.KSW=2 OR M.KSW=3
* RETURN DATA IN L TO USER
RET
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
LD A,H SWAP H AND L
LD H,L
LD L,A
LD (EXTD),HL SAVE IN TEMP EXT DATA 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
RET NZ RETURN IF SERIAL
*
* PARALLEL CHANNELS
*
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
* * * * * * * * * * * * * * * * * * * * *
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
JR MODE17
*
* 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
INC BC
EXX
CALL MASKS GENERATE MASKS
LD C,L
LD B,H
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,MODE1A JUMP IF X POSITIVE
*
INC DE SET DE FOR
INC DE NEGATIVE 'Y
*
MODE1A EQU *
LD A,(M.MODE) TEST MODE BITS
RRA FOR WRITE OR ERASE
JP NC,XVECE ERASE
JP XVEC ELSE GO TO WRITE
*
MODE17 EQU *
LD BC,(YDELTA) LOAD DELTA FOR LOOP COUNT
INC BC
EXX
CALL MASKS GENERATE MASKS
LD C,L
LD B,H
LD DE,0FFFFH LOAD FOR POSTIVE 'Y
LD HL,(DMAA) LOAD STARTING ADDRESS
LD A,(VECFLG) LOAD CEVTOR PARAMETERS
BIT 4,A TEST FOR POS 'Y DELTA
JR Z,MODE18 JUMP IF X POSITIVE
*
INC DE SET DE FOR
INC DE NEGATIVE 'Y
*
MODE18 EQU *
LD A,(M.MODE) TEST MODE BITS
RRA FOR WRITE OR ERASE
JP NC,YVECE GO TO ERASE
*
* VECTOR GENERATOR, Y IS LONG AXIS, X IS SHORT AXIS
* WRITE VECTOR
*
YVEC EQU *
LD A,(HL) LOAD VECTOR POINT
OR C INTO REFRESH MEMORY
LD (HL),A
EXX
DEC BC DECREMENT LOOP COUNT
LD A,B
OR C TEST COUNT FOR ZERO
JR Z,MODE19 EXIT LOOP IF ZERO
*
YVEC1 EQU *
ADD HL,DE CALCULATE NEXT POINT
EXX
JR NC,YVEC2
RLC C
JR NC,YVEC2
INC H
INC H
SET 7,H
YVEC2 EQU *
ADD HL,DE
SET 7,H REFRESH MEMORY ADDRESS BIT
JR YVEC
EJECT Y AXIS VECTOR ERASE
*
* VECTOR GENERATOR, Y IS LONG AXIS, X IS SHORT AXIS
* VECTOR ERASE
*
YVECE EQU *
LD A,(HL) LOAD VECTOR POINT
AND B INTO DMA MEMORY
LD (HL),A
*
EXX
DEC BC DECREMENT LOOP COUNT
LD A,B
OR C TEST COUNT FOR ZERO
JR Z,MODE19 EXIT LOOP IF ZERO
*
YVECE1 EQU *
ADD HL,DE CALCULATE NEXT POINT OF VECT
EXX
JR NC,YVECE2
RLC B
JR C,YVECE2
INC H
INC H
SET 7,H
YVECE2 EQU *
ADD HL,DE
SET 7,H REFRESH MEMORY ADDRESS BIT
JR YVECE
EJECT X AXIS VECTOR
*
*
* VECTOR GENERATOR, X IS LONG AXIS, Y IS SHORT AXIS
* WRITE VECTOR
*
XVEC EQU *
LD A,(HL) LOAD VECTOR POINT
OR C INTO REFRESH MEMORY
LD (HL),A
*
EXX
DEC BC DECREMENT LOOP COUNT
LD A,B
OR C TEST COUNT FOR ZERO
JR Z,MODE19 EXIT LOOP IF ZERO
*
XVEC1 EQU *
ADD HL,DE CALCULATE NEXT POINT
EXX
JR NC,XVEC2
ADD HL,DE
SET 7,H
XVEC2 EQU *
RLC C
JR NC,XVEC
INC H
INC H
SET 7,H
JR XVEC
SET 7,H REFRESH MEMORY ADDRESS BIT
JR XVEC
EJECT X AXIS VECTOR ERASE
*
* VECTOR GENERATOR, X IS LONG AXIS, Y IS SHORT AXIS
* VECTOR ERASE
*
XVECE EQU *
LD A,(HL) ERASE
AND B VECTOR POINT
LD (HL),A OF DMA MEMORY
*
EXX
DEC BC DECREMENT LOOP COUNT
LD A,B
OR C TEST COUNT FOR ZERO
JR Z,MODE19 EXIT LOOP IF ZERO
*
XVECE1 EQU *
ADD HL,DE CALCULATE NEXT POINT OF VECT
EXX
JR NC,XVECE2
*
ADD HL,DE MOVE IN 'Y
SET 7,H DIRECTION
XVECE2 EQU *
RLC B
JR C,XVECE
INC H MOVE IN 'X
INC H DIRECTION
SET 7,H REFRESH MEMORY ADDRESS BIT
JR XVECE
*
*
*
MODE19 EQU *
LD HL,(YEND)
CALL R.OUTY LOAD COORDINATE.
LD HL,(XEND)
JP R.OUTX LOAD COORDINATE.
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
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
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
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
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
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
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
LD C,A SAVE IN C
CALL LDMEMSEL SELECT M2..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.
* NOTE, C-REG IS UNCHANGED.
LDMEMSEL EQU *
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
JP CG.SEL SELECT CHARACTER GENERATOR
*
VERT EQU *
EX DE,HL
SET 0,(HL) AND SET VERTICAL PLOT
JP CG.SEL SELECT CHARACTER GENERATOR
*
FWD EQU *
EX DE,HL
RES 6,(HL) AND SET FORWARD PLOT
RET
*
REV EQU *
EX DE,HL
SET 6,(HL) AND SET REVERSE PLOT
RET
*
SIZE0 EQU *
LD HL,08 LOAD SIZE ONE CHARACTER
LD (SIZE),HL
EX DE,HL
RES 5,(HL) SET SIZE 0 FLAG
RET
*
SIZE2 EQU *
LD HL,10H LOAD SIZE TWO CHARACTER
LD (SIZE),HL
EX DE,HL
SET 5,(HL) SET SIZE 2 FLAG
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
LD A,(M.CCR) LOAD PLOTTING PARAMETERS
BIT 5,A TEST FOR SIZE ZERO OR SIZE T
JP NZ,SIZE.2
*
EX DE,HL
LD HL,(CG.ADR) LOAD CHARACTER GENERATOR ADD
JP (HL)
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 *
PUSH HL PUT CHAR. DATA ADDR.
POP IX INTO IX REG.
LD DE,SAVE3F LOAD TEMP. STORE ADDRESSES
LD HL,SAVE1F
EXX
LD BC,0010H 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
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
DEC BC LOOP ON 16 COUNT
LD A,B
OR C
JR NZ,SIZE2.A
EXX
LD A,(M.CCR)
BIT 0,A
JR NZ,SIZE2V DO VERTICAL SIZE TWO
SIZE2H EQU *
LD HL,SAVE3F LOAD 3RD QUAD.
CALL CHARGEN1 AND DISPLAY
SPACE 2
* * * * * * * * * * * * * * * * * * * * *
*
* HORIZONTAL PLOT
*
* * * * * * * * * * * * * * * * * * * * *
SPACE 1
BIT 6,A TEST FOR REVERSE PLOT
JR NZ,SIZE2R DO REVERSE CHAR. PLOTTING
LD HL,(XREG) LOAD X COORDINATE
LD DE,-8
ADD HL,DE ADJUST FOR TOP HALF
CALL R.OUTX LOAD COORDINATE.
LD HL,(YREG) LOAD Y COORDINATE
LD DE,10H
ADD HL,DE
CALL R.OUTY LOAD COORDINATE.
*
LD HL,SAVE2F LOAD 2ND QUAD.
CALL CHARGEN1 AND DISPLAY
LD HL,SAVE0F LOAD 1ST QUAD.
CALL CHARGEN1 AND DISPLAY
*
LD HL,(XREG) LOAD X COORDINATE
LD DE,-8
ADD HL,DE ADJUST COORDINATE FOR NEXT P
CALL R.OUTX LOAD COORDINATE.
LD HL,(YREG) LOAD Y COORDINATE
LD DE,-10H
ADD HL,DE ADJUST COORDINATE FOR NEXT P
CALL R.OUTY LOAD COORDINATE.
*
LD HL,SAVE1F LOAD 4TH QUAD.
JP CHARGEN1 PLOT LAST PART OF CHARACTER
SPACE 2
* * * * * * * * * * * * * * * * * * * * *
*
* REVERSE HORIZONTAL PLOT
*
* * * * * * * * * * * * * * * * * * * * *
SPACE 1
SIZE2R EQU *
LD HL,(YREG) LOAD Y COORDINATE
LD DE,10H
ADD HL,DE
CALL R.OUTY LOAD COORDINATE.
*
LD HL,SAVE2F LOAD 2ND QUAD.
CALL CHARGEN1 PLOT NEXT PART OF CHARACTER
LD HL,(XREG) LOAD CURRENT X COORDINATE
LD DE,08 LOAD ADJUST CONSTANT
ADD HL,DE
CALL R.OUTX LOAD COORDINATE.
LD HL,SAVE0F LOAD 1ST QUAD.
CALL CHARGEN1 PLOT NEXT PART OF CHARACTER
LD HL,(YREG) LOAD Y COORDINATE
LD DE,-10H
ADD HL,DE ADJUST COORDINATE FOR NEXT P
CALL R.OUTY LOAD COORDINATE.
*
LD HL,SAVE1F LOAD 4TH QUAD.
CALL CHARGEN1 PLOT LAST PART OF CHARACTER
LD HL,(XREG) LOAD CURRENT X COORDINATE
LD DE,-08 LOAD ADJUST CONSTANT
ADD HL,DE
JP R.OUTX LOAD COORDINATE.
SPACE 2
* * * * * * * * * * * * * * * * * * * * *
*
* VERTICAL PLOT
*
* * * * * * * * * * * * * * * * * * * * *
SPACE 1
SIZE2V EQU *
LD HL,SAVE3F PLOT 3RD QUAD
CALL CHARGEN1
LD A,(M.CCR) TEST FOR REVERSE PLOTTING
BIT 6,A
JR NZ,SIZE2VR DO VERTICAL REVERSE PLOT
LD HL,(XREG) POSITION FOR 2ND QUAD
LD DE,-10H
ADD HL,DE
CALL R.OUTX
LD HL,(YREG)
LD DE,-08H
ADD HL,DE
CALL R.OUTY
LD HL,SAVE2F PLOT 2ND QUAD
CALL CHARGEN1
LD HL,SAVE0F PLOT 1ST QUAD
CALL CHARGEN1
LD HL,(XREG) POSITION FOR 4TH QUAD
LD DE,10H
ADD HL,DE
CALL R.OUTX
LD HL,(YREG)
LD DE,-08H
ADD HL,DE
CALL R.OUTY
LD HL,SAVE1F PLOT 4TH QUAD
JP CHARGEN1
EJECT SIZE 2 VERTICAL REVERSE
* * * * * * * * * * * * * * * * * * * * *
*
* REVERSE VERTICAL PLOT
*
* * * * * * * * * * * * * * * * * * * * *
SPACE 1
SIZE2VR EQU *
LD HL,(XREG) POSITION FOR 2ND QUAD
LD DE,-10H
ADD HL,DE
CALL R.OUTX
LD HL,SAVE2F PLOT 2ND QUAD
CALL CHARGEN1
LD HL,(YREG) POSITION FOR 1ST QUAD
LD DE,08H
ADD HL,DE
CALL R.OUTY
LD HL,SAVE0F PLOT 1ST QUAD
CALL CHARGEN1
LD HL,(XREG) POSITION FOR 4TH QUAD
LD DE,10H
ADD HL,DE
CALL R.OUTX
LD HL,SAVE1F PLOT 4TH QUAD
CALL CHARGEN1
LD HL,(YREG) POSITION FOR NEXT CHAR
LD DE,-08H
ADD HL,DE
CALL R.OUTY
RET
CHARGEN1 EQU *
EX DE,HL
LD HL,(CG.ADR) LOAD CHARACTER GENERATOR ADD
JP (HL)
EJECT FAST PLOT NORMAL(HORIZONTAL)
**********
* FAST HORIZONTAL PLOT NORMAL
**********
SPACE 2
FHPLOT EQU *
LDDR
FH.ADV EQU *
LD HL,0010H MOVE TO CHARACTER BOTTOM
ADD HL,DE
LD A,(M.CCR)
BIT 6,A
JR NZ,FH.ADV1 IF REVERSE, JUST ADJUST Y
INC H MOVE TO NEXT CHAR. POSITION
INC H IN THE X DIRECTION
SET 7,H
LD (DMAA),HL
LD BC,0008
LD HL,(XREG)
ADD HL,BC
LD A,H
AND 01
LD H,A
LD (XREG),HL
RET
FH.ADV1 EQU *
SET 7,H
LD (DMAA),HL
RET
EJECT FAST PLOT INVERSE (HORIZONTAL)
**********
* FAST PLOT INVERSE HORIZONTAL
**********
SPACE 2
FPLOTI EQU *
LD A,(DE) COMPLEMENT CHAR. DATA
CPL BEFORE WRITING TO SCREEN
LD (HL),A
DEC DE
DEC HL
DEC C
JR NZ,FPLOTI
EX DE,HL
JP FH.ADV
EJECT FAST PLOT OVERSTRIKE WRITE(HOR.)
**********
* FAST PLOT OVERSTRIKE WRITE HORIZONTAL
**********
SPACE 2
FPLOTOW EQU *
LD A,(DE) CHAR. DATA .OR. WITH SCREEN
OR (HL)
LD (HL),A
DEC DE
DEC HL
DEC C
JR NZ,FPLOTOW
EX DE,HL
JP FH.ADV
EJECT FAST PLOT OVERSTRIKE ERASE(HOR.)
**********
* FAST PLOT OVERSTRIKE ERASE HORIZONTAL
**********
SPACE 2
FPLOTOE EQU *
LD A,(DE)
CPL
AND (HL)
LD (HL),A
DEC DE
DEC HL
DEC C
JR NZ,FPLOTOE
EX DE,HL
JP FH.ADV
EJECT HORIZONTAL PLOT NORMAL
**********
* HORIZONTAL PLOT NORMAL
**********
SPACE 2
HPLOTN EQU *
EX DE,HL
LD DE,(DMAA)
LD BC,0010H
LD A,(BP)
OR A
JP Z,FHPLOT X AND Y ON BOUNDARY
AND 07H
JR NZ,HPN0
MHP1 EQU * ONLY Y OFF BOUNDARY
LDD
JP PO,H.ADV CHAR DONE, POINT TO NEXT CHAR
LD A,E
INC A
JR NZ,MHP1
BIT 0,D
JR Z,MHP1
INC D
INC D
SET 7,D
JR MHP1
*
HPN0 EQU * X AND Y OFF CHAR. BOUNDARIES
EXX
CALL MASKS
EXX
PUSH HL
POP IX IX HAS FWA OF CHAR. DATA
LD HL,(DMAA) DISPLAY MEMORY ADDR.
LD DE,(DMA1) DISPLAY MEMORY ADDR. NEXT COL.
LD B,10H LOOP COUNT
HPN1 EQU *
EXX
LD A,(BP)
AND 07H
LD B,A
LD A,(IX+0)
HPN2 EQU *
RLA
RL C
DJNZ HPN2
*
AND D
LD B,A
LD A,C
AND E
LD C,A
EXX
LD A,(HL)
EXX
AND E
OR B
EXX
LD (HL),A
LD A,(DE)
EXX
AND D
OR C
EXX
EX DE,HL
LD (HL),A
EX DE,HL
DEC DE
DEC HL
DEC IX
DJNZ HPN3
JP H.ADV
HPN3 EQU *
LD A,L
INC A
JR NZ,HPN1
BIT 0,H
JR Z,HPN1
INC H
INC H
SET 7,H
INC D
INC D
SET 7,D
JP HPN1
EJECT HORIZONTAL PLOT INVERSE
**********
* HORIZONTAL PLOT INVERSE
**********
SPACE 2
HPLOTI EQU *
* DE HAS CHAR. FWA
LD HL,(DMAA) HL HAS DISPLAY MEM. ADDR.
LD BC,0010H
LD A,(BP)
OR A
JP Z,FPLOTI X AND Y ON BOUNDARIES
AND 07H
JR NZ,HPI0
MHPI1 EQU * ONLY Y ON BOUNDARY
LD A,(DE) COMPLEMENT CHAR. DATA
CPL
LD (HL),A
DEC HL
DEC DE
DEC C
JP Z,H.ADV
LD A,L
INC A
JR NZ,MHPI1 CHECK FOR TOP OF SCREEN WRAP
BIT 0,H
JR Z,MHPI1 IF SET, ADJUST X FOR WRAP
INC H
INC H
SET 7,H
JR MHPI1 CONTINUE PLOTTING
*
HPI0 EQU * X AND Y OFF CHAR. BOUNDARIES
EXX
CALL MASKS
EXX
PUSH DE
POP IX IX HAS FWA OF CHAR. DATA
LD HL,(DMAA) DISPLAY MEMORY ADDR.
LD DE,(DMA1) DISPLAY MEMORY ADDR. NEXT COL.
LD B,10H LOOP COUNT
HPI1 EQU *
EXX
LD A,(BP)
AND 07H
LD B,A
LD A,(IX+0)
CPL
HPI2 EQU *
RLA
RL C
DJNZ HPI2
AND D
LD B,A
LD A,C
AND E
LD C,A
EXX
LD A,(HL)
EXX
AND E
OR B
EXX
LD (HL),A
LD A,(DE)
EXX
AND D
OR C
EXX
EX DE,HL
LD (HL),A
EX DE,HL
DEC DE
DEC HL
DEC IX
DJNZ HPI3
JP H.ADV
HPI3 EQU *
LD A,L
INC A
JR NZ,HPI1
BIT 0,H
JR Z,HPI1
INC H
INC H
SET 7,H
INC D
INC D
SET 7,D
JP HPI1
EJECT HORIZONTAL OVERSTRIKE WRITE
**********
* HORIZONTAL OVERSTRIKE WRITE
**********
SPACE 2
HPLOTOW EQU *
* DE HAS CHAR. FWA
LD HL,(DMAA) HL HAS DISPLAY MEM. ADDR.
LD BC,0010H
LD A,(BP)
OR A
JP Z,FPLOTOW X AND Y ON BOUNDARY
AND 07H
JR NZ,HPOW0
MHPOW1 EQU * ONLY Y ON BOUNDARY
LD A,(DE) CHAR. DATA .OR. WITH SCREEN
OR (HL)
LD (HL),A
DEC HL
DEC DE
DEC C
JP Z,H.ADV
LD A,L
INC A
JR NZ,MHPOW1 CHECK FOR TOP OF SCREEN WRAP
BIT 0,H
JR Z,MHPOW1 IF SET, ADJUST X FOR WRAP
INC H
INC H
SET 7,H
JR MHPOW1 CONTINUE PLOTTING
HPOW0 EQU * X AND Y OFF CHAR. BOUNDARIES
EXX
CALL MASKS
EXX
PUSH DE
POP IX IX HAS FWA OF CHAR. DATA
LD HL,(DMAA) DISPLAY MEMORY ADDR.
LD DE,(DMA1) DISPLAY MEMORY ADDR. NEXT COL.
LD B,10H LOOP COUNT
HPOW1 EQU *
EXX
LD A,(BP)
AND 07H
LD B,A
LD A,(IX+0)
HPOW2 EQU *
RLA
RL C
DJNZ HPOW2
AND D
LD B,A
LD A,C
AND E
LD C,A
EXX
LD A,(HL)
EXX
OR B
EXX
LD (HL),A
LD A,(DE)
EXX
OR C
EXX
EX DE,HL
LD (HL),A
EX DE,HL
DEC DE
DEC HL
DEC IX
DJNZ HPOW3
JP H.ADV
HPOW3 EQU *
LD A,L
INC A
JR NZ,HPOW1
BIT 0,H
JR Z,HPOW1
INC H
INC H
SET 7,H
INC D
INC D
SET 7,D
JP HPOW1
EJECT HORIZONTAL OVERSTRIKE ERASE
**********
* HORIZONTAL OVERSTRIKE ERASE
**********
SPACE 2
HPLOTOE EQU *
* DE HAS CHAR. FWA
LD HL,(DMAA) HL HAS DISPLAY MEM. ADDR.
LD BC,0010H
LD A,(BP)
OR A
JP Z,FPLOTOE X AND Y ON BOUNDARIES
AND 07H
JR NZ,HPOE0
MHPOE1 EQU * ONLY Y ON BOUNDARY
LD A,(DE) CHAR. DATA .OR. WITH SCREEN
CPL
AND (HL)
LD (HL),A
DEC HL
DEC DE
DEC C
JP Z,H.ADV
LD A,L
INC A
JR NZ,MHPOE1 CHECK FOR TOP OF SCREEN WRAP
BIT 0,H
JR Z,MHPOE1 IF SET, ADJUST X FOR WRAP
INC H
INC H
SET 7,H
JR MHPOE1 CONTINUE PLOTTING
HPOE0 EQU * X AND Y ON CHAR. BOUNDARIES
EXX
CALL MASKS
EXX
PUSH DE
POP IX IX HAS FWA OF CHAR. DATA
LD HL,(DMAA) DISPLAY MEMORY ADDR.
LD DE,(DMA1) DISPLAY MEMORY ADDR. NEXT COL.
LD B,10H LOOP COUNT
HPOE1 EQU *
EXX
LD A,(BP)
AND 07H
LD B,A
LD A,(IX+0)
CPL
HPOE2 EQU *
RLA
RL C
DJNZ HPOE2
AND D
OR E
LD B,A
LD A,C
AND E
OR D
LD C,A
EXX
LD A,(HL)
EXX
AND B
EXX
LD (HL),A
LD A,(DE)
EXX
AND C
EXX
EX DE,HL
LD (HL),A
EX DE,HL
DEC DE
DEC HL
DEC IX
DJNZ HPOE3
JP H.ADV
HPOE3 EQU *
LD A,L
INC A
JR NZ,HPOE1
BIT 0,H
JR Z,HPOE1
INC H
INC H
SET 7,H
INC D
INC D
SET 7,D
JP HPOE1
SPACE 2
**********
* HORIZONTAL ADVANCE
**********
SPACE 2
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 FPLOT NORMAL
**********
* FAST PLOT NORMAL VERTICAL
**********
SPACE 2
* THIS CHARACTER GENERATOR WORKS FOR VERTICAL
* CHARACTERS WHICH ARE ON THE X BOUNDARY.
* THE Y BOUNDARY WILL BE CHECKED DURING EXECUTION.
* VDMA1 AND VDMA2 ARE WRITTEN TO IN THAT ORDER.
* EACH IS DECREMENTED BY 1 AND SCREEN WRAP IS
* CHECKED. THIS IS REPEATED 8 TIMES FOR THE
* 16 BYTES MAKING UP THE CHARACTER.
SPACE 2
FVPLTN EQU *
LD B,08
* IX-LWA OF ROTATED CHAR DATA
LD HL,(VDMA1)
LD DE,(VDMA2)
FVN.0 EQU *
LD A,(IX+0)
LD (HL),A
LD A,(IX-1)
LD (DE),A
DEC B
JR Z,FVN.1
DEC IX
DEC IX
DEC HL
DEC DE
CALL V.WRAP
JR FVN.0
FVN.1 EQU *
CALL V.ADV
RET
EJECT FAST PLOT INVERSE VERTICAL
**********
* FAST PLOT INVERSE VERTICAL
**********
SPACE 2
* THIS CHARACTER GENERATOR WORKS FOR VERTICAL
* CHARACTERS WHICH ARE ON THE X BOUNDARY.
* THE Y BOUNDARY WILL BE CHECKED DURING EXECUTION.
* VDMA1 AND VDMA2 ARE WRITTEN TO IN THAT ORDER.
* EACH IS DECREMENTED BY 1 AND SCREEN WRAP IS
* CHECKED. THIS IS REPEATED 8 TIMES FOR THE
* 16 BYTES MAKING UP THE CHARACTER.
SPACE 2
FVPLTI EQU *
LD B,08
* IX-LWA OF ROTATED CHAR DATA
LD HL,(VDMA1)
LD DE,(VDMA2)
FVI.0 EQU *
LD A,(IX+0)
CPL
LD (HL),A
LD A,(IX-1)
CPL
LD (DE),A
DEC B
JR Z,FVI.1
DEC IX
DEC IX
DEC HL
DEC DE
CALL V.WRAP
JR FVI.0
FVI.1 EQU *
CALL V.ADV
RET
EJECT FAST OVERSTRIKE WRITE VERTICAL
**********
* FAST OVERSTRIKE WRITE VERTICAL
*********
SPACE 2
* THIS CHARACTER GENERATOR WORKS FOR VERTICAL
* CHARACTERS WHICH ARE ON THE X BOUNDARY.
* THE Y BOUNDARY WILL BE CHECKED DURING EXECUTION.
* VDMA1 AND VDMA2 ARE WRITTEN TO IN THAT ORDER.
* EACH IS DECREMENTED BY 1 AND SCREEN WRAP IS
* CHECKED. THIS IS REPEATED 8 TIMES FOR THE
* 16 BYTES MAKING UP THE CHARACTER.
SPACE 2
FVPLTOW EQU *
LD B,08
* IX-LWA OF ROTATED CHAR DATA
LD HL,(VDMA1)
LD DE,(VDMA2)
FVOW.0 EQU *
LD A,(IX+0)
OR (HL)
LD (HL),A
LD A,(IX-1)
EX DE,HL
OR (HL)
LD (HL),A
EX DE,HL
DEC B
JR Z,FVOW.1
DEC IX
DEC IX
DEC HL
DEC DE
CALL V.WRAP
JR FVOW.0
FVOW.1 EQU *
CALL V.ADV
RET
EJECT FAST OVERSTRIKE ERASE VERTICAL
**********
* FAST OVERSTRIKE ERASE VERTICAL
**********
SPACE 2
* THIS CHARACTER GENERATOR WORKS FOR VERTICAL
* CHARACTERS WHICH ARE ON THE X BOUNDARY.
* THE Y BOUNDARY WILL BE CHECKED DURING EXECUTION.
* VDMA1 AND VDMA2 ARE WRITTEN TO IN THAT ORDER.
* EACH IS DECREMENTED BY 1 AND SCREEN WRAP IS
* CHECKED. THIS IS REPEATED 8 TIMES FOR THE
* 16 BYTES MAKING UP THE CHARACTER.
SPACE 2
FVPLTOE EQU *
LD B,08
* IX-LWA OF ROTATED CHAR DATA
LD HL,(VDMA1)
LD DE,(VDMA2)
FVOE.0 EQU *
LD A,(IX+0)
CPL
AND (HL)
LD (HL),A
LD A,(IX-1)
EX DE,HL
CPL
AND (HL)
LD (HL),A
EX DE,HL
DEC B
JR Z,FVOE.1
DEC IX
DEC IX
DEC HL
DEC DE
CALL V.WRAP
JR FVOE.0
FVOE.1 EQU *
CALL V.ADV
RET
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 *
EX DE,HL MOVE CHARACTER DATA
LD DE,SAVE4F TO TEMPORARY STORE AREA
LD BC,0010H
LDDR
EX DE,HL
LD BC,0008
ADD HL,BC IX HAS LWA-8 OF CHAR. DATA
PUSH HL C RETAINS OUTER LOOP COUNT
POP IX
VERRT.0 EQU *
LD HL,SAVE5F FWA OF TEMPORARY CHAR. STORE
LD B,08
VERRT.1 EQU *
LD A,(IX+8)
RRA
LD (IX+8),A
RL (HL)
DEC HL
LD A,(IX+0)
RRA
LD (IX+0),A
RL (HL)
DEC HL
DJNZ VERRT.1 INNER LOOP 8 TIMES
DEC IX
DEC C
JR NZ,VERRT.0 OUTER LOOP 8 TIMES
LD HL,SAVE5F LOAD IX WITH LWA OF
PUSH HL OF ROTATED CHAR. DATA
POP IX FOR CHARACTER GENERATORS
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
RET
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
**********
VPLOTN EQU *
CALL VERRT ROTATE CHAR DATA TO SAVE5F
CALL VADR.ADJ ADJUST SCREEN ADDRESSES
LD A,(BP) FOR VERTICAL WRITING
AND 07
JP Z,FVPLTN ON X BOUNDARY, FAST PLOT
*
* OTHERWISE CHARACTER PLOTTING IS OVER THREE
* EIGHT BIT WORDS. ROW BY ROW, CHARACTER DATA
* ON THE SCREEN WITHIN THE RIGHTMOST AND LEFTMOST
* BYTES MUST BE LEFT UNDISTURBED WHILE THE NEW
* CHARACTER IS WRITTEN IN NORMAL MODE TO THE
* 16 BITS MAKING UP THE CHARACTER HEIGHT. THE
* RIGHT BYTE AND RIGHT OF MIDDLE BYTE ARE WRITTEN TO
* FIRST THEN THE LEFT BYTE AND LEFTMOST PART OF
* MIDDLE BYTE ARE WRITTEN TO ON A ROW BY ROW BASIS
* FOR THE 8 ROWS MAKING UP THE CHARACTER WIDTH.
*
EXX
CALL MASKS DE - MASKS FOR CHAR DATA
* AND DISPLAY WORDS
LD BC,0802H B-CHAR WIDTH COUNT, C-COLUMNS
EXX
LD HL,SAVE5F LWA OF VERTICAL CHAR DATA
PUSH HL
POP IX
LD HL,(DMAA) RIGHTMOST BYTE OF VERTICALS
LD DE,(VDMA1) MIDDLE BYTE OF VERTICALS
VNORM.0 EQU *
LD A,(BP)
AND 07
LD B,A
LD A,(IX+0)
VNORM.1 EQU *
RLA
RL C
DJNZ VNORM.1
EXX
AND D
EXX
LD B,A
LD A,(DE)
EXX
AND E
EXX
OR B
LD (DE),A
LD A,C
EXX
AND E
EXX
LD B,A
LD A,(HL)
EXX
AND D
EXX
OR B
LD (HL),A
EXX
DEC B REPEAT FOR CHAR WIDTH OF 8
JR Z,VNORM.2
EXX
DEC IX
DEC IX
DEC HL
DEC DE
CALL V.WRAP
JR VNORM.0
VNORM.2 EQU *
LD B,08 RESET INNER LOOP COUNT
DEC C
EXX
JR Z,VNORM.3
LD HL,(VDMA1) REPEAT FOR LEFTMOST BYTE
LD DE,(VDMA2) AND LEFT OF MIDDLE BYTE
LD BC,000DH
ADD IX,BC
JR VNORM.0
VNORM.3 EQU *
CALL V.ADV
RET
EJECT VERTICAL PLOT INVERSE
**********
* VERTICAL PLOT INVERSE
**********
SPACE 2
VPLOTI EQU *
CALL VADR.ADJ
CALL VERRT IX - LWA OF ROTATED CHAR DATA
LD A,(BP)
AND 07
JP Z,FVPLTI
*
* OTHERWISE CHARACTER PLOTTING IS OVER THREE
* EIGHT BIT WORDS. ROW BY ROW, CHARACTER DATA
* ON THE SCREEN WITHIN THE RIGHTMOST AND LEFTMOST
* BYTES MUST BE LEFT UNDISTURBED WHILE THE NEW
* CHARACTER IS WRITTEN IN NORMAL MODE TO THE
* 16 BITS MAKING UP THE CHARACTER HEIGHT. THE
* RIGHT BYTE AND RIGHT OF MIDDLE BYTE ARE WRITTEN TO
* FIRST THEN THE LEFT BYTE AND LEFTMOST PART OF
* MIDDLE BYTE ARE WRITTEN TO ON A ROW BY ROW BASIS
* FOR THE 8 ROWS MAKING UP THE CHARACTER WIDTH.
*
EXX
CALL MASKS DE - MASKS FOR CHAR DATA
* AND DISPLAY WORDS
LD BC,0802H B-CHAR WIDTH COUNT, C-COLUMNS
EXX
* IX-LWA ROTATED CHAR DATA
LD HL,(DMAA) RIGHTMOST BYTE OF VERTICALS
LD DE,(VDMA1) MIDDLE BYTE OF VERTICALS
VINV.0 EQU *
LD A,(BP)
AND 07
LD B,A
LD A,(IX+0)
CPL
VINV.1 EQU *
RLA
RL C
DJNZ VINV.1
EXX
AND D
EXX
LD B,A
LD A,(DE)
EXX
AND E
EXX
OR B
LD (DE),A
LD A,C
EXX
AND E
EXX
LD B,A
LD A,(HL)
EXX
AND D
EXX
OR B
LD (HL),A
EXX
DEC B REPEAT FOR CHAR WIDTH OF 8
JR Z,VINV.2
EXX
DEC IX
DEC IX
DEC HL
DEC DE
CALL V.WRAP
JR VINV.0
VINV.2 EQU *
LD B,08 RESET INNER LOOP COUNT
DEC C
EXX
JR Z,VINV.3
LD HL,(VDMA1) REPEAT FOR LEFTMOST BYTE
LD DE,(VDMA2) AND LEFT OF MIDDLE BYTE
LD BC,000DH
ADD IX,BC
JR VINV.0
VINV.3 EQU *
CALL V.ADV
RET
EJECT VERTICAL PLOT OVERSTRIKE WRITE
**********
* VERTICAL PLOT OVERSTRIKE WRITE
**********
SPACE 2
VPLOTOW EQU *
CALL VADR.ADJ
CALL VERRT IX - LWA OF ROTATED CHAR DATA
LD A,(BP)
AND 07
JP Z,FVPLTOW
*
* OTHERWISE CHARACTER PLOTTING IS OVER THREE
* EIGHT BIT WORDS. ROW BY ROW, CHARACTER DATA
* ON THE SCREEN WITHIN THE RIGHTMOST AND LEFTMOST
* BYTES MUST BE LEFT UNDISTURBED WHILE THE NEW
* CHARACTER IS WRITTEN IN NORMAL MODE TO THE
* 16 BITS MAKING UP THE CHARACTER HEIGHT. THE
* RIGHT BYTE AND RIGHT OF MIDDLE BYTE ARE WRITTEN TO
* FIRST THEN THE LEFT BYTE AND LEFTMOST PART OF
* MIDDLE BYTE ARE WRITTEN TO ON A ROW BY ROW BASIS
* FOR THE 8 ROWS MAKING UP THE CHARACTER WIDTH.
*
EXX
CALL MASKS DE - MASKS FOR CHAR DATA
* AND DISPLAY WORDS
LD BC,0802H B-CHAR WIDTH COUNT, C-COLUMNS
EXX
* IX-LWA OF ROTATED CHAR DATA
LD HL,(DMAA) RIGHTMOST BYTE OF VERTICALS
LD DE,(VDMA1) MIDDLE BYTE OF VERTICALS
VOW.0 EQU *
LD A,(BP)
AND 07
LD B,A
LD A,(IX+0)
VOW.1 EQU *
RLA
RL C
DJNZ VOW.1
EXX
AND D
EXX
EX DE,HL
OR (HL)
EX DE,HL
LD (DE),A
LD A,C
EXX
AND E
EXX
OR (HL)
LD (HL),A
EXX
DEC B REPEAT FOR CHAR WIDTH OF 8
JR Z,VOW.2
EXX
DEC IX
DEC IX
DEC HL
DEC DE
CALL V.WRAP
JR VOW.0
VOW.2 EQU *
LD B,08 RESET INNER LOOP COUNT
DEC C
EXX
JR Z,VOW.3
LD HL,(VDMA1) REPEAT FOR LEFTMOST BYTE
LD DE,(VDMA2) AND LEFT OF MIDDLE BYTE
LD BC,000DH
ADD IX,BC
JR VOW.0
VOW.3 EQU *
CALL V.ADV
RET
EJECT VERTICAL OVERSTRIKE ERASE
**********
* VERTICAL OVERSTRIKE ERASE
**********
SPACE 2
VPLOTOE EQU *
CALL VADR.ADJ
CALL VERRT IX - LWA OF ROTATED CHAR DATA
LD A,(BP)
AND 07
JP Z,FVPLTOE
*
* OTHERWISE CHARACTER PLOTTING IS OVER THREE
* EIGHT BIT WORDS. ROW BY ROW, CHARACTER DATA
* ON THE SCREEN WITHIN THE RIGHTMOST AND LEFTMOST
* BYTES MUST BE LEFT UNDISTURBED WHILE THE NEW
* CHARACTER IS WRITTEN IN NORMAL MODE TO THE
* 16 BITS MAKING UP THE CHARACTER HEIGHT. THE
* RIGHT BYTE AND RIGHT OF MIDDLE BYTE ARE WRITTEN TO
* FIRST THEN THE LEFT BYTE AND LEFTMOST PART OF
* MIDDLE BYTE ARE WRITTEN TO ON A ROW BY ROW BASIS
* FOR THE 8 ROWS MAKING UP THE CHARACTER WIDTH.
*
EXX
CALL MASKS DE - MASKS FOR CHAR DATA
* AND DISPLAY WORDS
LD BC,0802H B-CHAR WIDTH COUNT, C-COLUMNS
EXX
* IX-LWA OF ROTATED CHAR DATA
LD HL,(DMAA) RIGHTMOST BYTE OF VERTICALS
LD DE,(VDMA1) MIDDLE BYTE OF VERTICALS
VOE.0 EQU *
LD A,(BP)
AND 07
LD B,A
LD A,(IX+0)
CPL
VOE.1 EQU *
RLA
RL C
DJNZ VOE.1
EXX
AND D
OR E
EXX
EX DE,HL
AND (HL)
EX DE,HL
LD (DE),A
LD A,C
EXX
AND E
OR D
EXX
AND (HL)
LD (HL),A
EXX
DEC B REPEAT FOR CHAR WIDTH OF 8
JR Z,VOE.2
EXX
DEC IX
DEC IX
DEC HL
DEC DE
CALL V.WRAP
JR VOE.0
VOE.2 EQU *
LD B,08 RESET INNER LOOP COUNT
DEC C
EXX
JR Z,VOE.3
LD HL,(VDMA1) REPEAT FOR LEFTMOST BYTE
LD DE,(VDMA2) AND LEFT OF MIDDLE BYTE
LD BC,000DH
ADD IX,BC
JR VOE.0
VOE.3 EQU *
CALL V.ADV
RET
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
*
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
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
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
*
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
*
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
JR NZ,LOYCHK OTHERWISE, CHECK FOR LO Y
LD A,1FH HIGH=(CHAR-32)*32
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
*
CALL DIVBY2 OTHERWISE, SCALE BY
EX DE,HL BY FACTOR OF 2
CALL DIVBY2 TO SCALE INTO 511X511
EX DE,HL
PUSH HL SAVE X COORD.
LD HL,(BIAS) BIAS Y COORD.
ADD HL,DE
EX DE,HL
POP HL
RET
*
ERR EQU *
POP AF
RET
*
DIVBY2 EQU *
LD A,H
OR L
RET Z
LD A,H
AND 7FH
RRA
LD H,A
LD A,L
RRA
LD L,A
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 *
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
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 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 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 HL,(MOD7A) LOAD MODE 7 ADDRESS
JP (HL)
EJECT ASSEMBLE COMM LINE INPUT
* * * * * * * * * * * * * * * * * * * * *
*
* PROCESS INTERRUPT MASK AND ENABLR DEVICES
*
* INTERRUPT MASK
* BIT 0 SERIAL CHANNEL
* BIT 1 UNUSED
* BIT 2 UNUSED
* BIT 3 EXTERNAL DEVICE
* BIT 4 COMM LINE CHARACTER REQUEST
* BIT 5 TOUCH PANEL
* BIT 6 KEYBOARD
* BIT 7 COMM LINE CHARACTER READY
*
*
* * * * * * * * * * * * * * * * * * * * *
SPACE 1
ENAB EQU *
LD L,A SAVE CURRENT ENABLE BITS
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 68H MASK ENABLE BITS
OR 45H ENAB LONG INT, K/B AND SER CHN
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
JP CG.SEL SET UP (CG.ADR)
EJECT CHAR. GEN. SELECT
* * * * * * * * * * * * * * * * * * * * *
*
* CHARACTER GENERATOR SELECT
*
* THIS ROUTINE SELECTS THE CORRECT CHARACTER GENERATOR
* PLOT CHARACTERS DEPENDING ON HORIZONTAL OR VERTICAL P
* WEATHER CHARACTER STARTS ON BYTE BOUNDARY OR OFF SET,
* AND THE WRITE/ERASE BIT SETTING.
*
* * * * * * * * * * * * * * * * * * * * *
SPACE 2
CG.SEL EQU *
LD A,(M.MODE) LOAD WRITE/ERASE
AND 03 BITS FROM MODE SELECT.
LD C,A
LD A,(M.CCR) LOAD HOR/VERT BITS
SET 2,C
BIT 0,A TEST FOR HOR. OR VERT. PLOT
JR NZ,CGSEL1 JUMP IF VERT PLOT
RES 2,C ELSE CLEAR BIT FOR HORIZON
*
CGSEL1 EQU *
LD B,00 LOAD REGISTERS BC
SLA C FOR INDEX TO TABLE
LD HL,CG.TBL LOAD FWA OF TABLE
ADD HL,BC AND ADD INDEX
LD A,(HL) LOAD LOWER BITS OF CG ADDRES
LD (CG.ADR),A AND STORE
INC HL
LD A,(HL) LOAD UPPER BITS OF CG ADDRES
LD (CG.ADR+1),A AND STORE
RET
*
* CHARACTER GENERATOR ADDRESS TABLE
*
CG.TBL EQU *
DEFW HPLOTI HORIZONTAL PLOT INVERSE
DEFW HPLOTN HORIZONTAL PLOT NORMAL
DEFW HPLOTOE HORIZONTAL OVERSTRIKE ERASE
DEFW HPLOTOW HORIZONTAL OVERSTRIKE WRITE
DEFW VPLOTI
DEFW VPLOTN
DEFW VPLOTOE
DEFW VPLOTOW
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 *
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
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
LD A,L
AND 0F0H
LD L,A
LD A,01H
AND H
OR L
LD HL,BP
JR Z,OUTY1
RES 7,(HL)
JR INPY
OUTY1 SET 7,(HL)
*
* INPUT Y COORDINATE
*
INPY EQU *
LD HL,(YREG)
RET
EJECT OUTPUT Y COORDINATE
* * * * * * * * * * * * * * * * * * * * *
*
* SET NEW X COORDINATE
*
* * * * * * * * * * * * * * * * * * * * *
SPACE 1
OUTX EQU *
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 E,A
LD A,(BP)
AND 80H
OR E
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 *
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.
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 (BLKERS),A
BULKER1 IN A,(SYSSTAT) GET SYSTEM STATUS
RLCA
JR C,BULKER1 WAIT UNTIL BULK ERASE DONE
RET
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
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 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
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
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 * SINGLE QUOTE(STRAIGHT)
HEX 00,08,08,08
HEX 00,00,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
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
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
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
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
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
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 * SMALL REVERSE SLASH
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
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
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
HEX 00,00,21,21
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,0E,0E
HEX 0E,0E,00,0E
HEX 0E,0E,0E,00
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
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 * LEFT DOUBLE 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
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
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 * SINGLE QUOTE(STRAIGHT)
HEX 00,00,00,08
HEX 08,08,00,00
HEX 00,00,00,00
HEX 00,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 * VERTICAL BAR
HEX 00,00,00,08
HEX 08,08,08,08
HEX 08,08,08,08
HEX 00,00,00,00
M1CODE1F EQU * RIGHT 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
HEX 00,7F,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 * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
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 * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE26 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE27 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE28 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE29 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE2A EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE2B EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE2C EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE2D EQU * MATRIX MULTIPLY
HEX 00,00,00,00
HEX 00,00,0C,12
HEX 12,0C,00,00
HEX 00,00,00,00
M1CODE2E EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE2F EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE30 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE31 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE32 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE33 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE34 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE35 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE36 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE37 EQU * PAD
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
HEX FF,FF,FF,FF
M1CODE38 EQU * VECTOR CROSS PRODUCT
HEX 00,00,00,00
HEX 00,41,22,14
HEX 08,14,22,41
HEX 00,00,00,00
M1CODE39 EQU * RIGHT ACCENT MARK
HEX 00,20,10,08
HEX 00,00,00,00
HEX 00,00,00,00
HEX 00,00,00,00
M1CODE3A EQU * LEFT ACCENT MARK
HEX 00,02,04,08
HEX 00,00,00,00
HEX 00,00,00,00
HEX 00,00,00,00
M1CODE3B EQU * EMBEDDED RIGHT PAREN
HEX 00,00,00,01
HEX 02,04,0C,14
HEX 24,14,0C,06
HEX 01,00,00,00
M1CODE3C EQU * CEDILLA
HEX 00,00,00,00
HEX 00,00,00,00
HEX 00,00,00,20
HEX 10,08,00,00
M1CODE3D EQU * EMBEDDED LEFT PAREN
HEX 00,00,00,40
HEX 20,10,18,14
HEX 12,14,18,30
HEX 40,00,00,00
M1CODE3E EQU * MAD HAT
HEX 00,22,14,08
HEX 00,00,00,00
HEX 00,00,00,00
HEX 00,00,00,00
M1CODE3F 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
LENGTH2 EQU *-FWA2 END OF SECOND CHECKSUM AREA
EJECT BUFFERS AND DATA STORE AREAS
BEGVAR1 EQU * START OF FIRST VARIABLE AREA
****************************************
* USER BUFFER *
****************************************
USBUF DEFS 1 DIFFERENCE COUNT
DEFS 1 INPUT INDEX
DEFS 1 OUTPUT INDEX
DEFS 16 BUFFER STORE AREA
SPACE 2
****************************************
* RECEIVE BUFFER, JOB STACK *
****************************************
RXBUF EQU *
DEFS 1 DATA WORD COUNT
DEFS 1 INPUT INDEX
DEFS 1 OUTPUT INDEX
DEFS 256 BUFFER STORE AREA
SPACE 2
****************************************
* TRANSMIT BUFFER *
****************************************
TXBUF EQU *
DEFS 1 DATA WORD COUNT
DEFS 1 INPUT INDEX
DEFS 1 OUTPUT INDEX
DEFS 8 DATA STORE AREA
SPACE 2
****************************************
* DATA WORD STORE FOR PROCESSING*
****************************************
DWORD DEFS 5
SPACE 2
****************************************
* EXTERNAL DEVICE DATA STORE *
****************************************
EXTD DEFS 2 EXTERNAL DEVICE DATA
EJECT STACK/INTERRUPT TABLE/VARIABLES
ENDVAR1 EQU * END OF FIRST VARIABLE AREA
****************************************
* VARIABLES SET OR ACCESSED BY THE *
* ROM RESIDENT PROGRAM. *
* NOTE...THESE ADDRESSES MUST BE FIXED *
* AND THEIR VALUES CANNOT BE CHANGED *
* BY R.INIT *
****************************************
ORG 22D0H+OFFSET
CKSUMTBL DEFS 2 START ADDR OF CHECKSUM TABLE
CHECKSUM DEFS 1 CHECKSUM SET BY THE LOADER
LOADFLAG DEFS 1 3CH=CODE IS LOADED
RESETFLG DEFS 1 3CH=DO SIMPLE RESET
MODE DEFS 1 OPERATIONS AND MODE
****************************************
* PLATO VARIABLES *
* NOTE...THESE ADDRESSES MUST BE FIXED *
****************************************
ORG 22EAH+OFFSET
BEGVAR2 EQU * START OF SECOND VARIABLE AREA
M.VERS DEFS 1 CONTROLWARE VERSION - CHANGES
* WITH NEW PRODUCTION VERSION
M.TYPE DEFS 1 TERMINAL ID CODE
M.CLOCK DEFS 2 REAL TIME CLOCK
M.EXTPA DEFS 2 INTERNAL INT. PROC. ADDRESS
M.MARGIN DEFS 2 MARGIN USED FOR CR
M.JOBS DEFS 2 JOB STACK COUNT
M.CCR DEFS 2 CHARACTER PLOTTING PARAMETERS
M.MODE DEFS 2 TERMINAL OPERATING MODE
M.DIR DEFS 2 DIRECTION OF COORDINATE STEP
M.KSW DEFS 2 DEVICE INPUT DIRECTOR
M.ENAB DEFS 2 INTERNAL INTERRUPT MASK
DEFS 2 UNUSED
MOD5A DEFS 2 MODE 5 ADDRESS
MOD6A DEFS 2 MODE 6 ADDRESS
MOD7A DEFS 2 MODE 7 ADDRESS
MEM2 DEFS 2 M2 CHARACTER SET ADDRESS
MEM3 DEFS 2 M3 CHARACTER SET ADDRESS
MEM4 DEFS 2 M4 CHARACTER SET ADDRESS
MEM5 DEFS 2 M5 CHARACTER SET ADDRESS
MEM6 DEFS 2 M6 CHARACTER SET ADDRESS
MEM7 DEFS 2 M7 CHARACTER SET ADDRESS
EJECT
****************************************
* PROCESSOR STACK *
****************************************
DEFS 40H
ZSTACK EQU *
****************************************
* SCRATCH AREA *
****************************************
SPACE 2
SAVE1 DEFS 2
SAVE2 DEFS 12
SAVE8 DEFS 2
SAVE0F DEFS 16
SAVE1F DEFS 16
SAVE2F DEFS 16
SAVE3F DEFS 16
SAVE4F DEFS 16
SAVE5F DEFS 16
CURDATA DEFS 10 TEMP SAVE AREA FOR CURSOR DATA
EJECT CONTROLWARE VARIABLES
SPACE 2
****************************************
* 'CONTROLWARE 'VARIABLES *
****************************************
***********
* PLATO VARIABLES(NOT NECESSARILY PLATO UNIQUE)
***********
BLOCKX DEFS 2 BEGINNING X COORD. FOR MODE 4
BLOCKY DEFS 2 BEGINNING Y COORD. FOR MODE 4
XEND DEFS 2 ENDING X COORD FOR MODES 1,4
YEND DEFS 2 ENDING Y COORD FOR MODES 1,4
SAVEL DEFS 2 FOR BLOCK MODE
SAVER DEFS 2 FOR BLOCK MODE
* THE ABOVE TAGS MUST BE IN THIS ORDER FOR BLOCK MODE
BP DEFS 1 COORDINATE BIT POSITION
CG.ADR DEFS 2 CHARACTER GENERATOR ADDRESS
CHFWA DEFS 2 CHARACTER DATA FWA
CONFLG DEFS 1 CONVERT CHAR. DATA FLAG
DMAA DEFS 2 DISPLAY MEMORY ADDRESS
DMA1 DEFS 2 DISPLAY MEMORY ADDRESS + 200H
DMA2 DEFS 2 DISPLAY MEMORY ADDRESS + 400H
EXT.IN DEFS 1 EXT. DEVICE INPUT ADDRESS
EXT.OUT DEFS 1 EXT. DEVICE OUTPUT ADDRESS
LMASK DEFS 1 BLOCK MODE LEFT MASK
MEMREG DEFS 2 LOAD MEMORY ADDRESS
MEMSEL DEFS 2 CHARACTER MEMORY SELECT ADDR.
MODE4CNT DEFS 1 DATA WORD COUNT FOR MODE 4
MMASK DEFS 1 MIDDLE MASK FOR BLOCK MODE
NCHARS DEFS 1 CHARACTER CONVERSION COUNT
NDATAB DEFS 1 DATA WORD COUNT FOR MODE 2 CON
RMASK DEFS 1 RIGHT MASK FOR BLOCK MODE
SIZE DEFS 2 CHARACTER SIZE
VDMA1 DEFS 2 DMAA - 200H FOR VERTICAL CHAR.
VDMA2 DEFS 2 DMAA - 400H FOR VERTICAL CHAR.
VECFLG DEFS 1 VECTOR PARAMETER FLAG
XDELTA DEFS 2 X AXIS DELTA
XREG DEFS 2 CURRENT 9 BIT X COORD.
YDELTA DEFS 2 Y AXIS DELTA
YREG DEFS 2 CURRENT 9 BIT Y COORD.
**********
* 401X/PLATO VARIABLES
**********
SPACE 2
BIAS DEFS 2 BIAS OF Y COORD
BYPASS DEFS 1 BYPASS CONDITION FLAG
CHBASE DEFS 2 401X CHAR DATA BASE ADDR
CKSUM DEFS 1 IDLE RAM CHECKSUM
CKSUMADD DEFS 2 CURRENT CHECKSUM ADDRESS
CKSUMTAD DEFS 2 CURRENT CHECKSUM TABLE ADDRESS
CKSUMWC DEFS 2 CURRENT CHECKSUM WORD COUNT
CLK.1 DEFS 1 ERR PROTOCOL FLAG
CLK.2 DEFS 1 ERR PROTOCOL FLAG
CLOCK DEFS 2 BLINK CURSOR CLOCK
CMODE DEFS 1 COMMAND MODE
CRLFFG DEFS 1 CR/LF FLAG
CTLADR DEFS 2 CONTROL CODE BASE ADDR
CURSAVED DEFS 1 CURSOR DATA SAVED FLAG
DASH DEFS 1 DASH/SOLID VECT FLAG
DARK DEFS 1 FLAG FOR DARK VECTOR
DOTS DEFS 2 DOT MOVEMENT FOR GIN MODE
ESCADR DEFS 2 ESC SEQUENCE BASE ADDR
E.CNTR DEFS 1 ERR PROTOCOL FLAG
EREG DEFS 1 ERR PROTOCOL FLAG
ESEGLEN DEFS 1 ERASE SEGMENT LENGTH COUNT
G.CTLFLG DEFS 1 CTL MODE FLAG
G.ESC DEFS 1 ESCAPE FLAG
G.MEMSEL DEFS 2 BASE ADDR OF SEL CHAR SET
G.SIZE DEFS 1 CHARACTER SIZE
G.SUPCUR DEFS 1 UPPRESS CURSOR FLAG
G.TTYFLG DEFS 1 TTY CAPS LOCK FLAG
G.XREG DEFS 2 GIN CROSSHAIR X COORDINATE
G.YREG DEFS 2 GIN CROSSHAIR Y COORDINATE
GIN.KEY DEFS 1 GIN CHARACTER KEY
HEIGHT DEFS 1 CHARACTER HEIGHT
HIX DEFS 2 HIGH X BYTE
HIY DEFS 2 HIGH Y BYTE
LOX DEFS 1 LOW X BYTE
LOY DEFS 1 LOW Y BYTE
KBAADR DEFS 2 KEYBOARD TO ASCII CONVERT
KEYDATA DEFS 1 KEYBOARD DATA FLAG
LINEND DEFS 2 LINE END
LINT.CTR DEFS 1 LONG INTERVAL INT CTR (MOD 21)
LOC.RMT DEFS 1 LOCAL/REMOTE FLAG
MREG DEFS 1 ERR PROTOCOL FLAG
NBYTES DEFS 1 GET3 BYTE COUNT
NREG DEFS 1 ERR PROTOCOL FLAGS
PAGEND DEFS 2 PAGE END
SAVE DEFS 2 TEMPORARY STORAGE
SCALEFG DEFS 1 SCALE/NO SCALE FLAG
SH.SUP DEFS 1 ERR PROTOCOL FLAG
STATLINE DEFS 1 STATUS LINE ACTIVE FLAG
STATUS DEFS 4 STATUS LINE FLAGS
TSTAT DEFS 1 TERMINAL STATUS WORD FOR TEK.
VECFLAG DEFS 1
WEFLAG DEFS 1 CURSOR W/E FLAG
WIDTH DEFS 1 CHARACTER WIDTH FLAG
WSEGLEN DEFS 1 SEGMENT LENGTH
ENDVAR2 EQU * END OF SECOND VARIABLE AREA
FWA3 EQU * START OF THIRD CHECKSUM AREA
STRAP DEFW 0022H 401X MODE STRAP OPTIONS
SC.OC DEFB 7EH SER CH OUTPUT CONTROL WORD
EJECT
**********
* UNIMPLEMENTED OR UNDEFINED COMMANDS COME HERE
**********
TEMP EQU *
RET
**********
* 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,(MODE)
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
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
* ASCII OPERATIONS AND MAY BE OVERLAID BY
* USER PROGRAMS IF OPERATING ONLY IN PLATO OPERATIONS.
********************************************************
*********
* ASCII INITIALIZE
**********
AINIT EQU *
LD A,3 SET (M.KSW) TO PUT INPUT DATA
LD (M.KSW),A INTO THE USER BUFFER
LD HL,100 INITIALIZE BLINK COUNTER
LD (CLOCK),HL (BLINK 3 TIMES PER SECOND)
LD A,0B5H SET TERMINAL STATUS WORD
LD (TSTAT),A
LD HL,IGTASC SELECT IGT ASCII KEYBOARD
LD (KBAADR),HL
LD HL,CTLADR.A SELECT ASCII CTL TBL
LD (CTLADR),HL
LD HL,ESCADR.A SELECT ASCII ESC SEQ TBL
LD (ESCADR),HL
CALL ASIZE1 SELECT A0 CHARACTER SET
LD HL,0070H SET Y BIAS
LD (BIAS),HL
XOR A
LD (MODE),A SELECT ASCII OPERATIONS
LD (SCALEFG),A DO SCALE IN GRAPH MODE
LD HL,001EH SET ALPHA/OVERSTRIKE WRITE
CALL R.MODE
LD HL,256 PUT CROSSHAIR IN CENTER OF
LD (G.XREG),HL SCREEN
LD (G.YREG),HL
CALL AFF CLR SCREEN, HOME, SET ALPHA
RET
**********
* ASCII 401X IDLE LOOP
**********
AIDLE EQU * ASCII IDLE
* IN A,(EXTSTAT) CHECK FOR CARRIER
* BIT 4,A
* JR NZ,AIDLE0 JUMP IF CARRIER OFF
* LD A,0DFH CARRIER ON, SO
* OUT (PNLLTS),A CLEAR ERROR LIGHT
*
AIDLE0 EQU *
CALL R.EXEC TEST FOR RECEIVE/TRANSMIT DATA
CALL R.INPUT TEST FOR DATA FROM OPERATOR
LD E,L
LD D,H
ADD HL,HL TEST IF DATA FROM KB OR TP
JR C,AIDLE2 NO DATA, BLINK CURSOR
LD A,07 HAVE DATA
AND H
JR NZ,AIDLE1 JUMP IF NOT KEYBOARD DATA
CALL KEY PROCESS KEYBOARD DATA
JR AIDLE2
AIDLE1 XOR A
LD (KEYDATA),A CLEAR KEYBOARD DATA FLAG
LD A,06
AND H
CP 02
CALL Z,GIN.TP PROCESS TP DATA
* CALL Z,TOUCH PROCESS TP DATA
AIDLE2 EQU *
CALL BLINK BLINK THE CURSOR
JP IDLE
EJECT
**********
* ROUTINE TO BLINK THE CURSOR
**********
BLINK EQU *
LD A,(G.SUPCUR) IS THE CURSOR SUPPRESSED
OR A
RET NZ EXIT IF YES
LD HL,(CLOCK) DECREMENT BLINK COUNTER
DEC HL
LD (CLOCK),HL
LD A,L
OR H
RET NZ EXIT IF NOT ZERO YET
LD HL,100 RESET BLINK COUNTER
LD (CLOCK),HL
CALL CUR.SAVE SAVE CURSOR DATA IF NECESSARY
LD HL,WEFLAG TOGGLE CURSOR W/E FLAG
LD A,(HL)
XOR 01
LD (HL),A
ADD A,2 SET B=2 OR 3
LD B,A
LD C,60H
LD A,(MODE) TEST MODE
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
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
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 *
LD A,01 SET KEYBOARD DATA FLAG
LD (KEYDATA),A
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
KEY0 EQU *
LD HL,G.CTLFLG TEST FOR CTL AS
BIT 0,(HL) PREVIOUS KEY
JR Z,KEY3 NO, JUMP
RES 0,(HL) CLEAR CTL FLAG
LD A,C
CP 60H IS CODE 60H-7FH
JR C,KEY1 NO, JUMP
RET Z YES, IGNORE 60H CODE
CP 7BH IS CODE 7BH-7FH
RET NC YES, IGNORE CODE
SUB 60H CHANGE 61H-7AH TO 01H-1AH
JR KEY4
KEY1 EQU *
CP 40H IS CODE 40H-5FH
JR C,KEY2 NO, JUMP
AND 0FH YES, CHANGE 4X AND 5X TO 0X
JR Z,KEY4 40H AND 50H GENERATE 00H
CP 0BH IS CODE NOW 0BH-0FH
RET C NO, IGNORE
ADD A,10H YES CHANGE TO 1BH-1FH
JR KEY4
KEY2 EQU *
CP 20H IS CHAR A CTL CODE
JR C,XMTEST YES, PROCESS IT
CP 39H CTL 9
JR Z,SCALE
CP 3DH CTL =
JR Z,UNSCALE
CP 30H CTL 0
JR Z,ONLINE
CP 31H CTL 1
JR Z,OFFLINE
RET IGNORE OTHER CODES
KEY3 EQU * HAVE A NON-CONTROL CODE
LD A,(G.TTYFLG) IS ALL CAPS SELECTED
OR A
JR Z,XMTEST NO, JUMP
LD A,C IS CHAR 61H OR MORE
CP 61H
JR C,KEY4 NO, JUMP
CP 7BH YES, IS IT 7BH OR MORE
JR NC,KEY4 YES, JUMP
SUB 20H CONVERT 61H-7AH TO 41H-5AH
KEY4 EQU *
LD C,A SAVE MODIFIED CHAR IN C
XMTEST EQU *
LD A,(MODE)
CP 8
JP Z,GIN.KB DO GIN INPUT IF GIN MODE
CALL XMIT.1A TRANSMIT CHAR IF NOT LOCAL
CALL R.XJOB PROCESS DATA LOCALLY
RET
EJECT
**********
* THE FOLLOWING CONTROL KEY SEQUENCES PERFORM LOCAL FUNCTIONS
**********
OFFLINE EQU *
LD A,0DFH CLEAR ERR LIGHT
OUT (PNLLTS),A
LD A,01 SET LOCAL FLAG
JR OFFLINE1
*
ONLINE EQU *
XOR A CLEAR LOCAL FLAG
OFFLINE1 LD (LOC.RMT),A
RET
*
SCALE EQU *
XOR A SET SCALE FLAG
LD HL,0070H SCREEN BIAS VALUE
JR SCALE1
*
UNSCALE EQU *
LD A,01 CLEAR SCALE FLAG
LD HL,0000 SCREEN BIAS VALUE
SCALE1 LD (SCALEFG),A
LD (BIAS),HL
RET
SPACE 4
* * * * * * * * * * * * * * * * * * * *
* THE FOLLOWING KEYS PERFORM LOCAL 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.CTL
DEFW G.RESET
DEFW G.TTY
DEFW G.TTYLOK
DEFW G.PAGE
DEFW G.ERASE
* DEFW G.HELP
SPACE 4
*
G.CTL EQU *
LD A,01 SET CTL FLAG
LD (G.CTLFLG),A
RET
*
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.TTY EQU * CLEAR TTY FLAG
XOR A
JR G.TTY1
*
G.TTYLOK EQU *
LD A,01 SET TTY FLAG
G.TTY1 LD (G.TTYFLG),A
RET
*
G.ERASE EQU *
CALL BS BACKSPACE
LD BC,0100H B=W/E BITS, C=CHAR(SPACE)
CALL ACHARGEN DISPLAY THE SPACE
LD C,08
JP KEY0
*********
* 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,08 1X
HEX 83,FF,0D,0A
* HEX 83,86,0D,0A
HEX FF,7F,FF,80
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 82,86,0D,0A
HEX FF,7F,FF,80
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
EJECT
**********
* JUMP TABLE FOR ASCII MODE ESCAPE SEQUENCES
**********
ESCADR.A EQU *
DEFB 07H BEL
DEFW BEL
DEFB 08H BS
DEFW BS
DEFB 0DH CR
DEFW ESC
DEFB 02H STX
DEFW PINIT
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 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 1BH ESC
DEFW ESC
DEFB 0FFH END OF TABLE
**********
* JUMP TABLE FOR ASCII MODE CONTROL CODES
**********
CTLADR.A EQU *
DEFB 0DH CR
DEFW ACR
DEFB 0AH LF
DEFW ALF
DEFB 08H BS
DEFW BS
DEFB 1BH ESC
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 0FFH END OF TABLE
**********
* ROUTINES TO EXECUTE CONTROL CODES AND ESCAPE SEQUENCES
**********
BEL EQU *
LD A,01H SOUND AUDIBLE ALARM
OUT (MISCTL),A
XOR A CLEAR BYPASS
LD (BYPASS),A
RET
BS EQU *
CALL CUR.ERAS
XOR A CLEAR BYPASS
LD (BYPASS),A
CALL R.INPX MOVE X BACK ONE CHAR WIDTH
LD A,(WIDTH)
CPL
INC A
LD E,A
LD D,0FFH
ADD HL,DE
BIT 7,H IF X COORD NEGATIVE
JR NZ,BS.SCK GO CHECK CHAR SIZE
BS.END EQU *
CALL R.OUTX SET NEW X COORD
RET
BS.SCK EQU *
LD A,(G.SIZE) CHECK CHAR SIZE
OR A
JR NZ,BS.VT JUMP IF SIZE 2
DEC HL SUBT 2 FROM X, SINCE
DEC HL SIZE 1 USES ONLY 510 DOTS
BS.VT EQU *
LD A,L VT REQUIRED IF X NEG
CP 0F8H AND LOWER 8 BITS OF X ARE
JR NZ,BS.END 0F8H WITH SIZE 2 CHAR
CALL R.OUTX
CALL VT.1
RET
CAN EQU *
LD HL,BYPASS SET BYPASS
LD (HL),1
RET
ACR EQU *
CALL US.2 CLR CURSOR,SET ALPHA,CLR BYPASS
CALL CR.1 DO CARRIAGE RETURN
LD HL,(STRAP) TEST FOR AUTO CR/LF
BIT 3,L
RET Z RETURN IF NOT SET
LD A,(KEYDATA) RETURN IF NOT KEYBOARD DATA
OR A
RET Z
LD (CRLFFG),A SET SCROLL FLAG
CALL LF.1A DO A LINE FEED
CALL SCROLLCK SEE IF SCROLL REQUIRED
CALL SCROLLCL CLEAR SCROLL FLAG
RET
CR.1 EQU *
LD HL,0000H SET TO LEFT MARGIN
CALL R.OUTX
RET
ENQ EQU *
LD A,(MODE) IF NOT GIN MODE THEN
CP 8
JR Z,ENQ.1
LD A,(TSTAT) SEND TERMINAL STATUS
LD C,A
CALL XMIT.1A
ENQ.1 CALL R.INPX GET X COORD
CALL HILO AND SEND IN 2 BYTES
LD HL,(BIAS) SAVE -BIAS ON STACK
CALL COMPHL
PUSH HL
CALL R.INPY GET Y COORD
POP DE SUBT THE BIAS
ADD HL,DE
CALL HILO AND SEND IN 2 BYTES
LD HL,(STRAP) TEST GIN TRANSMISSION
BIT 1,L
JR Z,ENQ.2 JUMP IF SEND NOTHING AUTO
PUSH HL SAVE STRAP VALUE
LD C,0DH SEND CAR RET
CALL XMIT.1A
POP HL GET SAVED STRAP
BIT 2,L
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)
CP 8
RET NZ EXIT IF NOT GIN MODE
LD (HL),3 SET ALPHA MODE
RET
GIN.EXIT EQU *
LD A,(MODE) TEST MODE
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 H,04H LOAD INTERRUPT MASK
LD A,(M.ENAB)
AND 0D8H DISABLE TOUCH PANEL
LD L,A
CALL R.SSF
RET
HILO EQU *
LD A,(MODE) CHECK MODE
CP 8
JR NZ,HILO.2 NO BIAS IF NOT GIN MODE
INC HL BIAS FOR CENTER OF CROSSHAIR
INC HL
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
* CLEAR THE SCREEN AND HOME THE CURSOR
AFF EQU * PAGE GETS YOU HERE
CALL CUR.ERAS ERASE THE CURSOR
CALL BULKER DO BULK ERASE
AFF.1 EQU * RESET KEY GETS YOU HERE
CALL US.2 SET ALPHA, ENABLE CURSOR
CALL CR.1 CARRIAGE RETURN
CALL ALF.2 SET TO TOP LINE
RET
* 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,0B5H 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
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
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
* MOVE CURSOR DOWN ONE CHARACTER LINE.
ALF EQU *
CALL CUR.ERAS ERASE THE CURSOR
XOR A CLEAR BYPASS
LD (BYPASS),A
CALL LF.1A DO A LINE FEED
LD A,(KEYDATA) IS THIS KEYBOARD DATA
OR A
JR Z,LFSCROL JUMP IF NOT
LD HL,(STRAP) YES - TEST FOR AUTO. LF/CR
BIT 4,L
CALL NZ,CR.1 IF AUTO, DO CR
LFSCROL EQU *
CALL SCROLLCK
CALL SCROLLCL
RET
LF.1A EQU *
CALL R.INPY GET CURRENT Y
EX DE,HL STORE Y IN DE
LD HL,(PAGEND) CHECK FOR PAGEND
LD A,D
OR A
JR NZ,CHANGEY NOT PG BOTTOM.
LD A,E CHANGE Y ONLY.
CP L
JR C,ALF.2 PAGE BOTTOM REACHED
*
CHANGEY EQU *
EX DE,HL JUST CHANGE Y COORD
JR LF.3
*
ALF.2 EQU *
LD HL,200H SET Y TO PAGE TOP
*
LF.3 EQU *
LD A,(HEIGHT)
CPL
INC A A HAS -HEIGHT
LD E,A
LD D,0FFH
ADD HL,DE
CALL R.OUTY
RET
EJECT
* NONDESTRUCTIVE FORWARD SPACE CURSOR ONE CHARACTER POSITION
HTAB EQU *
CALL CUR.ERAS ERASE THE CURSOR
XOR A CLEAR BYPASS
LD (BYPASS),A
HTAB.1 EQU *
LD HL,(XREG) UPDATE X COORDINATE
LD A,(WIDTH)
LD E,A
LD D,0
ADD HL,DE
CALL R.OUTX
*
LINENDCK EQU *
CALL R.INPX GET CURRENT X
EX DE,HL IN DE
LD A,(G.SIZE) CHECK CHAR SIZE
OR A
JR Z,LEND.S1
LD A,E SIZE 2, SO CHECK X COORD.
OR D IF ZERO, IT HAS WRAPPED
JR Z,PGCHK SO DO CR/LF.
RET
*
LEND.S1 EQU *
LD HL,(LINEND) SIZE 1 AND X AT LINEND.
LD A,D DE HAS CURRENT X
CP H
RET C
JR NZ,PGCHK IF LINEND DO CR/LF
LD A,E RETURN, LINE FEED.
CP L OTHERWISE SIMPLY RETURN.
RET C
RET Z
LD HL,0000H
CALL R.OUTX
PGCHK EQU *
CALL CR.1
CALL LF.1A
LD A,(G.SUPCUR) TEST IF CURSOR ON
OR A
CALL Z,SCROLL SCROLL IF ON
CALL SCROLLCL
RET
*
SCROLLCK EQU *
LD A,(G.SUPCUR) TEST SUPPRESS CURSOR
OR A
RET NZ
LD A,(CRLFFG) TEST CR/LF SEQUENCE
OR A
CALL NZ,SCROLL
CALL SCROLLCL CLEAR SCROLL FLAG
RET
SCROLL EQU *
LD HL,0000H SET UP X1,Y1 AND X2,Y2
LD (BLOCKX),HL FOR ERASING A LINE
LD HL,(LINEND)
LD (XEND),HL
CALL R.INPY
LD (YEND),HL
EX DE,HL
LD HL,(HEIGHT)
DEC HL
ADD HL,DE
LD (BLOCKY),HL
LD A,(M.MODE) TEMP SAVE M.MODE
PUSH AF
LD L,00H SET ERASE BITS
CALL MODESET1
LD HL,BLOCKX ERASE THE LINE
CALL R.BLOCK
POP AF GET SAVED M.MODE
LD (M.MODE),A
LD A,(G.SIZE) TEST FOR SIZE 2 CHARS
OR A
RET NZ EXIT IF SIZE 2
CALL R.INPY SIZE 1, SO GET Y COORD
INC HL
INC HL ADD 2
CALL R.OUTY AND OUTPUT NEW Y
RET
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,509 85 CHARS PER LINE
LD (LINEND),HL 36 LINES PER PAGE
LD HL,PAGEND SET LINEND, PAGEND AND
LD (HL),22 HEIGHT ACCORDINGLY
LD HL,HEIGHT
LD (HL),14
LD HL,WIDTH
LD (HL),6
XOR A SET SIZE TO ZERO
LD (G.SIZE),A (SIZE 1 CHARS)
RET
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,511 64 CHARS PER LINE
LD (LINEND),HL 32 LINES PER PAGE
LD HL,PAGEND SET PAGEND,LINEND AND
LD (HL),0 HEIGHT ACCORDINGLY
LD HL,HEIGHT
LD (HL),16
LD HL,WIDTH
LD (HL),8
LD A,1 INDICATE SIZE 2 CHARS
LD (G.SIZE),A
RET
ASUB EQU *
CALL CUR.ERAS ERASE CURSOR
XOR A ENABLE CURSOR DISPLAY
LD (G.SUPCUR),A
INC A SET BYPASS
LD (BYPASS),A
LD H,04H LOAD INTERRUPT MASK
LD A,(M.ENAB)
OR 20H ENABLE TOUCH PANEL
LD L,A
CALL R.SSF
LD A,8 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
EJECT
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)
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
* MOVE CURSOR UP ONE CHARACTER LINE
AVT EQU *
CALL CUR.ERAS ERASE THE CURSOR
XOR A CLEAR BYPASS
LD (BYPASS),A
VT.1 EQU *
CALL R.INPY
LD A,(HEIGHT)
LD E,A
LD D,0
ADD HL,DE
LD A,(G.SIZE) IF SIZE 2, AUTO WRAP
OR A
JR NZ,VT.2
LD A,H SIZE 1, CHECK FOR PAGE TOP
CP 2 IF Y DOES NOT EXCEED 512,
JR C,VT.2 THEN DO A SIMPLE VT
LD HL,(PAGEND) OTHERWISE WRAP TO PAGE END
LD A,(HEIGHT) PAGEND MINUS HEIGHT
CPL
INC A
LD E,A
LD D,0FFH
ADD HL,DE
VT.2 EQU *
CALL R.OUTY
RET
*KERMIT, 401X DASHED VECTOR 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
RET Z IGNORE IF RUBOUT
SUB 20H BIAS CHAR
LD C,A
CALL SCROLLCL CLEAR SCROLL FLAG
LD A,(M.MODE) PUT W/E BITS IN B REG.
LD B,A
**********
* 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
CALL JMPHL CHGEN.S1 OR CHGEN.S2
CALL HTAB.1 MOVE TO NEXT CHAR POSITION
RET
CHGEN.S2 EQU * 8 BY 16 CHARS
EXX SET DATA MASK
LD L,00H
EXX
INC C GET CHAR+1
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
**********
* ASCII HORIZONTAL PLOT
**********
HPLOTA EQU *
LD HL,(DMAA)
LD DE,(DMA1)
LD A,(HEIGHT)
LD B,A
HPLOTA1 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,HPLOTA3
LD B,A
HPLOTA2 EQU * POSITION CHAR DATA
ADD HL,HL
DJNZ HPLOTA2
HPLOTA3 EQU *
EXX
LD A,(HL) MODIFY LEFT PART OF CHAR
EXX
XOR C
AND E
OR L
XOR C
EXX
LD (HL),A
LD A,(DE) MODIFY RIGHT PART OF CHAR
EXX
XOR C
AND D
OR H
XOR C
EXX
LD (DE),A
DEC DE UPDATE POINTERS
DEC HL
DEC IX
DEC B
RET Z EXIT IF ALL LINES DISPLAYED
LD A,L LOOP IF L NOT 0FFH
INC A
JR NZ,HPLOTA1
BIT 0,H LOOP IF H IS EVEN
JR Z,HPLOTA1
INC H COLUMN OVERFLOW
INC H
SET 7,H
INC D
INC D
SET 7,D
JR HPLOTA1
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
*
* * * * * * * * * * * * * * * * * * * *
GIN.KB EQU *
LD A,C IS CHAR A CR
CP 0DH
JR Z,GIN.XMT SEND LAST KEY IF YES
GIN.1 EQU *
LD A,C SAVE GIN CHAR KEY
LD (GIN.KEY),A
LD HL,1 ASSUME FINE GRID
BIT 5,A LOOK AT BIT 5
JR NZ,GIN.2 FINE GRID IF SET
ADD HL,HL COARSE GRID IF CLEAR
ADD HL,HL
GIN.2 LD (DOTS),HL SAVE GRID MOVEMENT VALUE
LD A,C GET SAVED CHAR CODE
AND 0DFH CLEAR BIT 5
LD B,A AND SAVE IN B REG
LD HL,MOVTAB SEARCH CURSOR MOVE TABLE
GIN.3 EQU * FOR THE CHAR
LD A,(HL)
CP 0FFH
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
* EJECT
** SELECT OR DESELECT STATUS LINE DISPLAY MODE
*G.HELP EQU *
* LD A,(MODE) IGNORE IF GIN MODE
* CP 8
* RET Z
*
* LD HL,STATLINE
* LD A,(HL) TOGGLE STATUS LINE FLAG
* XOR 20H
* LD (HL),A
* LD B,A
* LD H,04H ENABLE OR DISABLE TOUCH PANEL
* LD A,(M.ENAB)
* RES 5,A
* OR B
* LD L,A
* CALL R.SSF
*
* LD A,(STATLINE) IF STATUS LINE SELECTED
* OR A
* JR NZ,DSTAT THEN DISPLAY IT
*
** CLEAR STATUS LINE
** CLEARS FROM Y=14 THROUGH Y=27 ACROSS ENTIRE SCREEN
*STAT.ERS EQU *
* LD H,80H
*STAT.ER1 EQU *
* INC H
* LD D,H
* LD L,0E4H
* LD E,0E5H
* LD BC,13
* LD (HL),0
* LDIR
* INC H
* JR NZ,STAT.ER1
* RET
*
** INTERPRET WHAT TO DO WITH TOUCH PANEL DATA
*TOUCH EQU *
* LD A,(MODE) ARE WE IN GIN MODE
* CP 8
* JP Z,GIN.TP YES, HANDLE AS GIN INPUT
*
** 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 SET BC=X COORD DIV 2
* RLCA
* RLCA
* RLCA
* AND 7
* CP 4 IGNORE TOUCH IF X TOO LARGE
* RET NC
* 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,DSTAT
* LD (HL),A RESET IF OVERFLOW
*
** DISPLAY THE CURRENT VALUES ON THE STATUS LINE
*DSTAT EQU *
* CALL CUR.ERAS ERASE THE CURSOR
* CALL R.INPX SAVE XY AND SET TO
* LD (G.XREG),HL STATUS LINE VALUES
* CALL R.INPY
* LD (G.YREG),HL
* LD HL,6
* CALL R.OUTX
* LD HL,14
* CALL R.OUTY
* CALL STAT.ERS ERASE STATUS LINE
* LD HL,STATUS
* PUSH HL
* LD C,4
* 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 *
* LD A,(DE) GET FIRST CHAR OF THE FIELD
* PUSH BC NOW DISPLAY THE WORD
* PUSH HL
*
*DSTAT5 EQU *
* LD C,A CHAR TO C
* LD B,1 SET W/E BITS IN B FOR REWRITE
* PUSH DE
* CALL ACHARGEN DISPLAY THE CHAR
* POP DE
* INC DE
* LD A,(DE)
* OR A
* JR NZ,DSTAT5
*
*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
* LD HL,(G.XREG) RETURN SAVED X AND Y POS.
* CALL R.OUTX
* LD HL,(G.YREG)
* CALL R.OUTY
* RET
*
** DATA FOR STATUS LINE FIELDS
*STATTBL EQU *
* DEFW LNLOCMSG
* DEFB 2
* DEFW BAUDMSG
* DEFB 2
* DEFW SCALEMSG
* DEFB 2
* DEFW CAPSMSG
* DEFB 2
*
*LNLOCMSG EQU *
* HEX 2C,29,2E,25,00 LINE
* HEX 2C,2F,23,21,2C,00 LOCAL
*BAUDMSG EQU *
* HEX 11,12,10,10,00 1200
* HEX 13,10,10,00 300
*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
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
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
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
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
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
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
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
LENGTH3 EQU *-FWA3 END OF THIRD CHECKSUM AREA
END
$EOF