User Tools

Site Tools


plato:source:plaopl:aist2

Table of Contents

AIST2

Table Of Contents

Source Code

AIST2.txt
  1. AIST2
  2. IDENT AIST2
  3. *WIDTH 62
  4. ORG 0040H
  5. OFFSET EQU *-40H
  6. SPACE 15
  7. * ASCII IST2 CONTROLWARE
  8. SPACE 2
  9. * VERSION 00
  10. SPACE 4
  11. * COPYRIGHT CONTROL DATA CORPORATION 1979
  12. * FOR INTERNAL USE ONLY
  13. * NOT A RELEASED PRODUCT
  14. EJECT
  15. SPACE 2
  16. *
  17. * INPUT FUNCTION CODES
  18. *
  19. MNTSW EQU 00 MAINTAINENCE SWITCHES
  20. KBDATA EQU 01 KEY BOARD DATA
  21. TPDATA EQU 02 TOUCH PANEL DATA
  22. IDLO EQU 03 ID CODE, LOWER 8 BITS
  23. IDUP EQU 04 ID CODE, UPPER 8 BITS
  24. EXTDATI EQU 05 INPUT EXTERNAL DEVICE DATA
  25. EXTSTAT EQU 06 INPUT EXTERNAL DEVICE STATUS
  26. SYSSTAT EQU 07 TERMINAL INTERNAL STATUS
  27. CLADATA EQU 08 COMMUNICATIONS LINE DATA
  28. *
  29. * OUTPUT FUNCTION CODES
  30. *
  31. PNLLTS EQU 00 MAINTENANCE PANEL LIGHTS
  32. CLAL EQU 01 OUTPUT LOWER DATA BITS
  33. CLAU EQU 02 OUTPUT UPPER DATA BITS
  34. BLKERS EQU 03 DISPLAY BULK ERASE
  35. INTMSK EQU 04 SYSTEM INTERRUPT MASK
  36. MISCTL EQU 05 MISCELLANEOUS CONTROL
  37. EXTDATO EQU 06 OUTPUT EXTERNAL DATA
  38. EXTCNTO EQU 07 OUTPUT EXTERNAL CONTROL
  39. *
  40. EJECT EXTERNAL EQUATES
  41. SPACE 5
  42. * USER JUMP TABLE ADDRESSES
  43. SPACE 2
  44. FWA1 EQU * START OF FIRST CHECKSUM AREA
  45. R.INIT JP INIT
  46. R.DOT JP POINT
  47. R.LINE JP LINE
  48. R.CHARS JP CHARS
  49. R.BLOCK JP BLOCK
  50. R.INPX JP INPX
  51. R.INPY JP INPY
  52. R.OUTX JP OUTX
  53. R.OUTY JP OUTY
  54. R.XMIT JP TX.STOR
  55. R.MODE JP MODESET
  56. R.STEPX JP STEPX
  57. R.STEPY JP STEPY
  58. R.WE JP WE
  59. R.DIR JP DIR
  60. R.INPUT JP INPUT
  61. R.SSF JP SSF0
  62. R.CCR JP CCR
  63. R.EXTOUT JP EXTX
  64. R.EXEC JP EXEC
  65. R.GJOB JP GJOB
  66. R.XJOB JP XJOB
  67. R.RETURN JP RETURN
  68. R.CHRCV JP CONVERT
  69. EJECT
  70. ORG 00F0H+OFFSET
  71.  
  72. CKSMTBST EQU *
  73. DEFW FWA1 ENTRY POINTS AND CKSM TABLE
  74. DEFW LENGTH1
  75. DEFW FWA2 COMMON RESIDENT CODE
  76. DEFW LENGTH2
  77. DEFW FWA3 401X UNIQUE CODE
  78. DEFW LENGTH3
  79. DEFW 0 END OF TABLE
  80. DEFW 0 (LENGTH = 0)
  81.  
  82. LENGTH1 EQU *-FWA1 END OF FIRST CHECKSUM AREA
  83. *
  84. * INTERRUPT VECTOR TABLE
  85. * LOWER 8 BITS OF INTERRUPT VECTOR FIXED AT 00
  86. * UPPER 8 BITS INITIALIZED IN PROGRAM TO (100H+OFFSET)/100H.
  87. *
  88. ORG 0100H+OFFSET
  89.  
  90. SERCHAN DEFS 2 SERIAL CHANNEL
  91. CLACRDY DEFS 2 CLA CHAR READY
  92. CLACREQ DEFS 2 CLA CHARACTER REQUEST
  93. KYBRD DEFS 2 KEYBOARD DATA
  94. THPNL DEFS 2 TOUCH PANEL
  95. SINTERV DEFS 2 SHORT INTERVAL
  96. EXTCH DEFS 2 EXTERNAL CHANNEL
  97. LINTERV DEFS 2 LONG INTERVAL
  98.  
  99. FWA2 EQU * START OF SECOND CHECKSUM AREA
  100.  
  101. EJECT TERMINAL INITIALIZATION
  102. * * * * * * * * * * * * * * * * * * * * *
  103. *
  104. * TERMINAL INITIALIZATION
  105. *
  106. * * * * * * * * * * * * * * * * * * * * *
  107.  
  108. * ASCII 401X AND PLATO INITIALIZE
  109. INIT EQU *
  110. DI DISABLE INTERRUPTS
  111. LD A,0DFH CLEAR TEST MODE, ENABLE RAM
  112. OUT (PNLLTS),A SET DTR, CLEAR ERR LIGHT
  113.  
  114. LD SP,ZSTACK SET STACK POINTER
  115. LD HL,CKSMTBST PRESET CHECKSUM TABLE
  116. LD (CKSUMTBL),HL ADDRESS
  117.  
  118. LD A,(RESETFLG) IS THIS A SIMPLE RESET
  119. XOR 3CH
  120. JR NZ,INIT1 JUMP IF NO
  121.  
  122. * INITIALIZE AFTER SIMPLE RESET
  123. IN A,(EXTSTAT) IS CARRIER ON
  124. BIT 4,A
  125. JR NZ,INIT1 JUMP IF NO (DO FULL INIT)
  126.  
  127. LD A,(MODE) ARE WE IN PLATO MODE
  128. RLCA
  129. JR NC,INIT0 JUMP IF ASCII MODE
  130. CALL SENDNAK PLATO, SO SEND NAK SEQUENCE
  131. LD HL,0382H SEND RESET STATUS TO PLATO
  132. CALL R.XMIT
  133. INIT0 EQU *
  134. CALL INIT3 INIT INTS AND CHECKSUM
  135. JP IDLE
  136.  
  137. * INITIALIZE AFTER LOAD
  138. INIT1 EQU *
  139. XOR A SET ASCII MODE
  140. LD (MODE),A
  141. LD A,3CH SET SIMPLE RESET FLAG
  142. LD (RESETFLG),A
  143. LD A,01 SOUND BEEPER
  144. OUT (MISCTL),A
  145.  
  146. LD HL,BEGVAR1 CLEAR VARIABLE SCRATCH AREA
  147. LD (HL),0
  148. LD DE,BEGVAR1+1
  149. LD BC,ENDVAR1-BEGVAR1-1
  150. LDIR
  151. LD HL,BEGVAR2
  152. LD (HL),0
  153. LD DE,BEGVAR2+1
  154. LD BC,ENDVAR2-BEGVAR2-1
  155. LDIR
  156.  
  157. LD HL,SERCHN LOAD INTERRUPT VECTORS
  158. LD (SERCHAN),HL
  159. LD HL,KYBD
  160. LD (KYBRD),HL
  161. LD HL,TP
  162. LD (THPNL),HL
  163. LD HL,EXTI
  164. LD (EXTCH),HL
  165. LD HL,LINT
  166. LD (LINTERV),HL
  167. LD HL,EXTI0
  168. LD (M.EXTPA),HL
  169.  
  170. CALL INIT3 INIT INTS AND CHECKSUM
  171. CALL AINIT ASCII INIT
  172.  
  173. LD A,(VERSION) SET CONTROLWARE VERSION
  174. LD (M.VERS),A
  175. LD HL,0000H SELECT M0/FWD/SIZE 1/HOR PLOT
  176. CALL R.CCR AND CLEAR UNCOVER FLAG
  177.  
  178. LD HL,M.TYPE SET TERMINAL TYPE
  179. IN A,(MNTSW) GET SWITCHES 6(TP PRESENT)
  180. LD B,A AND 5(32K) AND PUT INTO
  181. AND 60H BITS 5 AND 4 OF M.TYPE
  182. RRCA
  183. OR 07H SET ASCII TERMINAL TYPE
  184. LD (HL),A IN BITS 3..0
  185. LD A,B GET SWITCHES AGAIN
  186. AND 03H GET KB/TP AND TEST BITS
  187. CP 02H IF NO TEST BUT KB/TP
  188. JR NZ,INIT2
  189.  
  190. SET 6,(HL) SET EXPERIMENTAL BIT
  191. LD HL,16 AND DISPLAY
  192. CALL R.OUTY .EXPERIMENTAL VERSION NN.
  193. LD HL,160 MESSAGE
  194. CALL R.OUTX
  195. LD HL,EXP
  196. CALL R.CHARS
  197.  
  198. INIT2 EQU *
  199. LD HL,0 DISPLAY
  200. CALL R.OUTY .TERMINAL READY.
  201. LD HL,184 MESSAGE
  202. CALL R.OUTX
  203. LD HL,TRMRDY
  204. CALL R.CHARS
  205. LD HL,VER DISPLAY VERSION NO.
  206. CALL R.CHARS
  207.  
  208. CALL AFF.1 HOME CURSOR
  209. JP IDLE
  210.  
  211. INIT3 EQU *
  212. LD HL,100H+OFFSET SET INT. TABLE ADDRESS
  213. LD A,H (UPPER BITS)
  214. LD I,A INTO INT. VECTOR
  215. IM 2 SET FOR MODE 2 INTERRUPTS
  216. LD HL,0445H ENABLE KEYBOARD, LONG INTERVAL
  217. CALL R.SSF AND SERIAL CHANNEL INTERRUPTS.
  218. LD A,(SC.OC) ENABLE CHAR READY INTERRUPT.
  219. OUT (EXTCNTO),A
  220. CALL CHKSUM.I INITIALIZE MEMORY CHECKSUM
  221. EI
  222. RET
  223. EJECT
  224. **********
  225. * PLATO INITIALIZE
  226. **********
  227. PINIT EQU *
  228. LD A,80H SET PLATO OPERATIONS
  229. LD (MODE),A
  230. XOR A SET (M.KSW) TO PUT INPUT DATA
  231. LD (M.KSW),A INTO THE TRANSMIT BUFFER
  232. LD HL,ISTASC SELECT PLATO/ASCII KEYBOARD
  233. LD (KBAADR),HL
  234. LD HL,CTLADR.P SELECT PLATO CTL TBL
  235. LD (CTLADR),HL
  236. LD HL,ESCADR.P SELECT PLATO ESC SEQ TBL
  237. LD (ESCADR),HL
  238. LD HL,00 NO GRAPH MODE SCREEN BIAS
  239. LD (BIAS),HL
  240. LD A,01 DO NOT SCALE
  241. LD (SCALEFG),A
  242. LD (BYPASS),A SET BYPASS
  243. LD HL,232
  244. CALL R.OUTX POSITION AT 232,32
  245. LD HL,32
  246. CALL R.OUTY
  247. LD L,00 SET HOR/MEM0/SIZE1/FWD
  248. CALL R.CCR
  249. LD L,1AH SET ALPHA/REWRITE MODE
  250. CALL R.MODE
  251. LD HL,MSG DISPLAY PLATO MESSAGE
  252. CALL R.CHARS
  253.  
  254. LD A,01 SET ERROR PROTOCOL TO STATE 0
  255. LD (EREG),A
  256. LD A,20 INIT WORD COUNTER
  257. LD (E.CNTR),A
  258. LD C,06H SEND ACK
  259. CALL XMIT.1
  260. LD C,0+20H SEND 0 (WORD COUNT)
  261. CALL XMIT.1
  262. RET
  263.  
  264. *PLATO MESSAGE
  265. MSG EQU *
  266. HEX 50,4C,41,54,4F,3F,00
  267.  
  268. *EXPERIMENTAL VERSION XX MESSAGE
  269. EXP EQU *
  270. HEX 45,18,10,05
  271. HEX 12,09,0D,05
  272. HEX 0E,14,01,0C
  273. HEX 2D,56,05,12
  274. HEX 13,09,0F,0E
  275. HEX 2D,1B,1B 00(CHANGES WITH EACH ASSEMBLY)
  276. HEX 3F,00
  277.  
  278. *TERMINAL READY MESSAGE
  279. TRMRDY EQU *
  280. HEX 54,05,12,0D
  281. HEX 09,0E,01,0C
  282. HEX 2D,52,05,01
  283. HEX 04,19,3F,00
  284.  
  285. *VERSION (CHANGE WITH NEW PRODUCTION BINARY)
  286. VER EQU *
  287. HEX 2D,1B,1B 00
  288. HEX 3F,00
  289.  
  290. * BLOCK FAILURE MESSAGE
  291. BLKFAIL EQU *
  292. HEX 42,0C,0F,03,0B,2D
  293. HEX 46,01,09,0C,15,12,05,3F,00
  294.  
  295. VERSION DEFB 00 00
  296. EJECT
  297. * * * * * * * * * * * * * * * * * * * *
  298. *
  299. * LONG INTERVAL INTERRUPT PROCESSOR
  300. *
  301. * * * * * * * * * * * * * * * * * * * *
  302. LINT EQU *
  303. PUSH AF
  304. PUSH BC
  305. PUSH DE
  306. PUSH HL
  307.  
  308. LD A,(M.ENAB) CLEAR LONG INTERVAL INT.
  309. LD B,A
  310. RES 2,A
  311. OUT (INTMSK),A
  312. LD A,B REENABLE LONG INTERVAL INT.
  313. OUT (INTMSK),A
  314.  
  315. LD HL,LINT.CTR INCREMENT LONG INT. CNTR.
  316. INC (HL)
  317. LD A,(HL)
  318. CP 21 HAVE 21 COUNTS GONE BY
  319. JP NZ,R.RETURN NO, JUST EXIT
  320.  
  321. LD (HL),0 YES, RESET CNTR.
  322. LD HL,(M.CLOCK) AND INCREMENT (M.CLOCK)
  323. INC HL
  324. LD (M.CLOCK),HL
  325. JP R.RETURN
  326. EJECT
  327. EJECT
  328. * * * * * * * * * * * * * * * * * * * *
  329. *
  330. * SERIAL CHANNEL INTERRUPT PROCESSOR
  331. *
  332. * * * * * * * * * * * * * * * * * * * *
  333. SERCHN EQU *
  334. PUSH AF
  335. PUSH BC
  336. PUSH DE
  337. PUSH HL
  338.  
  339. IN A,(EXTSTAT) INPUT SERIAL CHAN STATUS
  340. RRA TEST FOR INTERRUPT PENDING
  341. JP NC,R.RETURN NONE, RETURN TO PROCESSING
  342.  
  343. RRA TEST FOR CHAR RDY
  344. RRA
  345. JR NC,SERCHN1 NOT RDY, SERCHN1
  346.  
  347. *CHARACTER READY
  348. IN A,(EXTDATI) INPUT DATA
  349. LD C,A
  350. LD A,(MODE) IF PLATO OPERATIONS THEN
  351. RLCA
  352. JR NC,SERCHN0
  353. CALL ERRCHK CALL PLATO ERROR PROTOCOL
  354. JP C,R.RETURN EXIT IF CHAR TO BE IGNORED
  355. SERCHN0 EQU *
  356. RES 7,C MASK TO 7 BITS
  357. LD HL,RXBUF RECEIVE BUFFER ADDRESS
  358. LD A,0FFH LOAD MASK FOR INDEX
  359. CP (HL) TEST FOR FULL BUFF
  360. JP Z,R.RETURN FULL,RETURN
  361. INC (HL) INCREMENT DIFF COUNT
  362. INC HL STEP TO INPUT INDEX
  363. AND (HL) INDEX TO REG A
  364. INC (HL) INCREMENT INPUT INDEX
  365. INC HL STEP TO START OF
  366. INC HL STORE AREA
  367. LD E,A ADD INDEX
  368. LD D,00
  369. ADD HL,DE
  370. LD (HL),C STORE DATA
  371. LD HL,M.JOBS INCREMENT (M.JOBS)
  372. INC (HL)
  373. JP R.RETURN
  374.  
  375. SERCHN1 EQU *
  376. RLA TEST FOR CHAR REQ
  377. JP NC,R.RETURN NO CHAR REQ, RETURN
  378.  
  379. *CHARACTER REQUEST
  380. IN A,(EXTSTAT) CHECK FOR CLEAR TO SEND
  381. BIT 5,A
  382. JR Z,SERCHN2 JUST EXIT IF CTS OFF
  383.  
  384. LD HL,TXBUF LOAD ADDRESS OF TRANSMIT BUFF
  385. XOR A TEST FOR EMPTY
  386. OR (HL) BUFFER
  387. JR Z,SERCHN2 NO DATA, SERCHN2
  388.  
  389. DEC (HL) DECREMENT DIFFERENCE COUNT
  390. INC HL STEP TO
  391. INC HL OUT INDEX
  392. LD A,07 LOAD MASK FOR INDEX
  393. AND (HL) GET INDEX
  394. INC (HL) INCREMENT INDEX
  395. INC HL STEP TO STORE AREA
  396. LD E,A ADD INDEX TO
  397. LD D,00 START OF STORE AREA
  398. ADD HL,DE
  399. LD A,(HL) LOAD DATA TO TRANSMIT
  400. OUT (EXTDATO),A OUTPUT DATA
  401.  
  402. SERCHN2 EQU *
  403. LD A,(SC.OC) TURN OFF CHAR REQ INT
  404. OUT (EXTCNTO),A
  405. JP R.RETURN RETURN TO PROCESSING
  406. EJECT
  407. * * * * * * * * * * * * * * * * * * * * *
  408. *
  409. * KEY BOARD INTERRUPT PROCESSOR
  410. *
  411. * * * * * * * * * * * * * * * * * * * * *
  412. SPACE 1
  413. KYBD EQU *
  414. PUSH AF
  415. PUSH BC
  416. PUSH DE
  417. PUSH HL
  418. SPACE 1
  419. IN A,(KBDATA) INPUT KEY BOARD DATA
  420. AND 7FH MASK FOR DATA BITS
  421. LD L,A LOAD KEYBOARD DATA
  422. LD H,40H OP CODE AND CATAGORY
  423. CALL FIFO.ST AND STORE FOR TRANSMIT
  424. JR RETURN
  425. SPACE 4
  426. * * * * * * * * * * * * * * * * * * * * *
  427. *
  428. * TOUCH PANEL INTERRUPT PROCESSOR
  429. *
  430. * * * * * * * * * * * * * * * * * * * * *
  431. SPACE 1
  432. TP EQU *
  433. PUSH AF
  434. PUSH BC
  435. PUSH DE
  436. PUSH HL
  437. SPACE 1
  438. IN A,(TPDATA) INPUT TOUCH PANEL DATA
  439. LD L,A LOAD TOUCH PANEL DATA
  440. LD H,41H OP CODE AND CATAGORY
  441. CALL FIFO.ST AND STORE FOR TRANSMIT
  442. LD A,01
  443. OUT (MISCTL),A
  444. JR RETURN RETURN TO INTERRUPTED PROCES
  445. EJECT EXTERNAL INTERRUPT PROCESSOR
  446. * * * * * * * * * * * * * * * * * * * * *
  447. *
  448. * EXTERNAL CHANNEL INTERRUPT PROCESSOR
  449. *
  450. * * * * * * * * * * * * * * * * * * * * *
  451. SPACE 1
  452. EXTI EQU *
  453. PUSH AF
  454. PUSH BC
  455. PUSH DE
  456. PUSH HL
  457. *
  458. LD HL,(M.EXTPA) LOAD PROCESSOR ADDR.
  459. JP (HL)
  460. *
  461. EXTI0 EQU *
  462. LD A,(EXT.IN) LOAD EXTERNAL DEVICE ADDRESS
  463. LD C,A
  464. AND 1CH TEST FOR SERIAL OR PARALLEL
  465. LD A,C
  466. JR Z,EXTI1
  467. ADD A,1DH ADD BITS FOR PARALLEL
  468. *
  469. EXTI1 EQU *
  470. ADD A,03
  471. LD C,A
  472. IN L,(C) INPUT FROM EXTERNAL CHANNEL
  473. LD H,82H LOAD OP CODE AND USER/PLATO
  474. CALL FIFO.ST AND STORE FOR TRANSMIT
  475. SPACE 4
  476. * * * * * * * * * * * * * * * * * * * * *
  477. *
  478. * RESTORE ALL REGISTERS AND ENABLE INTERRUPTS
  479. *
  480. * * * * * * * * * * * * * * * * * * * * *
  481. SPACE 1
  482. RETURN EQU *
  483. POP HL
  484. POP DE
  485. POP BC
  486. POP AF
  487. EI ENABLE SYSTEM INTERRUPTS
  488. RET
  489. EJECT
  490. * * * * * * * * * * * * * * * * * * * *
  491. *
  492. * STORE DATA FROM INPUT DEVICES (KEYBOARD, TOUCH
  493. * PANEL OR EXTERNAL DEVICE) INTO EITHER THE TRANSMIT
  494. * BUFFER OR THE USER BUFFER DEPENDING ON (M.KSW)
  495. *
  496. * ON ENTRY, DATA IS IN HL
  497. * H7=1 FOR CATEGORY 2 DATA (EXT)
  498. * H6=1 FOR CATEGORY 1 DATA (KB OR TP)
  499. *
  500. * * * * * * * * * * * * * * * * * * * *
  501. FIFO.ST EQU *
  502. LD A,0C0H GET CATEGORY BITS
  503. AND H
  504. RLCA PUT CATEGORY BITS IN LOWER
  505. RLCA BITS
  506. LD B,A AND SAVE IN B REGISTER
  507. LD A,(M.KSW) CHECK FOR TRANSMIT/USER
  508. AND B
  509. JP Z,R.XMIT
  510.  
  511. US.STOR EQU *
  512. LD E,L DE = HL WITH UPPER BITS CLEAR
  513. LD A,H
  514. AND 03H
  515. LD D,A
  516. LD HL,USBUF
  517. LD A,07H TEST FOR FULL BUFFER
  518. CP (HL)
  519. RET Z BUFFER FULL, RETURN TO CALLER
  520.  
  521. INC (HL) NOT FULL, INCREMENT DIFF CNTR
  522. INC HL POINT TO INPUT POINTER
  523. AND (HL) GET LOWER BITS
  524. RLCA AND SET FOR TWO BYTE ADDRESS
  525. INC (HL) INCREMENT POINTER
  526. LD B,0 PUT INDEX IN BC
  527. LD C,A
  528. INC HL POINT TO START OF BUFFER AREA
  529. INC HL
  530. ADD HL,BC INDEX INTO BUFFER
  531. LD (HL),E STORE DATA LOWER BITS
  532. INC HL
  533. LD (HL),D STORE DATA UPPER BITS
  534. RET
  535. EJECT
  536. * * * * * * * * * * * * * * * * * * * *
  537. *
  538. * MAIN IDLE LOOP
  539. *
  540. * * * * * * * * * * * * * * * * * * * *
  541. IDLE EQU *
  542. CALL CHKSUM CHECKSUM MEMORY DURING IDLE
  543. JR NZ,BLOCKF JUMP IF BAD CHECKSUM
  544. LD A,(MODE) TEST FOR OPERATING MODE
  545. RLCA
  546. JP NC,AIDLE ASCII IDLE IF BIT 7 CLEAR
  547.  
  548. **********
  549. * PLATO OPERATIONS IDLE LOOP
  550. **********
  551. PIDLE EQU *
  552. LD A,(EREG) CHECK TIME OUT
  553. AND 04 IF COMM ERROR STATE
  554. CALL NZ,TIMOUT
  555. CALL R.EXEC TEST FOR RECEIVE OR XMIT DATA
  556. JR IDLE LOOP TO IDLE
  557.  
  558. **********
  559. * PLATO COMMUNICATIONS ERROR STATE TIME OUT
  560. **********
  561. TIMOUT EQU *
  562. LD A,(CLK.1) HAS TIME OUT EXPIRED
  563. ADD A,1
  564. LD (CLK.1),A
  565. RET NC
  566. LD A,(CLK.2)
  567. INC A
  568. LD (CLK.2),A
  569. SUB 20H
  570. RET NZ NO, EXIT
  571.  
  572. XOR A YES, RESET TIME OUT
  573. LD (CLK.1),A
  574. LD (CLK.2),A
  575. LD C,95H SEND NAK
  576. CALL XMIT.1
  577. LD A,(MREG) SEND WC+20H
  578. ADD A,20H
  579. LD C,A
  580. CALL XMIT.1
  581. RET
  582.  
  583. **********
  584. * DISPLAY .BLOCK FAILURE. MESSAGE
  585. * TERMINAL MUST BE RESET TO RECOVER
  586. **********
  587. BLOCKF EQU *
  588. LD HL,400
  589. CALL R.OUTX
  590. LD HL,256
  591. CALL R.OUTY
  592. LD HL,BLKFAIL
  593. CALL R.CHARS
  594. BLOCKF1 JR BLOCKF1 HANG
  595. EJECT
  596. **********
  597. * EXECUTE RECEIVE AND TRANSMIT DATA UNTIL RECEIVE BUFFER
  598. * IS EMPTY.
  599. **********
  600. EXEC EQU *
  601. LD A,(LOC.RMT) CHECK FOR LOCAL
  602. OR A
  603. JR NZ,EXEC1 JUMP IF YES
  604.  
  605. IN A,(EXTSTAT) CHECK FOR CARRIER
  606. BIT 4,A
  607. JR Z,EXEC1 JUMP IF ON
  608.  
  609. LD A,0DEH SET ERROR LIGHT
  610. OUT (PNLLTS),A
  611.  
  612. EXEC1 EQU *
  613. LD A,(M.JOBS) TEST FOR RECEIVE DATA
  614. OR A
  615. CALL NZ,PROCESS
  616.  
  617. LD A,(TXBUF) TEST FOR TRANSMIT DATA
  618. OR A
  619. JR Z,EXEC2 NO DATA, JUMP
  620. IN A,(EXTSTAT) TEST FOR CHAR REQ
  621. BIT 1,A
  622. JR Z,EXEC2 JUMP IF OFF
  623. LD A,(SC.OC) ENEBLE CHAR REQ INT
  624. INC A
  625. OUT (EXTCNTO),A
  626.  
  627. EXEC2 EQU *
  628. LD A,(M.JOBS) CHECK FOR RECEIVE DATA AGAIN
  629. OR A
  630. JR NZ,EXEC LOOP IF MORE
  631. RET
  632. **********
  633. * FETCH A BYTE FROM THE RECEIVE BUFFER.
  634. * ON EXIT, THE BYTE IS IN THE C-REGISTER.
  635. **********
  636. GJOB EQU *
  637. LD HL,M.JOBS DECREMENT (M.JOBS)
  638. DEC (HL)
  639. LD HL,RXBUF
  640. DEC (HL) DECREMENT DIFF COUNT
  641. INC HL STEP TO OUT
  642. INC HL
  643. LD A,0FFH MASK OUT INDEX WITH BUFF LEN
  644. AND (HL) DATA IN A REG
  645. INC (HL) INCREMENT OUT INDEX
  646. INC HL BEGIN OF DATA STORE
  647. LD E,A
  648. LD D,00
  649. ADD HL,DE
  650. LD C,(HL) DATA TO C REGISTER
  651. RET
  652. EJECT
  653. **********
  654. * PROCESS A CHARACTER TAKEN FROM RECEIVE BUFFER
  655. **********
  656. PROCESS EQU *
  657. CALL R.GJOB GET NEXT CHAR
  658.  
  659. **********
  660. * EXECUTE CHARACTER IN THE C-REGISTER
  661. **********
  662. XJOB EQU *
  663. CALL ESCCTL CHECK FOR ESC SEQ OR CTL CODE
  664. RET C EXIT IF YES
  665.  
  666. LD A,(CMODE) TEST FOR COMMAND MODE ACTIVE
  667. OR A
  668. JR Z,XJOB.DAT JUMP IF NOT
  669.  
  670. XJOB.CMD EQU *
  671. LD HL,SELECT.C-2 SELECT COMMAND TABLE
  672. JR XJOB1 AND JUMP VIA (CMODE)
  673.  
  674. XJOB.DAT EQU *
  675. LD A,(BYPASS) CHECK BYPASS
  676. OR A
  677. RET NZ IGNORE DATA IF BYPASS ON
  678.  
  679. LD A,(MODE) JUMP VIA (MODE)
  680. ADD A,A
  681. LD HL,SELECT.D SELECT DATA TABLE
  682.  
  683. XJOB1 EQU *
  684. LD E,A INDEX INTO SELECTED TABLE
  685. LD D,0
  686. ADD HL,DE SELECT.C OR SELECT.D
  687. LD E,(HL) GET JUMP ADDRESS
  688. INC HL
  689. LD D,(HL)
  690. EX DE,HL
  691. JMPHL EQU *
  692. JP (HL) JUMP VIA HL
  693.  
  694. SELECT.C EQU * COMMAND JUMP TABLE
  695. DEFW LDC
  696. DEFW SSF
  697. DEFW LDE
  698. DEFW LDA
  699. DEFW EXT
  700.  
  701. SELECT.D EQU * DATA JUMP TABLE
  702. DEFW APOINT MODE 0
  703. DEFW GRAPH MODE 1
  704. DEFW MEMORY MODE 2
  705. DEFW CHARACT MODE 3
  706. DEFW ABLOCK MODE 4
  707. DEFW MODE5 MODE 5
  708. DEFW MODE6 MODE 6
  709. DEFW MODE7 MODE 7
  710. DEFW TEMP MODE 8
  711.  
  712. EJECT
  713. * * * * * * * * * * * * * * * * * * * *
  714. * CHECK FOR AND EXECUTE ESCAPE SEQUENCES OR CONTROL CODES.
  715. * ON ENTRY, THE CHARACTER TO BE EXECUTED IS IN THE C-REG.
  716. * ON EXIT, CARRY IS SET IF CHARACTER WAS A CONTROL CODE
  717. * OR THE SECOND CHARACTER OF AN ESCAPE SEQUENCE.
  718. * OTHERWISE CARRY IS CLEAR ON EXIT.
  719. * * * * * * * * * * * * * * * * * * * *
  720. ESCCTL EQU *
  721. LD A,(G.ESC) TEST FOR ESCAPE FLAG SET
  722. OR A
  723. JR Z,CTLCK JUMP IF NOT SET
  724. XOR A CLEAR FLAG
  725. LD (G.ESC),A
  726.  
  727. EX.ESC EQU *
  728. LD HL,(ESCADR) SEARCH FOR ESC SEQ MATCH
  729. JR CTLEXEC
  730.  
  731. CTLCK EQU *
  732. LD A,C TEST FOR CONTROL CODE
  733. CP 20H
  734. RET NC NOT A CTL CODE, RETURN
  735.  
  736. XOR A
  737. LD (CMODE),A CLEAR COMMAND MODE
  738. LD (NBYTES),A CLEAR NBYTES COUNTER
  739.  
  740. EX.CTL EQU *
  741. LD HL,(CTLADR) SEARCH FOR CONTROL CODE MATCH
  742.  
  743. CTLEXEC EQU *
  744. CALL SEARCH EXECUTE CHAR
  745. SCF SET CARRY FLAG
  746. RET
  747. *
  748. SEARCH EQU *
  749. LD A,(HL) IF FF REACHED, NO MATCH
  750. CP 0FFH
  751. RET Z IGNORE CHAR IF NOT FOUND
  752.  
  753. SEARCH1 EQU *
  754. CP C
  755. JR Z,MATCH CHECK FOR CHAR MATCH
  756. INC HL CONTINUE SEARCHING
  757. INC HL
  758. INC HL
  759. JR SEARCH
  760.  
  761. MATCH EQU *
  762. CP 0DH IS CHAR A CR
  763. JR NZ,MATCH1 NO, JUMP
  764. LD (CRLFFG),A YES, SET SCROLL FLAG
  765. JR MATCH2
  766.  
  767. MATCH1 EQU *
  768. CP 0AH IS CHAR A LF
  769. JR Z,MATCH2 YES, JUMP
  770. CALL SCROLLCL NO, CLEAR SCROLL FLAG
  771. MATCH2 EQU *
  772. INC HL
  773. LD E,(HL)
  774. INC HL MATCH, JUMP TO BUILD COMMAND
  775. LD D,(HL)
  776. EX DE,HL
  777. LD DE,M.CCR
  778. JP (HL)
  779. *
  780. SCROLLCL EQU *
  781. XOR A CLEAR SCROLL FLAG
  782. LD (CRLFFG),A
  783. RET
  784. EJECT
  785. **********
  786. * CONVERT KEYBOARD CODE IN E REG TO ASCII CODE IN C REG.
  787. * ON EXIT, THE ZERO FLAG IS SET IF THE KEY IS UNDEFINED.
  788. * FOR DEFINED KEYS, THE ZERO FLAG IS CLEAR.
  789. **********
  790. KBCON EQU *
  791. LD D,00
  792. LD HL,(KBAADR)
  793. ADD HL,DE
  794. LD A,(HL)
  795. LD C,A
  796. CP 0FFH
  797. RET
  798. *
  799. ISTASC EQU *
  800. HEX 30,31,32,33 0X
  801. HEX 34,35,36,37
  802. HEX 38,39,26,60
  803. HEX 0A,5E,2B,2D
  804. HEX 13,04,07,08 1X
  805. HEX 7B,0B,0D,1A
  806. HEX 02,12,01,03
  807. HEX 7D,0C,FF,FF
  808. HEX 3C,3E,5B,5D 2X
  809. HEX 24,25,5F,7C
  810. HEX 2A,28,40,27
  811. HEX 1C,5C,23,7E
  812. HEX 17,05,14,19 3X
  813. HEX 7F,09,1E,18
  814. HEX 0E,1D,11,16
  815. HEX 00,0F,FF,FF
  816. HEX 20,61,62,63 4X
  817. HEX 64,65,66,67
  818. HEX 68,69,6A,6B
  819. HEX 6C,6D,6E,6F
  820. HEX 70,71,72,73 5X
  821. HEX 74,75,76,77
  822. HEX 78,79,7A,3D
  823. HEX 3B,2F,2E,2C
  824. HEX 1F,41,42,43 6X
  825. HEX 44,45,46,47
  826. HEX 48,49,4A,4B
  827. HEX 4C,4D,4E,4F
  828. HEX 50,51,52,53 7X
  829. HEX 54,55,56,57
  830. HEX 58,59,5A,29
  831. HEX 3A,3F,21,22
  832. EJECT
  833. **********
  834. * 'THE FOLLOWING ROUTINE TRANSFERS DATA IN HL TO THE
  835. * TRANSMIT BUFFER. KEYBOARD DATA IS CONVERTED TO ASCII.
  836. * THE SPECIAL SEQUENCE OF SHIFT-SUP(ETB) FOLLOWED BY
  837. * SHIFT-STOP(DC1) IS DETECTED AND CAUSES THE TERMINAL
  838. * TO PERFORM AN ASCII MODE INITIALIZATION.
  839. **********
  840. TX.STOR EQU *
  841. LD E,L SAVE DATA IN DE
  842. LD D,H
  843. ADD HL,HL IS THIS KYBD DATA
  844. LD A,07H
  845. AND H
  846. JR NZ,TX.STOR3 NO, JUMP
  847.  
  848. CALL KBCON CONVERT CHAR TO ASCII IN C
  849. RET Z IGNORE UNDEFINED KEYS
  850. LD A,17H IS CODE AN ETB
  851. CP C
  852. JR Z,TX.STOR1 YES, JUMP
  853.  
  854. LD A,(SH.SUP) NO, IS SH.SUP FLAG SET
  855. OR A
  856. JR Z,TX.STOR2 NO, JUMP
  857.  
  858. XOR A CLEAR SH.SUP FLAG
  859. LD (SH.SUP),A
  860. LD A,11H IS CODE A DC1
  861. CP C
  862. JR NZ,TX.STOR2 NO, JUMP
  863.  
  864. XOR A YES, SET ASCII MODE
  865. LD (MODE),A
  866. JP R.INIT DO ASCII INITIALIZE
  867.  
  868. TX.STOR1 EQU *
  869. LD A,1 SET SH.SUP FLAG
  870. LD (SH.SUP),A
  871.  
  872. TX.STOR2 EQU *
  873. CALL XMIT.1 SEND THE CHAR
  874. RET AND EXIT.
  875.  
  876. TX.STOR3 EQU * NOT KYBD DATA, SO
  877. PUSH DE
  878. LD C,1BH SEND ESC CODE
  879. CALL XMIT.1
  880. POP DE
  881. LD A,3FH SEND LOWER 6 BITS
  882. AND E
  883. ADD A,40H
  884. LD C,A
  885. PUSH DE
  886. CALL XMIT.1
  887. POP HL SEND UPPER 4 BITS
  888. ADD HL,HL
  889. ADD HL,HL
  890. LD A,H
  891. AND 0FH
  892. ADD A,40H
  893. LD C,A
  894. CALL XMIT.1
  895. RET AND EXIT.
  896.  
  897. **********
  898. * STORE CHAR FROM C-REGISTER INTO TRANSMIT BUFFER.
  899. **********
  900. XMIT.1A EQU * ASCII MODE ENTRY
  901. LD A,(LOC.RMT)
  902. OR A
  903. RET NZ JUST EXIT IF LOCAL
  904.  
  905. XMIT.1 EQU * PLATO MODE ENTRY
  906. IN A,(EXTSTAT) CHECK FOR CLEAR TO SEND
  907. BIT 5,A
  908. JR Z,XMIT.3 JUST EXIT IF CTS OFF
  909.  
  910. LD HL,TXBUF TEST FOR FULL BUFFER
  911. LD A,07H
  912. CP (HL)
  913. JR C,XMIT.1 JUMP IF FULL
  914.  
  915. INC (HL) NOT FULL, INC DIFF CNT
  916. INC HL POINT TO INPUT INDEX
  917. AND (HL) GET IT
  918. INC (HL) AND INCREMENT IT
  919. INC HL POINT TO BUFFER AREA
  920. INC HL
  921. LD E,A ADD THE INPUT INDEX
  922. LD D,00H
  923. ADD HL,DE
  924. LD A,(MODE) CHECK ASCII/PLATO MODE
  925. RLCA
  926. LD A,C
  927. JR NC,XMIT.2 SKIP PARITY IF ASCII
  928. OR A PLATO, SO SET EVEN PARITY
  929. JP PE,XMIT.2
  930. XOR 80H
  931. XMIT.2 EQU *
  932. LD (HL),A STORE DATA IN TXBUF
  933. XMIT.3 EQU *
  934. LD A,(SC.OC) SET CREQ ENABLE
  935. INC A
  936. OUT (EXTCNTO),A
  937. RET
  938. EJECT
  939. **********
  940. * ROUTINE TO CHECKSUM RAM DURING IDLE TIME.
  941. * ON EXIT, ZERO FLAG IS SET IF CHECKSUM IS PROCEEDING OK.
  942. * IF THERE IS A CHECKSUM ERROR, THE ZERO FLAG IS CLEAR.
  943. **********
  944. CHKSUM EQU *
  945. LD DE,(CKSUMADD) GET CURRENT ADDRESS
  946. LD HL,(CKSUMWC) GET CURRENT WORD COUNT
  947. LD A,(CKSUM) GET CURRENT CHECKSUM
  948. LD C,A
  949. LD B,100 SET COUNTER
  950.  
  951. CHKSUM1 EQU *
  952. LD A,L ARE WE DONE WITH THIS PART
  953. OR H
  954. JR Z,CHKSUM4 YES, JUMP
  955.  
  956. LD A,(DE) ADD BYTE TO CHECKSUM
  957. ADD A,C
  958. LD C,A
  959. INC DE
  960. DEC HL
  961. DJNZ CHKSUM1 LOOP IF COUNT NOT EXPIRED
  962.  
  963. CHKSUM2 EQU *
  964. LD (CKSUMADD),DE SAVE CURRENT ADDRESS
  965. LD (CKSUMWC),HL SAVE CURRENT WORD COUNT
  966. LD A,C SAVE CURRENT CHECKSUM
  967. LD (CKSUM),A
  968. XOR A SET ZERO FLAG
  969. RET
  970.  
  971. CHKSUM4 EQU *
  972. LD HL,(CKSUMTAD) GET CURRENT TABLE ADDRESS
  973. LD E,(HL) DE = NEW ADDRESS
  974. INC HL
  975. LD D,(HL)
  976. INC HL
  977. LD A,(HL) BA = NEW WORD COUNT
  978. INC HL
  979. LD B,(HL)
  980. INC HL
  981. LD (CKSUMTAD),HL SAVE PLACE IN TABLE
  982. LD L,A HL = BA = NEW WORD COUNT
  983. LD H,B
  984. OR B IS BYTE COUNT = 0
  985. JR NZ,CHKSUM2 NO, CONTINUE
  986.  
  987. CHKSUM5 EQU * END OF TABLE FOUND
  988. LD A,(CHECKSUM) DOES CHECKSUM AGREE
  989. CP C
  990. PUSH AF SAVE TEST RESULT
  991. CALL CHKSUM.I REINITIALIZE
  992. POP AF GET SAVED TEST RESULT
  993. RET
  994.  
  995. CHKSUM.I EQU *
  996. XOR A INITIALIZE FOR CHECKSUM
  997. LD C,A COMPUTATION
  998. LD (CKSUM),A
  999. LD HL,(CKSUMTBL)
  1000. LD (CKSUMTAD),HL
  1001. JR CHKSUM4
  1002. EJECT
  1003. **********
  1004. * 'THIS ROUTINE PERFORMS PLATO ERROR RECOVERY PROTOCOL DURING
  1005. * TRANSFERS FROM THE DSN NETWORK TO THE TERMINAL.
  1006. * 'THE PROTOCOL UTILIZES EVEN PARITY ON EACH CHARACTER
  1007. * TRANSFERRED AND ALSO A MODULO 96 WORD COUNT ON THE
  1008. * BLOCK. 'THE FIRST CHARACTER RECEIVED IS AN ACK CODE
  1009. * FOLLOWED BY A WORD COUNT BYTE FOLLOWED BY THE REST OF
  1010. * THE DATA. 'THE TERMINAL SENDS AN ACK,WC AFTER EACH 20TH
  1011. * BYTE RECEIVED UNLESS A PARITY ERROR HAS OCCURRED IN WHICH
  1012. * CASE A NAK,WC IS SENT IMMEDIATELY.
  1013. * 'THE C REGISTER CONTAINS THE DATA BYTE ON ENTRY.
  1014. * 'ON EXIT, CARRY=1 SAYS TO IGNORE THE CHARACTER.
  1015. **********
  1016. ERRCHK EQU *
  1017. LD A,06H IF CHAR=ACK THEN
  1018. CP C
  1019. JR NZ,E001
  1020. LD A,(EREG) SET ACK FLAG
  1021. OR 80H
  1022. LD (EREG),A
  1023. SCF
  1024. RET AND EXIT(IGNORE)
  1025.  
  1026. E001 LD A,(EREG) ELSE IF STATE=0
  1027. RRA (INITIAL STATE) THEN
  1028. JR NC,E100
  1029. LD A,C IF CHAR PARITY OK
  1030. OR A
  1031. JP PO,E006
  1032. LD A,(EREG) AND ACK FLAG=1 THEN
  1033. RLA
  1034. JR NC,E006
  1035. E002 EQU *
  1036. LD A,0DFH CLEAR ERR LIGHT
  1037. OUT (PNLLTS),A
  1038. LD A,C IF (CHAR AND 7FH) >= 20H
  1039. AND 7FH
  1040. SUB 20H
  1041. JP M,E003
  1042. LD (MREG),A THEN SAVE BIASED CHAR
  1043. LD (NREG),A AT M AND N
  1044. LD A,02H AND SET STATE=1
  1045. LD (EREG),A (EXPECTING DATA)
  1046. E003 EQU *
  1047. LD A,(EREG) CLEAR ACK FLAG
  1048. AND 0FH
  1049. LD (EREG),A
  1050. SCF AND EXIT(IGNORE)
  1051. RET
  1052.  
  1053. E006 EQU *
  1054. LD A,(EREG) ELSE CLEAR ACK FLAG
  1055. AND 0FH
  1056. LD (EREG),A
  1057. RET AND EXIT(OK)
  1058.  
  1059. E100 EQU *
  1060. RRA IF NOT STATE 1 THEN JUMP
  1061. JP NC,E200
  1062. LD A,C IF CHAR PARITY OK THEN JUMP
  1063. OR A
  1064. JP PE,E104
  1065.  
  1066. SENDNAK EQU *
  1067. LD A,0DEH SET ERR LIGHT
  1068. OUT (PNLLTS),A
  1069. XOR A SET STATE=2(ERROR)
  1070. OR 04H AND CLEAR ACK FLAG
  1071. LD (EREG),A
  1072. LD C,95H SEND NAK
  1073. CALL XMIT.1
  1074. LD A,(MREG) SEND M+20H
  1075. ADD A,20H
  1076. LD C,A
  1077. CALL XMIT.1
  1078. XOR A RESET 250 MS TIMEOUT
  1079. LD (CLK.1),A
  1080. LD (CLK.2),A
  1081. SCF AND EXIT(IGNORE)
  1082. RET
  1083.  
  1084. E104 EQU * STATE=1 AND NO PAR ERR, SO
  1085. LD A,(EREG) IF ACK FLAG=1 THEN
  1086. AND 80H
  1087. JR Z,E105
  1088. LD A,C STRIP CHAR PAR BIT
  1089. OR A
  1090. RLA
  1091. RRCA
  1092. SUB 20H SET N = CHAR-20H
  1093. LD (NREG),A
  1094. JR E003 AND GO CLEAR ACK FLAG
  1095.  
  1096. E105 EQU * ELSE
  1097. LD A,(MREG) IF N=M (NORMAL CASE) THEN
  1098. LD B,A
  1099. LD A,(NREG)
  1100. CP B
  1101. JR NZ,E107
  1102.  
  1103. INC A SET M AND N =
  1104. LD B,60H N+1 MOD 96
  1105. CP B
  1106. JP NZ,E106
  1107. XOR A
  1108. E106 LD (NREG),A
  1109. LD (MREG),A
  1110. LD A,(EREG) MARK AS OK CHAR
  1111. AND 0BFH
  1112. LD (EREG),A
  1113. JR E109
  1114.  
  1115. E107 EQU * M<>N, SO
  1116. INC A SET N = N+1 MOD 96
  1117. LD C,60H
  1118. CP C
  1119. JR NZ,E108
  1120. XOR A
  1121. E108 LD (NREG),A
  1122. LD A,(EREG) AND MARK TO IGNORE CHAR
  1123. OR 40H
  1124. LD (EREG),A
  1125.  
  1126. E109 EQU * NOW TEST THE CHAR COUNTER.
  1127. LD A,(E.CNTR) IF E.CNTR&lt;>1 THEN
  1128. DEC A
  1129. JR Z,E110
  1130. LD (E.CNTR),A DECREMENT E.CNTR
  1131. LD A,(EREG) PUT MARK IN CARRY FLAG
  1132. RLCA
  1133. RLCA
  1134. RET AND EXIT
  1135.  
  1136. E110 EQU * COUNTER=0, SO
  1137. LD B,C
  1138. LD A,14H SET E.CNTR=20
  1139. LD (E.CNTR),A
  1140. LD C,06H SEND ACK
  1141. E111 CALL XMIT.1
  1142. JR C,E111
  1143. LD A,(MREG) SEND M+20H
  1144. ADD A,20H
  1145. LD C,A
  1146. E113 CALL XMIT.1
  1147. JR C,E113
  1148. LD C,B
  1149. LD A,(EREG) PUT MARK IN CARRY FLAG
  1150. RLCA
  1151. RLCA
  1152. RET AND EXIT
  1153.  
  1154. E200 EQU * ERROR STATE
  1155. LD A,C IF PAR OK THEN
  1156. OR A
  1157. JP PO,E201
  1158. LD A,(EREG) IF ACK FLAG=1 THEN
  1159. RLCA
  1160. JP C,E002
  1161. JR E202
  1162.  
  1163. E201 EQU *
  1164. LD A,(EREG) ELSE CLEAR ACK FLAG
  1165. AND 0FH
  1166. LD (EREG),A
  1167.  
  1168. E202 EQU *
  1169. SCF EXIT(IGNORE)
  1170. RET
  1171.  
  1172.  
  1173. EJECT PROCESS LDM COMMAND
  1174. * * * * * * * * * * * * * * * * * * * * *
  1175. *
  1176. * LOAD MODE INSTRUCTION, (LDM)
  1177. *
  1178. * LOAD TERMINAL OPERATING MODE
  1179. *
  1180. * BIT 1 BULK ERASE
  1181. *
  1182. * BIT 3 BIT 2
  1183. * 0 0 ERASE WRITE INVERSE
  1184. * 0 1 WRITE WRITE NORMAL
  1185. * 1 0 ERASE OVERSTRIKE ER
  1186. * 1 1 WRITE OVERSTRIKE WR
  1187. *
  1188. * BITS 4-6 LOAD OPERATING MODE
  1189. *
  1190. * * * * * * * * * * * * * * * * * * * * *
  1191. SPACE 1
  1192. MODESET EQU * USER ENTRY POINT
  1193. LD A,L
  1194. SRL A SET CARRY IF BULK ERASE
  1195. LD (M.MODE),A STORE MODE BITS
  1196. CALL C,BULKER BULK ERASE IF CARRY SET
  1197. LD A,(M.MODE) GET MODE BITS
  1198. RRCA
  1199. RRCA
  1200. AND 07H
  1201. LD C,A
  1202. LD A,(MODE) INSERT THEM INTO MODE
  1203. AND 80H
  1204. OR C
  1205. LD (MODE),A
  1206. JP CG.SEL SELECT CHARACTER GENERATOR
  1207.  
  1208. MODESET1 EQU * LOCAL ENTRY TO SET W/E BITS
  1209. LD A,(M.MODE) GET PRESENT MODE
  1210. AND 0FCH CLEAR WRITE/ERASE BITS
  1211. OR L INSERT NEW WRITE/ERASE BITS
  1212. LD (M.MODE),A STORE MODE BITS
  1213. LD A,(MODE) IF PLATO OPER. THEN
  1214. RLCA
  1215. JP C,CG.SEL SELECT CHARACTER GENERATOR
  1216. RET
  1217.  
  1218. MODESET2 EQU * LOCAL ENTRY TO SET MODE BITS
  1219. LD A,(MODE) GET OLD MODE BITS
  1220. AND 80H CLEAR OLD MODE BITS
  1221. JR Z,MODSET2A JUMP IF ASCII MODE
  1222. XOR A CLEAR BYPASS IN PLATO MODE
  1223. LD (BYPASS),A
  1224. LD A,80H GET BACK PLATO MODE BIT
  1225. MODSET2A EQU *
  1226. OR C INSERT NEW MODE BITS
  1227. LD (MODE),A STORE MODE BITS
  1228. ADD A,A SHIFT LEFT 2 AND SAVE IN C
  1229. ADD A,A
  1230. LD C,A
  1231. LD A,(M.MODE) UPDATE MODE BITS IN M.MODE
  1232. AND 0E3H
  1233. OR C
  1234. LD (M.MODE),A
  1235. RET
  1236. EJECT
  1237. * * * * * * * * * * * * * * * * * * * * *
  1238. *
  1239. * PROCESS LOAD COORDINATE , (LDC)
  1240. *
  1241. * * * * * * * * * * * * * * * * * * * * *
  1242. SPACE 1
  1243. LDC EQU *
  1244. CALL GETXY GET COORDINATES
  1245. CALL R.OUTX SET COORDINATES
  1246. EX DE,HL
  1247. CALL R.OUTY
  1248. RET
  1249. EJECT ECHO COMMAND PROCESSOR
  1250. * * * * * * * * * * * * * * * * * * * * *
  1251. *
  1252. * PROCESS LOAD ECHO INSTRUCTION (LDE)
  1253. *
  1254. * BITS 1-7 ECHO CODE
  1255. *
  1256. * ECHO CODE =70 STATUS REQUEST. THE CONTENTS
  1257. * M.TYPE IS LOADED AS THE ECHO
  1258. *
  1259. * =7B SOUND AUDIBLE TONE AT TERMIN
  1260. *
  1261. * =7C TERMINAL ID CODE REQUEST. TH
  1262. * TERMINAL SIXTEEN BIT ID CODE
  1263. * LOADED INTO FOUR ECHO RESPON
  1264. *
  1265. * =7D REQUEST FOR TERMINAL FLAG
  1266. *
  1267. * * * * * * * * * * * * * * * * * * * * *
  1268. SPACE 1
  1269. LDE EQU *
  1270. CALL GET3 GET NEXT 3 BYTES
  1271. LD A,L
  1272. AND 7FH
  1273. CP 70H TEST FOR STATUS REQUEST
  1274. JR NZ,LDE0
  1275. SPACE 1
  1276. LD A,(M.TYPE) LOAD TERMINAL TYPE CODE
  1277. SET 7,A SET ECHO OP CODE
  1278. LD L,A LOAD TYPE AS ECHO
  1279. LD H,00 CATEGORY 3 SET TO 0 FOR
  1280. CALL R.XMIT TEST IN TX.STOR FOR XMIT
  1281. RET
  1282. *
  1283. LDE0 EQU *
  1284. CP 7AH TEST FOR TURN OFF 'D'T'R
  1285. JR NZ,LDE1
  1286. BACKOUT EQU *
  1287. LD HL,03FFH SEND OUT BACK OUT CODE
  1288. CALL R.XMIT TO PLATO
  1289. RET
  1290. *
  1291. LDE1 EQU *
  1292. CP 7CH TEST FOR ID REQUEST
  1293. JR NZ,LDE2 NOT ID REQUEST
  1294. *
  1295. IN A,(IDLO) INPUT LOWER EIGHT BITS OF ID
  1296. PUSH AF
  1297. AND 0FH MASK LOWER FOUR BITS
  1298. OR 80H INCLUDE OP CODE AND ID COUNT
  1299. LD L,A
  1300. LD H,00 CATEGORY 3 SET TO 0 FOR
  1301. CALL R.XMIT TEST IN TX.STOR FOR XMIT
  1302. *
  1303. POP AF
  1304. RRCA
  1305. RRCA
  1306. RRCA
  1307. RRCA
  1308. AND 0FH MASK SECOND FOUR BITS
  1309. OR 90H INCLUDE OP CODE AND ID COUNT
  1310. LD L,A
  1311. LD H,00 CATEGORY 3 SET TO 0 FOR
  1312. CALL R.XMIT TEST IN TX.STOR FOR XMIT
  1313. *
  1314. IN A,(IDUP) INPUT UPPER EIGHT BITS
  1315. PUSH AF
  1316. AND 0FH MASK LOWER FOUR BITS
  1317. OR 0A0H INCLUDE OP CODE AND COUNT
  1318. LD L,A
  1319. LD H,00 CATEGORY 3 SET TO 0 FOR
  1320. CALL R.XMIT TEST IN TX.STOR FOR XMIT
  1321. *
  1322. POP AF
  1323. RRCA
  1324. RRCA
  1325. RRCA
  1326. RRCA
  1327. AND 0FH MASK UPPER FOUR BITS
  1328. OR 0B0H INCLUDE OP CODE AND ID COUNT
  1329. LD L,A
  1330. LD H,00 CATEGORY 3 SET TO 0 FOR
  1331. CALL R.XMIT TEST IN TX.STOR FOR XMIT
  1332. RET
  1333. *
  1334. LDE2 EQU *
  1335. CP 7BH TEST FOR AUDIBLE
  1336. JR NZ,LDE3 NOT AUDIBLE
  1337. AND 01
  1338. OUT (MISCTL),A SOUND AUDIBLE ALARM
  1339. RET
  1340. *
  1341. LDE3 EQU *
  1342. CP 7DH TEST FOR TERMINAL FLAG REGIS
  1343. JR NZ,LDE4 NOT FLAG REQUSET
  1344. *
  1345. LD HL,(MEMREG) LOAD FLAG POINTER
  1346. LD A,(HL) LOAD CONTENTS OF FLAG REGIST
  1347. AND 7FH AND MASK LOWER SEVEN BITS
  1348. *
  1349. LDE4 EQU *
  1350. OR 80H SET ECHO OP CODE
  1351. LD L,A LOAD ECHO CODE
  1352. LD H,00 CATEGORY 3 SET TO 0 FOR
  1353. CALL R.XMIT TEST IN TX.STOR FOR XMIT
  1354. RET EXIT
  1355. EJECT PROCESS LDA COMMAND
  1356. * * * * * * * * * * * * * * * * * * * * *
  1357. *
  1358. * LOAD MEMORY ADDRESS, (LDA)
  1359. *
  1360. * * * * * * * * * * * * * * * * * * * * *
  1361. SPACE 1
  1362. LDA EQU *
  1363. CALL GET3 GET NEXT 3 BYTES
  1364. CALL CHKRG CHECK ADDRESS RANGE
  1365. LD (MEMREG),HL
  1366. RET
  1367. *
  1368. * CHECK ADDRESS IN HL BETWEEN BOUNDS
  1369. * ADDRESS MUST BE 22EAH-2311H OR 3300H-7FFFH
  1370. CHKRG EQU *
  1371. EX DE,HL ADDRESS TO DE
  1372. LD HL,3300H
  1373. SCF
  1374. SBC HL,DE
  1375. JR NC,CHKRG0 JUMP IF &lt;3300H
  1376.  
  1377. EX DE,HL ADDRESS BACK TO HL
  1378. BIT 7,H
  1379. RET Z EXIT IF OK (&lt;8000H)
  1380.  
  1381. CHKRG0 EQU * ADDRESS IS <3300H
  1382. LD HL,22EAH
  1383. SCF
  1384. SBC HL,DE
  1385. JR NC,CHKRG1 JUMP IF &lt;22EAH (ERROR)
  1386.  
  1387. LD HL,2312H
  1388. SBC HL,DE (CARRY IS ALREADY SET)
  1389. EX DE,HL ADDRESS BACK TO HL
  1390. RET NC EXIT IF OK (&lt;2312H)
  1391.  
  1392. CHKRG1 EQU * OUT OF BOUNDS
  1393. POP HL
  1394. RET
  1395. EJECT SSF AND EXT
  1396. * * * * * * * * * * * * * * * * * * * * *
  1397. *
  1398. * SELECT SPECIAL FUNCTION
  1399. *
  1400. * THIS COMMAND IS USED TO COMMUNICATE WITH VARIOUS DEVI
  1401. * CONNECTED TO THE EXTERNAL CHANNELS, AND SET THE TERMI
  1402. * INTERNAL INTERRUPT MASK.
  1403. *
  1404. * * * * * * * * * * * * * * * * * * * * *
  1405. SPACE 1
  1406. *
  1407. * ON-LINE ENTRY POINT
  1408. *
  1409. SSF EQU *
  1410. CALL GET3 GET NEXT 3 BYTES
  1411. RES 7,H CLEAR UPPER BIT
  1412. *
  1413. * USER ENTRY POINT
  1414. *
  1415. SSF0 EQU *
  1416. LD A,H
  1417. RRCA
  1418. RRCA
  1419. AND 1FH MASK DEVICE ADDRESS BITS
  1420. JR NZ,SSF1 NOT SLIDE PROJECTOR
  1421. *
  1422. * OUTPUT TO SLIDE PROJECTOR
  1423. *
  1424. LD C,20H LOAD SLIDE PROJECTOR ADDRESS
  1425. OUT (C),L OUTPUT LOWER EIGHT BITS
  1426. LD A,03
  1427. AND H MASK UPPER TWO BITS
  1428. OUT (C),A OUTPUT UPPER TWO BITS
  1429. RET
  1430. *
  1431. SSF1 EQU *
  1432. CP 01 TEST FOR INTERRUPT MASK
  1433. JR NZ,SSF2 NOT INTERRUPT MASK
  1434. LD A,L LOAD MASK
  1435. JP ENAB AND SET INTERRUPT NASK
  1436. *
  1437. SSF2 EQU *
  1438. BIT 1,H TEST FOR INPUT OR OUTPUT
  1439. JR NZ,SSF3 GO TO INPUT IF NOT ZERO
  1440. *
  1441. * OUTPUT TO EXTERNAL DEVICE
  1442. *
  1443. LD (EXT.OUT),A STORE DEVICE ADDRESS
  1444. LD C,A
  1445. BIT 0,H TEST FOR DATA IN LOWER BITS
  1446. RET NZ EXIT IF NONE
  1447. *
  1448. LD E,L
  1449. LD HL,EXTD LOAD DATA STORE ADDRESS
  1450. LD (HL),E AND STORE DATA BYTE
  1451. AND 1CH TEST FOR SERIAL OR PARALLEL
  1452. RET Z CAN NOT SELECT SERIAL CHANNEL
  1453. SET 5,C SET EXTERNAL CHANNEL BIT
  1454. OUTI OUTPUT DATA FROM MEMORY
  1455. RET
  1456. *
  1457. *
  1458. * INPUT FROM EXTERNAL DEVICE
  1459. *
  1460. SSF3 EQU *
  1461. LD (EXT.IN),A STORE DEVICE ADDRESS
  1462. LD C,A
  1463. BIT 0,H TEST FOR DATA IN LOWER BITS
  1464. RET NZ EXIT IF NONE
  1465. AND 1CH TEST FOR SERIAL OR PARALLEL
  1466. LD A,C
  1467. JR Z,SSF4
  1468. ADD A,1DH ADD FOR PARALLEL CHANNEL
  1469. SSF4 EQU *
  1470. ADD A,03 ADD FOR SERIAL CHANNEL
  1471. LD C,A
  1472. IN L,(C) INPUT FROM DEVICE
  1473. LD H,82H LOAD OP CODE AND CATAGORY
  1474. LD A,(M.KSW) LOAD USER/PLATO FLAG
  1475. PUSH HL
  1476. CP 02 FOR M.KSW=0 OR M.KSW=1
  1477. CALL M,TX.STOR STORE FOR TRANSMIT TO 'PLATO
  1478. POP HL FOR M.KSW=2 OR M.KSW=3
  1479. * RETURN DATA IN L TO USER
  1480. RET
  1481. EJECT EXT
  1482. * * * * * * * * * * * * * * * * * * * * *
  1483. *
  1484. * OUTPUT DATA TO EXTERNAL DEVICE
  1485. *
  1486. * THIS COMMAND TRANSFERS TWO BYTES OF DATA TO THE DEVIC
  1487. * CONNECTED TO THE EXTERNAL CHANNEL, AND ADDRESSED BY T
  1488. * LAST SSF COMMAND RECEIVED BY THE TERMINAL.
  1489. *
  1490. * * * * * * * * * * * * * * * * * * * * *
  1491. SPACE 1
  1492. *
  1493. * ON-LINE ENTRY POINT
  1494. *
  1495. EXT EQU *
  1496. CALL GET3 GET NEXT 3 BYTES
  1497. LD A,H SWAP H AND L
  1498. LD H,L
  1499. LD L,A
  1500. LD (EXTD),HL SAVE IN TEMP EXT DATA AREA
  1501. LD DE,02 LOAD DATA BYTE COUNT
  1502. *
  1503. * USER ENTRY POINT
  1504. * ON ENTRY, HL=FWA AND DE=LENGTH IN BYTES
  1505. EXTX EQU *
  1506. LD A,(EXT.OUT) LOAD EXTERNAL DEVICE ADDRESS
  1507. LD C,A
  1508. AND 1CH TEST FOR SERIAL OR PARALLEL
  1509. RET NZ RETURN IF SERIAL
  1510. *
  1511. * PARALLEL CHANNELS
  1512. *
  1513. SET 5,C ADD EXT CHANNEL BIT
  1514. *
  1515. EXT4 EQU *
  1516. OUTI OUTPUT DATA FROM MEMORY
  1517. *
  1518. DEC DE DECREMENT BYTE COUNT
  1519. LD A,D
  1520. OR E TEST FOR LAST BYTE
  1521. JR NZ,EXT4 OUT PUT NEXT BYTE
  1522. RET
  1523. EJECT MODE 0, POINT PLOT
  1524. * * * * * * * * * * * * * * * * * * * * *
  1525. *
  1526. * POINT PLOT MODE
  1527. *
  1528. * EACH MODE 0 DATA WORD SPECIFIES THE COORDINATES ON TH
  1529. * DISPAY TO BE WRITTEN OR ERASED. BIT 2 OF THE LAST LDM
  1530. * COMMAND RECEIVED WILL DETERMINE WRITE OR ERASE.
  1531. *
  1532. * MODE 0 DATA WORD
  1533. * BITS 1-9 Y COORDINATE
  1534. * BITS 10-18 X COORDINATE
  1535. *
  1536. * * * * * * * * * * * * * * * * * * * * *
  1537. SPACE 1
  1538. SPACE 1
  1539. APOINT EQU *
  1540. CALL GETXY GET COORDINATES
  1541. *
  1542. * WRITE/ERASE SINGLE DOT
  1543. *
  1544. * USER ENTRY POINT
  1545. SPACE 1
  1546. POINT EQU *
  1547. PUSH DE SAVE Y COORDINATE
  1548. CALL R.OUTX LOAD X COORDINATE
  1549. POP HL RETREIVE Y COORDINATE
  1550. CALL R.OUTY LOAD Y COORDINATE
  1551. SPACE 1
  1552. * USER ENTRY POINT
  1553. SPACE 1
  1554. WE EQU *
  1555. CALL MASKS GENERATE WRITE/ERASE MASKS
  1556. *
  1557. EX DE,HL
  1558. LD HL,(DMAA) LOAD DMA ADDRESS
  1559. LD A,(M.MODE) LOAD WRITE/ERASE FLAG
  1560. BIT 0,A TEST FOR WRITE OR ERASE
  1561. JR Z,MODE01 GO TO ERASE
  1562. *
  1563. LD A,E LOAD WRITE MASK
  1564. OR (HL) INCLUDE POINT IN DMA DATA
  1565. LD (HL),A AND STORE IN DMA
  1566. RET
  1567. *
  1568. MODE01 EQU *
  1569. LD A,D LOAD ERASE MASK
  1570. AND (HL) ERASE POINT
  1571. LD (HL),A STORE RESULT IN DMA
  1572. RET
  1573. EJECT MODE 1, VECTOR GENERATOR
  1574. * * * * * * * * * * * * * * * * * * * * *
  1575. *
  1576. * VECTOR MODE
  1577. *
  1578. * EACH DATA WORD RECEIVED SPECIFIES THE END COORDINATES
  1579. * THE LINE TO BE DRAWN. THIS LINE IS DRWWN BETWEEN THE
  1580. * CURRENT COORDINATES AND THE END COORDINATES SPECIFIED
  1581. * THE MODE 1 DATA WORD. THE END COORDINATES IS ALSO THE
  1582. * OF THE NEXT LINE TO BE DRAWN.
  1583. *
  1584. * MODE 1 DATA WORD
  1585. * BITS 1-9 Y COORDINATE
  1586. * BITS 10-18 X COORDINATE
  1587. * * * * * * * * * * * * * * * * * * * * *
  1588. SPACE 1
  1589. GRAPH EQU *
  1590. CALL GETXY GET COORDINATES
  1591. LD A,(DARK)
  1592. AND A IF DARK VECTOR,
  1593. JR Z,ALINE BASE POSITION
  1594. PUSH DE SAVE Y COORD
  1595. CALL R.OUTX OUTPUT X
  1596. POP HL
  1597. CALL R.OUTY OUTPUT Y
  1598. XOR A TURN OFF DARK VECTOR
  1599. LD (DARK),A
  1600. RET
  1601. *
  1602. ALINE EQU *
  1603. LD A,(DASH) LOAD FLAG FOR DASHED/SOLID
  1604. RRA
  1605. JP C,G.LINE1 IF SET, USE DASHED VECTOR
  1606. * OTHERWISE R.LINE
  1607. *
  1608. LINE EQU *
  1609. *
  1610. LD (XEND),HL STORE X END COORDINATE
  1611. EX DE,HL
  1612. LD (YEND),HL STORE Y END COORDINATE
  1613. *
  1614. LD C,00 CLEAR C FOR VECTOR FLAG
  1615. LD HL,(XREG) LOAD CURRENT X COORDINATE
  1616. CALL CALDELX CALCULATE DELTA X
  1617. LD HL,(YREG) LOAD CURRENT Y COORDINATE
  1618. CALL CALDELY CALCULATE DELTA Y
  1619. *
  1620. LD A,08H TEST FOR NEGATIVE X
  1621. AND C
  1622. LD A,C
  1623. LD (VECFLG),A STORE VECTOR FLAG
  1624. JR Z,MODE11 JUMP IF Y POSITIVE
  1625. XOR 10H TOGGLE Y DIRECTION
  1626. LD (VECFLG),A AND STORE
  1627. LD HL,(YEND) RESET VECTOR
  1628. CALL R.OUTY LOAD COORDINATE.
  1629. LD HL,(XEND)
  1630. CALL R.OUTX LOAD COORDINATE.
  1631. *
  1632. MODE11 EQU *
  1633. LD HL,(YDELTA)
  1634. EX DE,HL
  1635. LD HL,(XDELTA) LOAD DELTA X
  1636. SBC HL,DE
  1637. JR NC,MODE12 JUMP IF X GREATER
  1638. *
  1639. * DELTA Y GREATER
  1640. *
  1641. LD HL,(XDELTA) LOAD DELTA X
  1642. CALL DIVIDE CALCULATE SLOPE
  1643. JR MODE17
  1644. *
  1645. * DELTA Y IS EQUAL TO OR LESS THAN DELTA X
  1646. *
  1647. MODE12 EQU *
  1648. LD HL,(XDELTA) LOAD DELTA X
  1649. EX DE,HL
  1650. CALL DIVIDE CALCULATE SLOPE
  1651. *
  1652. LD BC,(XDELTA) LOAD DELTA FOR LOOP COUNT
  1653. INC BC
  1654. EXX
  1655. CALL MASKS GENERATE MASKS
  1656. LD C,L
  1657. LD B,H
  1658. LD DE,0FFFFH LOAD FOR POSITIVE 'Y
  1659. LD HL,(DMAA) LOAD STARTING ADDRESS
  1660. LD A,(VECFLG) LOAD VECTOR PARAMETERS
  1661. BIT 4,A TEST FOR POS 'Y DELTA
  1662. JR Z,MODE1A JUMP IF X POSITIVE
  1663. *
  1664. INC DE SET DE FOR
  1665. INC DE NEGATIVE 'Y
  1666. *
  1667. MODE1A EQU *
  1668. LD A,(M.MODE) TEST MODE BITS
  1669. RRA FOR WRITE OR ERASE
  1670. JP NC,XVECE ERASE
  1671. JP XVEC ELSE GO TO WRITE
  1672. *
  1673. MODE17 EQU *
  1674. LD BC,(YDELTA) LOAD DELTA FOR LOOP COUNT
  1675. INC BC
  1676. EXX
  1677. CALL MASKS GENERATE MASKS
  1678. LD C,L
  1679. LD B,H
  1680. LD DE,0FFFFH LOAD FOR POSTIVE 'Y
  1681. LD HL,(DMAA) LOAD STARTING ADDRESS
  1682. LD A,(VECFLG) LOAD CEVTOR PARAMETERS
  1683. BIT 4,A TEST FOR POS 'Y DELTA
  1684. JR Z,MODE18 JUMP IF X POSITIVE
  1685. *
  1686. INC DE SET DE FOR
  1687. INC DE NEGATIVE 'Y
  1688. *
  1689. MODE18 EQU *
  1690. LD A,(M.MODE) TEST MODE BITS
  1691. RRA FOR WRITE OR ERASE
  1692. JP NC,YVECE GO TO ERASE
  1693. *
  1694. * VECTOR GENERATOR, Y IS LONG AXIS, X IS SHORT AXIS
  1695. * WRITE VECTOR
  1696. *
  1697. YVEC EQU *
  1698. LD A,(HL) LOAD VECTOR POINT
  1699. OR C INTO REFRESH MEMORY
  1700. LD (HL),A
  1701. EXX
  1702. DEC BC DECREMENT LOOP COUNT
  1703. LD A,B
  1704. OR C TEST COUNT FOR ZERO
  1705. JR Z,MODE19 EXIT LOOP IF ZERO
  1706. *
  1707. YVEC1 EQU *
  1708. ADD HL,DE CALCULATE NEXT POINT
  1709. EXX
  1710. JR NC,YVEC2
  1711. RLC C
  1712. JR NC,YVEC2
  1713. INC H
  1714. INC H
  1715. SET 7,H
  1716. YVEC2 EQU *
  1717. ADD HL,DE
  1718. SET 7,H REFRESH MEMORY ADDRESS BIT
  1719. JR YVEC
  1720. EJECT Y AXIS VECTOR ERASE
  1721. *
  1722. * VECTOR GENERATOR, Y IS LONG AXIS, X IS SHORT AXIS
  1723. * VECTOR ERASE
  1724. *
  1725. YVECE EQU *
  1726. LD A,(HL) LOAD VECTOR POINT
  1727. AND B INTO DMA MEMORY
  1728. LD (HL),A
  1729. *
  1730. EXX
  1731. DEC BC DECREMENT LOOP COUNT
  1732. LD A,B
  1733. OR C TEST COUNT FOR ZERO
  1734. JR Z,MODE19 EXIT LOOP IF ZERO
  1735. *
  1736. YVECE1 EQU *
  1737. ADD HL,DE CALCULATE NEXT POINT OF VECT
  1738. EXX
  1739. JR NC,YVECE2
  1740. RLC B
  1741. JR C,YVECE2
  1742. INC H
  1743. INC H
  1744. SET 7,H
  1745. YVECE2 EQU *
  1746. ADD HL,DE
  1747. SET 7,H REFRESH MEMORY ADDRESS BIT
  1748. JR YVECE
  1749. EJECT X AXIS VECTOR
  1750. *
  1751. *
  1752. * VECTOR GENERATOR, X IS LONG AXIS, Y IS SHORT AXIS
  1753. * WRITE VECTOR
  1754. *
  1755. XVEC EQU *
  1756. LD A,(HL) LOAD VECTOR POINT
  1757. OR C INTO REFRESH MEMORY
  1758. LD (HL),A
  1759. *
  1760. EXX
  1761. DEC BC DECREMENT LOOP COUNT
  1762. LD A,B
  1763. OR C TEST COUNT FOR ZERO
  1764. JR Z,MODE19 EXIT LOOP IF ZERO
  1765. *
  1766. XVEC1 EQU *
  1767. ADD HL,DE CALCULATE NEXT POINT
  1768. EXX
  1769. JR NC,XVEC2
  1770. ADD HL,DE
  1771. SET 7,H
  1772. XVEC2 EQU *
  1773. RLC C
  1774. JR NC,XVEC
  1775. INC H
  1776. INC H
  1777. SET 7,H
  1778. JR XVEC
  1779. SET 7,H REFRESH MEMORY ADDRESS BIT
  1780. JR XVEC
  1781. EJECT X AXIS VECTOR ERASE
  1782. *
  1783. * VECTOR GENERATOR, X IS LONG AXIS, Y IS SHORT AXIS
  1784. * VECTOR ERASE
  1785. *
  1786. XVECE EQU *
  1787. LD A,(HL) ERASE
  1788. AND B VECTOR POINT
  1789. LD (HL),A OF DMA MEMORY
  1790. *
  1791. EXX
  1792. DEC BC DECREMENT LOOP COUNT
  1793. LD A,B
  1794. OR C TEST COUNT FOR ZERO
  1795. JR Z,MODE19 EXIT LOOP IF ZERO
  1796. *
  1797. XVECE1 EQU *
  1798. ADD HL,DE CALCULATE NEXT POINT OF VECT
  1799. EXX
  1800. JR NC,XVECE2
  1801. *
  1802. ADD HL,DE MOVE IN 'Y
  1803. SET 7,H DIRECTION
  1804. XVECE2 EQU *
  1805. RLC B
  1806. JR C,XVECE
  1807. INC H MOVE IN 'X
  1808. INC H DIRECTION
  1809. SET 7,H REFRESH MEMORY ADDRESS BIT
  1810. JR XVECE
  1811. *
  1812. *
  1813. *
  1814. MODE19 EQU *
  1815. LD HL,(YEND)
  1816. CALL R.OUTY LOAD COORDINATE.
  1817. LD HL,(XEND)
  1818. JP R.OUTX LOAD COORDINATE.
  1819. EJECT MODE 2, DATA LOAD AND STORE
  1820. * * * * * * * * * * * * * * * * * * * * *
  1821. *
  1822. * LOAD TERMINAL MEMORY
  1823. *
  1824. * EACH DATA WORD RECEIVED CONTAINS 16 BITS OF DATA TO B
  1825. * STORED IN THE TERMINAL MEMORY. THIS DATA IS STORED IN
  1826. * SUCCESSIVE LOCATIONS STARTING WITH THE CURRENT CONTEN
  1827. * OF THE MEMORY ADDRESS REGISTER. AFTER EACH EIGHT BITS
  1828. * IS STORED, THE MEMORY ADDRESS REGISTER IS INCREMENTED
  1829. * THE MEMORY ADDRESS REGISTER IS INITIALIZED BY THE
  1830. * LAST LDA COMMAND RECEIVED.
  1831. *
  1832. *
  1833. * * * * * * * * * * * * * * * * * * * * *
  1834. SPACE 2
  1835. MEMORY EQU *
  1836. CALL GET3 GET NEXT 3 BYTES
  1837. LD B,H SAVE DATA IN BC
  1838. LD C,L
  1839. LD HL,(MEMREG) GET MEMORY ADDRESS
  1840. CALL CHKRG CHECK AGAINST BOUNDS
  1841. LD (HL),C STORE DATA
  1842. INC HL
  1843. LD (HL),B
  1844. INC HL
  1845. LD (MEMREG),HL SAVE UPDATED ADDRESS
  1846. LD A,(CONFLG) TEST FOR CONVERTING
  1847. OR A CHAR. DATA
  1848. RET Z DO NOT CONVERT
  1849.  
  1850. LD A,(NDATAB)
  1851. INC A
  1852. LD (NDATAB),A INCREMENT COUNT ON DATA BYTES
  1853. CP 08 IF 16 BYTES, THEN CONVERT DATA
  1854. RET NZ
  1855. LD DE,0010H
  1856. XOR A CLEAR CARRY
  1857. SBC HL,DE
  1858. EX DE,HL DE _ FWA CHAR. DATA
  1859. LD HL,0001 HL _ CHAR. COUNT OF 1
  1860. CALL CONVERT
  1861. XOR A
  1862. LD (NDATAB),A CLEAR NUMBER DATA BYTES FG.
  1863. RET
  1864. EJECT MODE 3, CHARACTER GENERATOR
  1865. * * * * * * * * * * * * * * * * * * * * *
  1866. *
  1867. *
  1868. * ALPHA MODE
  1869. *
  1870. * MODE 3 DATA WORDS ARE CHARACTERS TO BE DISPLAYED.
  1871. * ON ENTRY, THE CHAR IS IN THE C-REG.
  1872. *
  1873. * * * * * * * * * * * * * * * * * * * * *
  1874. SPACE 2
  1875. CHARACT EQU *
  1876. LD A,(MODE) CHECK MODE
  1877. RLCA
  1878. JP NC,ALPHMODE GO TO ASCII CHAR GEN
  1879.  
  1880. LD HL,M.CCR IS REVERSE SET
  1881. BIT 6,(HL)
  1882. JR Z,CHARS0 NO, JUMP
  1883.  
  1884. PUSH BC YES, DO TAB FIRST
  1885. EX DE,HL PUT M.CCR IN DE
  1886. CALL TAB
  1887. POP BC
  1888.  
  1889. CHARS0 LD DE,(MEMSEL) DISPLAY THE CHARACTER
  1890. LD A,C
  1891. SUB 20H
  1892. LD L,A
  1893. JP CHARGEN
  1894.  
  1895. **********
  1896. * USER ENTRY POINT
  1897. **********
  1898. CHARS EQU *
  1899. LD A,(HL) GET DATA
  1900. RES 7,A MASK TO 7 BITS
  1901. INC HL
  1902. LD (CHFWA),HL SAVE CHAR ADDRESS
  1903. LD HL,M.CCR
  1904. CP 3FH IS CHAR AN UNCOVER CODE
  1905. JR NZ,CHARS1 NO, JUMP
  1906.  
  1907. SET 7,(HL) SET UNCOVER FLAG
  1908. JR CHARS6
  1909.  
  1910. CHARS1 EQU *
  1911. BIT 7,(HL) IS UNCOVER FLAG SET
  1912. JR NZ,CHARS10 YES, JUMP TO HANDLE CTL CODES
  1913.  
  1914. BIT 6,(HL) IS REVERSE SET
  1915. JR Z,CHARS2 NO, JUMP
  1916.  
  1917. PUSH AF YES, DO TAB BEFORE PLOTTING
  1918. PUSH HL
  1919. EX DE,HL PUT M.CCR INTO DE
  1920. CALL TAB
  1921. POP HL
  1922. POP AF
  1923.  
  1924. CHARS2 EQU * NOW PLOT THE CHAR
  1925. LD C,A SAVE CHAR IN C
  1926. LD A,(HL) GET SELECTED CHAR MEM
  1927. AND 0EH
  1928. JR Z,CHARS4 JUMP IF M0 SELECTED
  1929. SUB 2
  1930. JR Z,CHARS3 JUMP IF M1 SELECTED
  1931. LD DE,(MEMSEL) M2..M7, SO USE SELECTED MEM
  1932. LD L,C AND UNTRANSLATED CHAR
  1933. JR CHARS5
  1934.  
  1935. CHARS3 EQU * M1 SELECTED, SO
  1936. SET 6,C BIAS CHAR
  1937.  
  1938. CHARS4 EQU * M0 OR M1 SELECTED
  1939. LD B,0 TRANSLATE CHAR TO ASCII
  1940. LD HL,PCHARS
  1941. ADD HL,BC
  1942. LD L,(HL) GET BIASED ASCII CHAR IN L
  1943. LD DE,M0CODE00 M0 IF L7=0
  1944. BIT 7,L
  1945. JR Z,CHARS5
  1946. RES 7,L CLEAR FLAG BIT
  1947. LD DE,M1CODE00 M1 IF L7=1
  1948.  
  1949. CHARS5 EQU *
  1950. CALL CHARGEN DISPLAY THE CHAR
  1951.  
  1952. CHARS6 EQU *
  1953. LD HL,(CHFWA) GET SAVED CHAR ADDRESS
  1954. JR CHARS LOOP
  1955.  
  1956. CHARS10 EQU * UNCOVER FLAG IS SET
  1957. DEC A EXIT IF CHAR=01
  1958. RET Z
  1959.  
  1960. RES 7,(HL) CLEAR UNCOVER FLAG
  1961. INC A EXIT IF CHAR=00
  1962. RET Z
  1963.  
  1964. CP 08H EXECUTE CONTROL CODES
  1965. JR C,CHARS6 IGNORE 00-07
  1966.  
  1967. CP 0EH
  1968. JR NC,CHARS11
  1969.  
  1970. LD C,A EXCUTE 08-0D
  1971. CALL EX.CTL
  1972. JR CHARS6
  1973.  
  1974. CHARS11 EQU *
  1975. CP 1EH
  1976. JR NC,CHARS6 IGNORE 1E-7F
  1977.  
  1978. ADD A,32H EXECUTE 0E-1D
  1979. LD C,A (BIASED TO 40-4F)
  1980. CALL EX.ESC
  1981. JR CHARS6
  1982.  
  1983. EJECT
  1984. **********
  1985. * THE FOLLOWING TABLE IS USED TO TRANSLATE FROM 6-BIT
  1986. * PLATO CHARACTER CODES TO ASCII CODES.
  1987. * BIT 7 SET INDICATES THE CHARACTER IS PHYSICALLY FOUND IN
  1988. * M1, WHILE BIT 7 CLEAR INDICATES THE CHARACTER IS
  1989. * PHYSICALLY FOUND IN M0. BITS 6-0 ARE THE ASCII CHARACTER
  1990. * WITH 20H SUBTRACTED OFF FOR USE BY THE CHARACTER GENERATOR
  1991. **********
  1992. PCHARS EQU *
  1993. HEX 1A,41,42,43 0X (M0)
  1994. HEX 44,45,46,47
  1995. HEX 48,49,4A,4B
  1996. HEX 4C,4D,4E,4F
  1997. HEX 50,51,52,53 1X
  1998. HEX 54,55,56,57
  1999. HEX 58,59,5A,10
  2000. HEX 11,12,13,14
  2001. HEX 15,16,17,18 2X
  2002. HEX 19,0B,0D,0A
  2003. HEX 0F,08,09,04
  2004. HEX 1D,00,0C,0E
  2005. HEX 8F,3B,3D,05 3X
  2006. HEX 8A,84,07,02
  2007. HEX 01,1B,1C,1E
  2008. HEX 3F,1F,9F,00
  2009.  
  2010. HEX 03,21,22,23 4X (M1)
  2011. HEX 24,25,26,27
  2012. HEX 28,29,2A,2B
  2013. HEX 2C,2D,2E,2F
  2014. HEX 30,31,32,33 5X
  2015. HEX 34,35,36,37
  2016. HEX 38,39,3A,83
  2017. HEX 80,3E,9C,40
  2018. HEX 86,87,88,89 6X
  2019. HEX 5E,8B,8C,8D
  2020. HEX 8E,5B,5D,06
  2021. HEX 85,00,5C,9D
  2022. HEX 82,90,91,92 7X
  2023. HEX 93,94,95,96
  2024. HEX 97,98,99,9A
  2025. HEX 9B,20,3C,00
  2026. EJECT
  2027. *
  2028. *
  2029. * BACKSPACE
  2030. *
  2031. BKSP EQU *
  2032. LD A,(DE) LOAD PLOTTING FLAG
  2033. XOR 40H TOGGLE FORW/REV BIT
  2034. JR TAB0
  2035. *
  2036. * HORIZONTAL TAB
  2037. *
  2038. TAB EQU *
  2039. LD A,(DE) LOAD PLOTTING FLAG
  2040. *
  2041. TAB0 EQU *
  2042. LD DE,(SIZE) LOAD CHARACTER SIZE
  2043. BIT 0,A TEST FOR HORIZONTAL/VERTICAL
  2044. JR NZ,TAB2 GO TO VERT ROUTINE
  2045. BIT 6,A TEST FOR FORWARD/REVERSE
  2046. LD HL,(XREG) LOAD CURRENT X COORDINATE
  2047. JR NZ,TAB1 GO TO REVERSE ROUTINE
  2048. *
  2049. ADD HL,DE ADD CHARACTER SIZE
  2050. JP R.OUTX LOAD COORDINATE.
  2051. *
  2052. TAB1 EQU *
  2053. AND A CLEAR CARRY BIT
  2054. SBC HL,DE SUBTRACT CHARACTER SIZE
  2055. JP R.OUTX LOAD COORDINATE.
  2056. *
  2057. TAB2 EQU *
  2058. BIT 6,A TEST FOR FORWARD/REVERSE
  2059. LD HL,(YREG) LOAD CURRENT Y COORDINATE
  2060. JR NZ,TAB3 GO TO REVERSE ROUTINE
  2061. *
  2062. ADD HL,DE ADD CHARACTER SIZE
  2063. JP R.OUTY LOAD COORDINATE.
  2064. *
  2065. TAB3 EQU *
  2066. AND A CLEAR CARRY BIT
  2067. SBC HL,DE SUBTRACT CHARACTER SIZE
  2068. JP R.OUTY LOAD COORDINATE.
  2069. *
  2070. * LINE FEED
  2071. *
  2072. LF EQU *
  2073. LD HL,(SIZE) LOAD CHARACTER SIZE
  2074. ADD HL,HL AND ADJUST FOR HEIGHT
  2075. EX DE,HL
  2076. BIT 0,(HL) TEST FOR HOR/VERT
  2077. JR NZ,LF1 GO TO VERTICAL ROUTINE
  2078. *
  2079. LD HL,(YREG) LOAD CURRENT Y COORDINATE
  2080. AND A CLEAR CARRY BIT
  2081. SBC HL,DE SUBTRACT CHARACTER SIZE
  2082. JP R.OUTY LOAD COORDINATE.
  2083. *
  2084. LF1 EQU *
  2085. LD HL,(XREG) LOAD CURRENT X COORDINATE
  2086. ADD HL,DE ADD CHARACTER SIZE
  2087. JP R.OUTX LOAD COORDINATE.
  2088. *
  2089. * VERTICAL TAB
  2090. *
  2091. VT EQU *
  2092. LD HL,(SIZE) LOAD CHARACTER SIZE
  2093. ADD HL,HL AND ADJUST FOR HEIGHT
  2094. EX DE,HL
  2095. BIT 0,(HL) TEST FOR HOR/VERT
  2096. JR NZ,VT1 GO TO VERTICAL ROUTINE
  2097. *
  2098. LD HL,(YREG) LOAD CURRENT Y COORDINATE
  2099. ADD HL,DE ADD CHARACTER SIZE
  2100. JP R.OUTY LOAD COORDINATE.
  2101. *
  2102. VT1 EQU *
  2103. LD HL,(XREG) LOAD CURRENT X COORDINATE
  2104. AND A CLEAR CARRY BIT
  2105. SBC HL,DE SUBTRACT CHARACTER SIZE
  2106. JP R.OUTX LOAD COORDINATE.
  2107. *
  2108. * FORM FEED
  2109. *
  2110. FF EQU *
  2111. LD HL,512
  2112. LD A,(M.CCR) LOAD PLOTTING PARAMETERS
  2113. BIT 6,A TEST FOR FORWARD OR REVERSE
  2114. JR Z,FF1 JUMP IF FORWARD
  2115. *
  2116. LD DE,(SIZE) LOAD CHARACTER SIZE
  2117. AND A CLEAR CARRY BIT
  2118. SBC HL,DE AND SUBTRACT FROM FULL SCE
  2119. *
  2120. FF1 EQU *
  2121. BIT 0,A TEST FOR HORIZONTAL OR VERTI
  2122. JR NZ,FF2 JUMP IF VERTICAL
  2123. *
  2124. CALL R.OUTX LOAD COORDINATE.
  2125. *
  2126. LD HL,(SIZE) LOAD CHARACTER SIZE
  2127. ADD HL,HL AND DOUBLE IT
  2128. LD DE,512 LOAD FULL SCREEN SIZE
  2129. EX DE,HL
  2130. AND A CLEAR CARRY BIT
  2131. SBC HL,DE SUBTRACT SIZE FROM FULL SCRE
  2132. JP R.OUTY LOAD COORDINATE.
  2133. *
  2134. FF2 EQU *
  2135. CALL R.OUTY LOAD COORDINATE.
  2136. *
  2137. LD HL,(SIZE) LOAD CHARACTER SIZE
  2138. ADD HL,HL AND DOUBLE IT
  2139. DEC HL SUBTRACT ONE
  2140. JP R.OUTX LOAD COORDINATE.
  2141. *
  2142. * CARRIAGE RETURN
  2143. *
  2144. CR EQU *
  2145. LD HL,(SIZE) LOAD CHARACTER SIZE
  2146. ADD HL,HL AND ADJUST FOR HEIGHT
  2147. EX DE,HL
  2148. BIT 0,(HL) TEST FOR HOR/VERT
  2149. JR NZ,CR1 GO TO VERTICAL ROUTINE
  2150. *
  2151. LD HL,(YREG) LOAD CURRENT Y COORDINATE
  2152. AND A CLEAR CARRY BIT
  2153. SBC HL,DE SUBTRACT CHARACTER SIZE
  2154. CALL R.OUTY LOAD Y COORDINATE
  2155. LD HL,(M.MARGIN) LOAD MARGIN
  2156. JP R.OUTX LOAD COORDINATE.
  2157. *
  2158. CR1 EQU *
  2159. LD HL,(XREG) LOAD CURRENT X COORDINATE
  2160. ADD HL,DE ADD CHARACTER SIZE
  2161. CALL R.OUTX LOAD X COORDINATE
  2162. LD HL,(M.MARGIN) LOAD MARGIN
  2163. JP R.OUTY LOAD COORDINATE.
  2164. *
  2165. SUB EQU *
  2166. LD HL,-0005 LOAD DISPLACEMENT
  2167. JR SUB0
  2168. *
  2169. SUPER EQU *
  2170. LD HL,0005 LOAD DISPLACEMENT
  2171. SUB0 EQU *
  2172. LD A,(DE) LOAD PLOTTING FLAFG
  2173. BIT 0,A TEST HORIZONTAL OR VERTICAL
  2174. JR NZ,SUP1 GO TO VERTICAL PLOT
  2175. *
  2176. BIT 5,A
  2177. JR Z,SUP0 JUMP IF SIZE ZERO
  2178. ADD HL,HL ELSE DOUBLE DISPLACEMENT
  2179. SUP0 EQU *
  2180. EX DE,HL
  2181. LD HL,(YREG) LOAD Y COORDINATE
  2182. ADD HL,DE ADJUST COORDINATE
  2183. JP R.OUTY LOAD COORDINATE.
  2184. *
  2185. SUP1 EQU *
  2186. BIT 5,A
  2187. JR Z,SUP2 JUMP IF SIZE ZERO
  2188. ADD HL,HL ELSE DOUBLE DISPLACEMENT
  2189. SUP2 EQU *
  2190. EX DE,HL
  2191. LD HL,(XREG) LOAD X COORDINATE
  2192. AND A CLEAR CARRY BIT
  2193. SBC HL,DE ADJUST COORDINATE
  2194. JP R.OUTX LOAD COORDINATE.
  2195. *
  2196. SELECTMM EQU *
  2197. LD A,C GET CHAR
  2198. SUB 42H REMOVE BIAS
  2199. RLCA
  2200. LD C,A SAVE IN C
  2201. CALL LDMEMSEL SELECT M2..M7
  2202. LD HL,M.CCR UPDATE MEM SEL BITS IN (M.CCR)
  2203. LD A,0F1H
  2204. AND (HL)
  2205. OR C
  2206. LD (HL),A
  2207. RET
  2208.  
  2209. * CALLABLE ROUTINE TO SELECT M0..M7 AS SPECIFIED IN A-REG.
  2210. * NOTE, C-REG IS UNCHANGED.
  2211. LDMEMSEL EQU *
  2212. LD DE,M0CODE00
  2213. OR A
  2214. JR Z,LDMEM1 JUMP IF M0 SELECTED
  2215. LD DE,M1CODE00
  2216. DEC A
  2217. DEC A
  2218. JR Z,LDMEM1 JUMP IF M1 SELECTED
  2219. LD B,0 SELECT M2..M7
  2220. LD HL,MEM2-4
  2221. ADD HL,BC
  2222. LD E,(HL)
  2223. INC HL
  2224. LD D,(HL)
  2225. LDMEM1 LD (MEMSEL),DE
  2226. RET
  2227. *
  2228. HOR EQU *
  2229. EX DE,HL
  2230. RES 0,(HL) AND SET HORIZONTAL PLOT
  2231. JP CG.SEL SELECT CHARACTER GENERATOR
  2232. *
  2233. VERT EQU *
  2234. EX DE,HL
  2235. SET 0,(HL) AND SET VERTICAL PLOT
  2236. JP CG.SEL SELECT CHARACTER GENERATOR
  2237. *
  2238. FWD EQU *
  2239. EX DE,HL
  2240. RES 6,(HL) AND SET FORWARD PLOT
  2241. RET
  2242. *
  2243. REV EQU *
  2244. EX DE,HL
  2245. SET 6,(HL) AND SET REVERSE PLOT
  2246. RET
  2247. *
  2248. SIZE0 EQU *
  2249. LD HL,08 LOAD SIZE ONE CHARACTER
  2250. LD (SIZE),HL
  2251. EX DE,HL
  2252. RES 5,(HL) SET SIZE 0 FLAG
  2253. RET
  2254. *
  2255. SIZE2 EQU *
  2256. LD HL,10H LOAD SIZE TWO CHARACTER
  2257. LD (SIZE),HL
  2258. EX DE,HL
  2259. SET 5,(HL) SET SIZE 2 FLAG
  2260. RET
  2261. EJECT
  2262. * * * * * * * * * * * * * * * * * * * *
  2263. *
  2264. * CHARACTER GENERATOR
  2265. * CALCULATES CHARACTER DATA ADDRESS AND JUMPS TO CHARAC
  2266. * GENERATOR FOR PLOTTING DATA.
  2267. *
  2268. * ON ENTRY, L CONTAINS BIASED CHAR TO PLOT
  2269. * DE CONTAINS FWA OF CHAR MEM TO BE USED
  2270. *
  2271. * * * * * * * * * * * * * * * * * * * * *
  2272. SPACE 1
  2273. CHARGEN EQU *
  2274. *
  2275. LD H,00 ADJUST CHARACTER CODE
  2276. ADD HL,HL CHARACTER DATA TABLE
  2277. ADD HL,HL
  2278. ADD HL,HL
  2279. ADD HL,HL
  2280. LD BC,000FH
  2281. ADD HL,BC
  2282. ADD HL,DE CHARACTER DAT ADDRESS
  2283. LD A,(M.CCR) LOAD PLOTTING PARAMETERS
  2284. BIT 5,A TEST FOR SIZE ZERO OR SIZE T
  2285. JP NZ,SIZE.2
  2286. *
  2287. EX DE,HL
  2288. LD HL,(CG.ADR) LOAD CHARACTER GENERATOR ADD
  2289. JP (HL)
  2290. EJECT BLOCK WRITE/ERASE
  2291. EJECT SIZE 2
  2292. * * * * * * * * * * * * * * * * * * * * *
  2293. *
  2294. * SIZE 2 CHARACTER GENERATOR
  2295. * CHARACTER DATA IS EXPANDED TO DOUBLE THE WIDTH AND HE
  2296. * OF THE CHARACTER AS IT IS DISPLAYED ON THE DISPLAY SC
  2297. *
  2298. * * * * * * * * * * * * * * * * * * * * *
  2299. SPACE 1
  2300. SIZE.2 EQU *
  2301. PUSH HL PUT CHAR. DATA ADDR.
  2302. POP IX INTO IX REG.
  2303. LD DE,SAVE3F LOAD TEMP. STORE ADDRESSES
  2304. LD HL,SAVE1F
  2305. EXX
  2306. LD BC,0010H BYTE COUNT
  2307. SIZE2.A EQU *
  2308. EXX
  2309. LD B,02 PASS COUNT
  2310. LD C,(IX+0) DATA BYTE
  2311. SIZE2.B EQU *
  2312. XOR A EXPLODE 4 BITS TO 16 BITS
  2313. SRL C
  2314. JR NC,SIZE2.C
  2315. OR 03
  2316. SIZE2.C EQU *
  2317. SRL C
  2318. JR NC,SIZE2.D
  2319. OR 0CH
  2320. SIZE2.D EQU *
  2321. SRL C
  2322. JR NC,SIZE2.E
  2323. OR 30H
  2324. SIZE2.E EQU *
  2325. SRL C
  2326. JR NC,SIZE2.F
  2327. OR 0C0H
  2328. SIZE2.F EQU *
  2329. LD (DE),A STORE EXPLODED DATA
  2330. DEC DE
  2331. LD (DE),A
  2332. DEC DE
  2333. EX DE,HL
  2334. DJNZ SIZE2.B LOOP ON 2 PASSES
  2335. DEC IX POINT TO NEXT CHAR. DATA BYTE
  2336. EXX
  2337. DEC BC LOOP ON 16 COUNT
  2338. LD A,B
  2339. OR C
  2340. JR NZ,SIZE2.A
  2341. EXX
  2342. LD A,(M.CCR)
  2343. BIT 0,A
  2344. JR NZ,SIZE2V DO VERTICAL SIZE TWO
  2345. SIZE2H EQU *
  2346. LD HL,SAVE3F LOAD 3RD QUAD.
  2347. CALL CHARGEN1 AND DISPLAY
  2348. SPACE 2
  2349. * * * * * * * * * * * * * * * * * * * * *
  2350. *
  2351. * HORIZONTAL PLOT
  2352. *
  2353. * * * * * * * * * * * * * * * * * * * * *
  2354. SPACE 1
  2355. BIT 6,A TEST FOR REVERSE PLOT
  2356. JR NZ,SIZE2R DO REVERSE CHAR. PLOTTING
  2357. LD HL,(XREG) LOAD X COORDINATE
  2358. LD DE,-8
  2359. ADD HL,DE ADJUST FOR TOP HALF
  2360. CALL R.OUTX LOAD COORDINATE.
  2361. LD HL,(YREG) LOAD Y COORDINATE
  2362. LD DE,10H
  2363. ADD HL,DE
  2364. CALL R.OUTY LOAD COORDINATE.
  2365. *
  2366. LD HL,SAVE2F LOAD 2ND QUAD.
  2367. CALL CHARGEN1 AND DISPLAY
  2368. LD HL,SAVE0F LOAD 1ST QUAD.
  2369. CALL CHARGEN1 AND DISPLAY
  2370. *
  2371. LD HL,(XREG) LOAD X COORDINATE
  2372. LD DE,-8
  2373. ADD HL,DE ADJUST COORDINATE FOR NEXT P
  2374. CALL R.OUTX LOAD COORDINATE.
  2375. LD HL,(YREG) LOAD Y COORDINATE
  2376. LD DE,-10H
  2377. ADD HL,DE ADJUST COORDINATE FOR NEXT P
  2378. CALL R.OUTY LOAD COORDINATE.
  2379. *
  2380. LD HL,SAVE1F LOAD 4TH QUAD.
  2381. JP CHARGEN1 PLOT LAST PART OF CHARACTER
  2382. SPACE 2
  2383. * * * * * * * * * * * * * * * * * * * * *
  2384. *
  2385. * REVERSE HORIZONTAL PLOT
  2386. *
  2387. * * * * * * * * * * * * * * * * * * * * *
  2388. SPACE 1
  2389. SIZE2R EQU *
  2390. LD HL,(YREG) LOAD Y COORDINATE
  2391. LD DE,10H
  2392. ADD HL,DE
  2393. CALL R.OUTY LOAD COORDINATE.
  2394. *
  2395. LD HL,SAVE2F LOAD 2ND QUAD.
  2396. CALL CHARGEN1 PLOT NEXT PART OF CHARACTER
  2397. LD HL,(XREG) LOAD CURRENT X COORDINATE
  2398. LD DE,08 LOAD ADJUST CONSTANT
  2399. ADD HL,DE
  2400. CALL R.OUTX LOAD COORDINATE.
  2401. LD HL,SAVE0F LOAD 1ST QUAD.
  2402. CALL CHARGEN1 PLOT NEXT PART OF CHARACTER
  2403. LD HL,(YREG) LOAD Y COORDINATE
  2404. LD DE,-10H
  2405. ADD HL,DE ADJUST COORDINATE FOR NEXT P
  2406. CALL R.OUTY LOAD COORDINATE.
  2407. *
  2408. LD HL,SAVE1F LOAD 4TH QUAD.
  2409. CALL CHARGEN1 PLOT LAST PART OF CHARACTER
  2410. LD HL,(XREG) LOAD CURRENT X COORDINATE
  2411. LD DE,-08 LOAD ADJUST CONSTANT
  2412. ADD HL,DE
  2413. JP R.OUTX LOAD COORDINATE.
  2414. SPACE 2
  2415. * * * * * * * * * * * * * * * * * * * * *
  2416. *
  2417. * VERTICAL PLOT
  2418. *
  2419. * * * * * * * * * * * * * * * * * * * * *
  2420. SPACE 1
  2421. SIZE2V EQU *
  2422. LD HL,SAVE3F PLOT 3RD QUAD
  2423. CALL CHARGEN1
  2424. LD A,(M.CCR) TEST FOR REVERSE PLOTTING
  2425. BIT 6,A
  2426. JR NZ,SIZE2VR DO VERTICAL REVERSE PLOT
  2427. LD HL,(XREG) POSITION FOR 2ND QUAD
  2428. LD DE,-10H
  2429. ADD HL,DE
  2430. CALL R.OUTX
  2431. LD HL,(YREG)
  2432. LD DE,-08H
  2433. ADD HL,DE
  2434. CALL R.OUTY
  2435. LD HL,SAVE2F PLOT 2ND QUAD
  2436. CALL CHARGEN1
  2437. LD HL,SAVE0F PLOT 1ST QUAD
  2438. CALL CHARGEN1
  2439. LD HL,(XREG) POSITION FOR 4TH QUAD
  2440. LD DE,10H
  2441. ADD HL,DE
  2442. CALL R.OUTX
  2443. LD HL,(YREG)
  2444. LD DE,-08H
  2445. ADD HL,DE
  2446. CALL R.OUTY
  2447. LD HL,SAVE1F PLOT 4TH QUAD
  2448. JP CHARGEN1
  2449. EJECT SIZE 2 VERTICAL REVERSE
  2450. * * * * * * * * * * * * * * * * * * * * *
  2451. *
  2452. * REVERSE VERTICAL PLOT
  2453. *
  2454. * * * * * * * * * * * * * * * * * * * * *
  2455. SPACE 1
  2456. SIZE2VR EQU *
  2457. LD HL,(XREG) POSITION FOR 2ND QUAD
  2458. LD DE,-10H
  2459. ADD HL,DE
  2460. CALL R.OUTX
  2461. LD HL,SAVE2F PLOT 2ND QUAD
  2462. CALL CHARGEN1
  2463. LD HL,(YREG) POSITION FOR 1ST QUAD
  2464. LD DE,08H
  2465. ADD HL,DE
  2466. CALL R.OUTY
  2467. LD HL,SAVE0F PLOT 1ST QUAD
  2468. CALL CHARGEN1
  2469. LD HL,(XREG) POSITION FOR 4TH QUAD
  2470. LD DE,10H
  2471. ADD HL,DE
  2472. CALL R.OUTX
  2473. LD HL,SAVE1F PLOT 4TH QUAD
  2474. CALL CHARGEN1
  2475. LD HL,(YREG) POSITION FOR NEXT CHAR
  2476. LD DE,-08H
  2477. ADD HL,DE
  2478. CALL R.OUTY
  2479. RET
  2480. CHARGEN1 EQU *
  2481. EX DE,HL
  2482. LD HL,(CG.ADR) LOAD CHARACTER GENERATOR ADD
  2483. JP (HL)
  2484. EJECT FAST PLOT NORMAL(HORIZONTAL)
  2485. **********
  2486. * FAST HORIZONTAL PLOT NORMAL
  2487. **********
  2488. SPACE 2
  2489. FHPLOT EQU *
  2490. LDDR
  2491. FH.ADV EQU *
  2492. LD HL,0010H MOVE TO CHARACTER BOTTOM
  2493. ADD HL,DE
  2494. LD A,(M.CCR)
  2495. BIT 6,A
  2496. JR NZ,FH.ADV1 IF REVERSE, JUST ADJUST Y
  2497. INC H MOVE TO NEXT CHAR. POSITION
  2498. INC H IN THE X DIRECTION
  2499. SET 7,H
  2500. LD (DMAA),HL
  2501. LD BC,0008
  2502. LD HL,(XREG)
  2503. ADD HL,BC
  2504. LD A,H
  2505. AND 01
  2506. LD H,A
  2507. LD (XREG),HL
  2508. RET
  2509. FH.ADV1 EQU *
  2510. SET 7,H
  2511. LD (DMAA),HL
  2512. RET
  2513. EJECT FAST PLOT INVERSE (HORIZONTAL)
  2514. **********
  2515. * FAST PLOT INVERSE HORIZONTAL
  2516. **********
  2517. SPACE 2
  2518. FPLOTI EQU *
  2519. LD A,(DE) COMPLEMENT CHAR. DATA
  2520. CPL BEFORE WRITING TO SCREEN
  2521. LD (HL),A
  2522. DEC DE
  2523. DEC HL
  2524. DEC C
  2525. JR NZ,FPLOTI
  2526. EX DE,HL
  2527. JP FH.ADV
  2528. EJECT FAST PLOT OVERSTRIKE WRITE(HOR.)
  2529. **********
  2530. * FAST PLOT OVERSTRIKE WRITE HORIZONTAL
  2531. **********
  2532. SPACE 2
  2533. FPLOTOW EQU *
  2534. LD A,(DE) CHAR. DATA .OR. WITH SCREEN
  2535. OR (HL)
  2536. LD (HL),A
  2537. DEC DE
  2538. DEC HL
  2539. DEC C
  2540. JR NZ,FPLOTOW
  2541. EX DE,HL
  2542. JP FH.ADV
  2543. EJECT FAST PLOT OVERSTRIKE ERASE(HOR.)
  2544. **********
  2545. * FAST PLOT OVERSTRIKE ERASE HORIZONTAL
  2546. **********
  2547. SPACE 2
  2548. FPLOTOE EQU *
  2549. LD A,(DE)
  2550. CPL
  2551. AND (HL)
  2552. LD (HL),A
  2553. DEC DE
  2554. DEC HL
  2555. DEC C
  2556. JR NZ,FPLOTOE
  2557. EX DE,HL
  2558. JP FH.ADV
  2559. EJECT HORIZONTAL PLOT NORMAL
  2560. **********
  2561. * HORIZONTAL PLOT NORMAL
  2562. **********
  2563. SPACE 2
  2564. HPLOTN EQU *
  2565. EX DE,HL
  2566. LD DE,(DMAA)
  2567. LD BC,0010H
  2568. LD A,(BP)
  2569. OR A
  2570. JP Z,FHPLOT X AND Y ON BOUNDARY
  2571. AND 07H
  2572. JR NZ,HPN0
  2573. MHP1 EQU * ONLY Y OFF BOUNDARY
  2574. LDD
  2575. JP PO,H.ADV CHAR DONE, POINT TO NEXT CHAR
  2576. LD A,E
  2577. INC A
  2578. JR NZ,MHP1
  2579. BIT 0,D
  2580. JR Z,MHP1
  2581. INC D
  2582. INC D
  2583. SET 7,D
  2584. JR MHP1
  2585. *
  2586. HPN0 EQU * X AND Y OFF CHAR. BOUNDARIES
  2587. EXX
  2588. CALL MASKS
  2589. EXX
  2590. PUSH HL
  2591. POP IX IX HAS FWA OF CHAR. DATA
  2592. LD HL,(DMAA) DISPLAY MEMORY ADDR.
  2593. LD DE,(DMA1) DISPLAY MEMORY ADDR. NEXT COL.
  2594. LD B,10H LOOP COUNT
  2595. HPN1 EQU *
  2596. EXX
  2597. LD A,(BP)
  2598. AND 07H
  2599. LD B,A
  2600. LD A,(IX+0)
  2601. HPN2 EQU *
  2602. RLA
  2603. RL C
  2604. DJNZ HPN2
  2605. *
  2606. AND D
  2607. LD B,A
  2608. LD A,C
  2609. AND E
  2610. LD C,A
  2611. EXX
  2612. LD A,(HL)
  2613. EXX
  2614. AND E
  2615. OR B
  2616. EXX
  2617. LD (HL),A
  2618. LD A,(DE)
  2619. EXX
  2620. AND D
  2621. OR C
  2622. EXX
  2623. EX DE,HL
  2624. LD (HL),A
  2625. EX DE,HL
  2626. DEC DE
  2627. DEC HL
  2628. DEC IX
  2629. DJNZ HPN3
  2630. JP H.ADV
  2631. HPN3 EQU *
  2632. LD A,L
  2633. INC A
  2634. JR NZ,HPN1
  2635. BIT 0,H
  2636. JR Z,HPN1
  2637. INC H
  2638. INC H
  2639. SET 7,H
  2640. INC D
  2641. INC D
  2642. SET 7,D
  2643. JP HPN1
  2644. EJECT HORIZONTAL PLOT INVERSE
  2645. **********
  2646. * HORIZONTAL PLOT INVERSE
  2647. **********
  2648. SPACE 2
  2649. HPLOTI EQU *
  2650. * DE HAS CHAR. FWA
  2651. LD HL,(DMAA) HL HAS DISPLAY MEM. ADDR.
  2652. LD BC,0010H
  2653. LD A,(BP)
  2654. OR A
  2655. JP Z,FPLOTI X AND Y ON BOUNDARIES
  2656. AND 07H
  2657. JR NZ,HPI0
  2658. MHPI1 EQU * ONLY Y ON BOUNDARY
  2659. LD A,(DE) COMPLEMENT CHAR. DATA
  2660. CPL
  2661. LD (HL),A
  2662. DEC HL
  2663. DEC DE
  2664. DEC C
  2665. JP Z,H.ADV
  2666. LD A,L
  2667. INC A
  2668. JR NZ,MHPI1 CHECK FOR TOP OF SCREEN WRAP
  2669. BIT 0,H
  2670. JR Z,MHPI1 IF SET, ADJUST X FOR WRAP
  2671. INC H
  2672. INC H
  2673. SET 7,H
  2674. JR MHPI1 CONTINUE PLOTTING
  2675. *
  2676. HPI0 EQU * X AND Y OFF CHAR. BOUNDARIES
  2677. EXX
  2678. CALL MASKS
  2679. EXX
  2680. PUSH DE
  2681. POP IX IX HAS FWA OF CHAR. DATA
  2682. LD HL,(DMAA) DISPLAY MEMORY ADDR.
  2683. LD DE,(DMA1) DISPLAY MEMORY ADDR. NEXT COL.
  2684. LD B,10H LOOP COUNT
  2685. HPI1 EQU *
  2686. EXX
  2687. LD A,(BP)
  2688. AND 07H
  2689. LD B,A
  2690. LD A,(IX+0)
  2691. CPL
  2692. HPI2 EQU *
  2693. RLA
  2694. RL C
  2695. DJNZ HPI2
  2696. AND D
  2697. LD B,A
  2698. LD A,C
  2699. AND E
  2700. LD C,A
  2701. EXX
  2702. LD A,(HL)
  2703. EXX
  2704. AND E
  2705. OR B
  2706. EXX
  2707. LD (HL),A
  2708. LD A,(DE)
  2709. EXX
  2710. AND D
  2711. OR C
  2712. EXX
  2713. EX DE,HL
  2714. LD (HL),A
  2715. EX DE,HL
  2716. DEC DE
  2717. DEC HL
  2718. DEC IX
  2719. DJNZ HPI3
  2720. JP H.ADV
  2721. HPI3 EQU *
  2722. LD A,L
  2723. INC A
  2724. JR NZ,HPI1
  2725. BIT 0,H
  2726. JR Z,HPI1
  2727. INC H
  2728. INC H
  2729. SET 7,H
  2730. INC D
  2731. INC D
  2732. SET 7,D
  2733. JP HPI1
  2734. EJECT HORIZONTAL OVERSTRIKE WRITE
  2735. **********
  2736. * HORIZONTAL OVERSTRIKE WRITE
  2737. **********
  2738. SPACE 2
  2739. HPLOTOW EQU *
  2740. * DE HAS CHAR. FWA
  2741. LD HL,(DMAA) HL HAS DISPLAY MEM. ADDR.
  2742. LD BC,0010H
  2743. LD A,(BP)
  2744. OR A
  2745. JP Z,FPLOTOW X AND Y ON BOUNDARY
  2746. AND 07H
  2747. JR NZ,HPOW0
  2748. MHPOW1 EQU * ONLY Y ON BOUNDARY
  2749. LD A,(DE) CHAR. DATA .OR. WITH SCREEN
  2750. OR (HL)
  2751. LD (HL),A
  2752. DEC HL
  2753. DEC DE
  2754. DEC C
  2755. JP Z,H.ADV
  2756. LD A,L
  2757. INC A
  2758. JR NZ,MHPOW1 CHECK FOR TOP OF SCREEN WRAP
  2759. BIT 0,H
  2760. JR Z,MHPOW1 IF SET, ADJUST X FOR WRAP
  2761. INC H
  2762. INC H
  2763. SET 7,H
  2764. JR MHPOW1 CONTINUE PLOTTING
  2765. HPOW0 EQU * X AND Y OFF CHAR. BOUNDARIES
  2766. EXX
  2767. CALL MASKS
  2768. EXX
  2769. PUSH DE
  2770. POP IX IX HAS FWA OF CHAR. DATA
  2771. LD HL,(DMAA) DISPLAY MEMORY ADDR.
  2772. LD DE,(DMA1) DISPLAY MEMORY ADDR. NEXT COL.
  2773. LD B,10H LOOP COUNT
  2774. HPOW1 EQU *
  2775. EXX
  2776. LD A,(BP)
  2777. AND 07H
  2778. LD B,A
  2779. LD A,(IX+0)
  2780. HPOW2 EQU *
  2781. RLA
  2782. RL C
  2783. DJNZ HPOW2
  2784. AND D
  2785. LD B,A
  2786. LD A,C
  2787. AND E
  2788. LD C,A
  2789. EXX
  2790. LD A,(HL)
  2791. EXX
  2792. OR B
  2793. EXX
  2794. LD (HL),A
  2795. LD A,(DE)
  2796. EXX
  2797. OR C
  2798. EXX
  2799. EX DE,HL
  2800. LD (HL),A
  2801. EX DE,HL
  2802. DEC DE
  2803. DEC HL
  2804. DEC IX
  2805. DJNZ HPOW3
  2806. JP H.ADV
  2807. HPOW3 EQU *
  2808. LD A,L
  2809. INC A
  2810. JR NZ,HPOW1
  2811. BIT 0,H
  2812. JR Z,HPOW1
  2813. INC H
  2814. INC H
  2815. SET 7,H
  2816. INC D
  2817. INC D
  2818. SET 7,D
  2819. JP HPOW1
  2820. EJECT HORIZONTAL OVERSTRIKE ERASE
  2821. **********
  2822. * HORIZONTAL OVERSTRIKE ERASE
  2823. **********
  2824. SPACE 2
  2825. HPLOTOE EQU *
  2826. * DE HAS CHAR. FWA
  2827. LD HL,(DMAA) HL HAS DISPLAY MEM. ADDR.
  2828. LD BC,0010H
  2829. LD A,(BP)
  2830. OR A
  2831. JP Z,FPLOTOE X AND Y ON BOUNDARIES
  2832. AND 07H
  2833. JR NZ,HPOE0
  2834. MHPOE1 EQU * ONLY Y ON BOUNDARY
  2835. LD A,(DE) CHAR. DATA .OR. WITH SCREEN
  2836. CPL
  2837. AND (HL)
  2838. LD (HL),A
  2839. DEC HL
  2840. DEC DE
  2841. DEC C
  2842. JP Z,H.ADV
  2843. LD A,L
  2844. INC A
  2845. JR NZ,MHPOE1 CHECK FOR TOP OF SCREEN WRAP
  2846. BIT 0,H
  2847. JR Z,MHPOE1 IF SET, ADJUST X FOR WRAP
  2848. INC H
  2849. INC H
  2850. SET 7,H
  2851. JR MHPOE1 CONTINUE PLOTTING
  2852. HPOE0 EQU * X AND Y ON CHAR. BOUNDARIES
  2853. EXX
  2854. CALL MASKS
  2855. EXX
  2856. PUSH DE
  2857. POP IX IX HAS FWA OF CHAR. DATA
  2858. LD HL,(DMAA) DISPLAY MEMORY ADDR.
  2859. LD DE,(DMA1) DISPLAY MEMORY ADDR. NEXT COL.
  2860. LD B,10H LOOP COUNT
  2861. HPOE1 EQU *
  2862. EXX
  2863. LD A,(BP)
  2864. AND 07H
  2865. LD B,A
  2866. LD A,(IX+0)
  2867. CPL
  2868. HPOE2 EQU *
  2869. RLA
  2870. RL C
  2871. DJNZ HPOE2
  2872. AND D
  2873. OR E
  2874. LD B,A
  2875. LD A,C
  2876. AND E
  2877. OR D
  2878. LD C,A
  2879. EXX
  2880. LD A,(HL)
  2881. EXX
  2882. AND B
  2883. EXX
  2884. LD (HL),A
  2885. LD A,(DE)
  2886. EXX
  2887. AND C
  2888. EXX
  2889. EX DE,HL
  2890. LD (HL),A
  2891. EX DE,HL
  2892. DEC DE
  2893. DEC HL
  2894. DEC IX
  2895. DJNZ HPOE3
  2896. JP H.ADV
  2897. HPOE3 EQU *
  2898. LD A,L
  2899. INC A
  2900. JR NZ,HPOE1
  2901. BIT 0,H
  2902. JR Z,HPOE1
  2903. INC H
  2904. INC H
  2905. SET 7,H
  2906. INC D
  2907. INC D
  2908. SET 7,D
  2909. JP HPOE1
  2910. SPACE 2
  2911. **********
  2912. * HORIZONTAL ADVANCE
  2913. **********
  2914. SPACE 2
  2915. H.ADV EQU *
  2916. LD A,(M.CCR)
  2917. BIT 6,A
  2918. RET NZ IF REVERSE, RETURN
  2919. LD HL,(XREG) OTHERWISE ADVANCE
  2920. LD DE,0008 BY ONE CHAR. WIDTH
  2921. ADD HL,DE
  2922. JP R.OUTX
  2923. EJECT VERTICAL FPLOT NORMAL
  2924. **********
  2925. * FAST PLOT NORMAL VERTICAL
  2926. **********
  2927. SPACE 2
  2928. * THIS CHARACTER GENERATOR WORKS FOR VERTICAL
  2929. * CHARACTERS WHICH ARE ON THE X BOUNDARY.
  2930. * THE Y BOUNDARY WILL BE CHECKED DURING EXECUTION.
  2931. * VDMA1 AND VDMA2 ARE WRITTEN TO IN THAT ORDER.
  2932. * EACH IS DECREMENTED BY 1 AND SCREEN WRAP IS
  2933. * CHECKED. THIS IS REPEATED 8 TIMES FOR THE
  2934. * 16 BYTES MAKING UP THE CHARACTER.
  2935. SPACE 2
  2936. FVPLTN EQU *
  2937. LD B,08
  2938. * IX-LWA OF ROTATED CHAR DATA
  2939. LD HL,(VDMA1)
  2940. LD DE,(VDMA2)
  2941. FVN.0 EQU *
  2942. LD A,(IX+0)
  2943. LD (HL),A
  2944. LD A,(IX-1)
  2945. LD (DE),A
  2946. DEC B
  2947. JR Z,FVN.1
  2948. DEC IX
  2949. DEC IX
  2950. DEC HL
  2951. DEC DE
  2952. CALL V.WRAP
  2953. JR FVN.0
  2954. FVN.1 EQU *
  2955. CALL V.ADV
  2956. RET
  2957. EJECT FAST PLOT INVERSE VERTICAL
  2958. **********
  2959. * FAST PLOT INVERSE VERTICAL
  2960. **********
  2961. SPACE 2
  2962. * THIS CHARACTER GENERATOR WORKS FOR VERTICAL
  2963. * CHARACTERS WHICH ARE ON THE X BOUNDARY.
  2964. * THE Y BOUNDARY WILL BE CHECKED DURING EXECUTION.
  2965. * VDMA1 AND VDMA2 ARE WRITTEN TO IN THAT ORDER.
  2966. * EACH IS DECREMENTED BY 1 AND SCREEN WRAP IS
  2967. * CHECKED. THIS IS REPEATED 8 TIMES FOR THE
  2968. * 16 BYTES MAKING UP THE CHARACTER.
  2969. SPACE 2
  2970. FVPLTI EQU *
  2971. LD B,08
  2972. * IX-LWA OF ROTATED CHAR DATA
  2973. LD HL,(VDMA1)
  2974. LD DE,(VDMA2)
  2975. FVI.0 EQU *
  2976. LD A,(IX+0)
  2977. CPL
  2978. LD (HL),A
  2979. LD A,(IX-1)
  2980. CPL
  2981. LD (DE),A
  2982. DEC B
  2983. JR Z,FVI.1
  2984. DEC IX
  2985. DEC IX
  2986. DEC HL
  2987. DEC DE
  2988. CALL V.WRAP
  2989. JR FVI.0
  2990. FVI.1 EQU *
  2991. CALL V.ADV
  2992. RET
  2993. EJECT FAST OVERSTRIKE WRITE VERTICAL
  2994. **********
  2995. * FAST OVERSTRIKE WRITE VERTICAL
  2996. *********
  2997. SPACE 2
  2998. * THIS CHARACTER GENERATOR WORKS FOR VERTICAL
  2999. * CHARACTERS WHICH ARE ON THE X BOUNDARY.
  3000. * THE Y BOUNDARY WILL BE CHECKED DURING EXECUTION.
  3001. * VDMA1 AND VDMA2 ARE WRITTEN TO IN THAT ORDER.
  3002. * EACH IS DECREMENTED BY 1 AND SCREEN WRAP IS
  3003. * CHECKED. THIS IS REPEATED 8 TIMES FOR THE
  3004. * 16 BYTES MAKING UP THE CHARACTER.
  3005. SPACE 2
  3006. FVPLTOW EQU *
  3007. LD B,08
  3008. * IX-LWA OF ROTATED CHAR DATA
  3009. LD HL,(VDMA1)
  3010. LD DE,(VDMA2)
  3011. FVOW.0 EQU *
  3012. LD A,(IX+0)
  3013. OR (HL)
  3014. LD (HL),A
  3015. LD A,(IX-1)
  3016. EX DE,HL
  3017. OR (HL)
  3018. LD (HL),A
  3019. EX DE,HL
  3020. DEC B
  3021. JR Z,FVOW.1
  3022. DEC IX
  3023. DEC IX
  3024. DEC HL
  3025. DEC DE
  3026. CALL V.WRAP
  3027. JR FVOW.0
  3028. FVOW.1 EQU *
  3029. CALL V.ADV
  3030. RET
  3031. EJECT FAST OVERSTRIKE ERASE VERTICAL
  3032. **********
  3033. * FAST OVERSTRIKE ERASE VERTICAL
  3034. **********
  3035. SPACE 2
  3036. * THIS CHARACTER GENERATOR WORKS FOR VERTICAL
  3037. * CHARACTERS WHICH ARE ON THE X BOUNDARY.
  3038. * THE Y BOUNDARY WILL BE CHECKED DURING EXECUTION.
  3039. * VDMA1 AND VDMA2 ARE WRITTEN TO IN THAT ORDER.
  3040. * EACH IS DECREMENTED BY 1 AND SCREEN WRAP IS
  3041. * CHECKED. THIS IS REPEATED 8 TIMES FOR THE
  3042. * 16 BYTES MAKING UP THE CHARACTER.
  3043. SPACE 2
  3044. FVPLTOE EQU *
  3045. LD B,08
  3046. * IX-LWA OF ROTATED CHAR DATA
  3047. LD HL,(VDMA1)
  3048. LD DE,(VDMA2)
  3049. FVOE.0 EQU *
  3050. LD A,(IX+0)
  3051. CPL
  3052. AND (HL)
  3053. LD (HL),A
  3054. LD A,(IX-1)
  3055. EX DE,HL
  3056. CPL
  3057. AND (HL)
  3058. LD (HL),A
  3059. EX DE,HL
  3060. DEC B
  3061. JR Z,FVOE.1
  3062. DEC IX
  3063. DEC IX
  3064. DEC HL
  3065. DEC DE
  3066. CALL V.WRAP
  3067. JR FVOE.0
  3068. FVOE.1 EQU *
  3069. CALL V.ADV
  3070. RET
  3071. EJECT VERTICAL CHARACTER DATA ROTATION
  3072. * VERRT- VERTICAL ROTATION ROUTINE
  3073. * THIS ROUTINE MOVES THE CURRENT CHARACTER DATA
  3074. * TO A TEMPORARY STORAGE AREA, SAVE4F. THEN IT
  3075. * ROTATES 16 BYTES OF CHARACTER DATA TO A TEMPORARY
  3076. * STORAGE AREA, SAVE5F. 'THE ALGORITHM STORES BACK
  3077. * INTO SAVE4F AREA THE INTERMEDIATE ROTATES WHICH
  3078. * IS WHY THE INITIAL CHARACTER DATA MOVE IS NEEDED.
  3079. * THIS ROTATION FACILITATES THE VERTICAL
  3080. * CHARACTER GENERATION.
  3081. * ENTRY- DE HAS LWA OF CHARACTER DATA
  3082. * EXIT- IX HAS LWA OF ROTATED CHAR. DATA, SAVE5F
  3083. SPACE 2
  3084. VERRT EQU *
  3085. EX DE,HL MOVE CHARACTER DATA
  3086. LD DE,SAVE4F TO TEMPORARY STORE AREA
  3087. LD BC,0010H
  3088. LDDR
  3089. EX DE,HL
  3090. LD BC,0008
  3091. ADD HL,BC IX HAS LWA-8 OF CHAR. DATA
  3092. PUSH HL C RETAINS OUTER LOOP COUNT
  3093. POP IX
  3094. VERRT.0 EQU *
  3095. LD HL,SAVE5F FWA OF TEMPORARY CHAR. STORE
  3096. LD B,08
  3097. VERRT.1 EQU *
  3098. LD A,(IX+8)
  3099. RRA
  3100. LD (IX+8),A
  3101. RL (HL)
  3102. DEC HL
  3103. LD A,(IX+0)
  3104. RRA
  3105. LD (IX+0),A
  3106. RL (HL)
  3107. DEC HL
  3108. DJNZ VERRT.1 INNER LOOP 8 TIMES
  3109. DEC IX
  3110. DEC C
  3111. JR NZ,VERRT.0 OUTER LOOP 8 TIMES
  3112. LD HL,SAVE5F LOAD IX WITH LWA OF
  3113. PUSH HL OF ROTATED CHAR. DATA
  3114. POP IX FOR CHARACTER GENERATORS
  3115. RET
  3116. EJECT VERTICAL PLOT ADDRESS ADJUST/ADVANCE
  3117. **********
  3118. * VERTICAL PLOT ADDRESS ADJUST
  3119. **********
  3120. SPACE 2
  3121. VADR.ADJ EQU *
  3122. LD HL,(DMAA)
  3123. DEC H
  3124. DEC H
  3125. SET 7,H
  3126. LD (VDMA1),HL POINT TO WORD LEFT OF DMAA
  3127. DEC H
  3128. DEC H
  3129. SET 7,H
  3130. LD (VDMA2),HL POINT TO WORD LEFT OF VDMA1
  3131. RET
  3132. SPACE 2
  3133. **********
  3134. * VERTICAL CHARACTER GENERATOR ADVANCE ROUTINE
  3135. *********
  3136. V.ADV EQU *
  3137. LD A,(M.CCR)
  3138. BIT 6,A
  3139. RET NZ IF REVERSE, RETURN
  3140. LD DE,0008
  3141. CALL R.INPY
  3142. ADD HL,DE
  3143. CALL R.OUTY
  3144. RET
  3145. EJECT VERTICAL SCREEN TOP WRAP CHECK
  3146. **********
  3147. * VERTICAL WRAP ROUTINE
  3148. * CHECKS TO SEE IF SCREEN TOP HAS BEEN
  3149. * REACHED AND ADJUSTS VDMA1 AND VDMA2
  3150. * IF SO.
  3151. * ENTRY- DE HAS CURRENT DISPLAY MEM. ADDR.
  3152. **********
  3153. SPACE 2
  3154. V.WRAP EQU *
  3155. LD A,E
  3156. INC A
  3157. RET NZ
  3158. BIT 0,D
  3159. RET Z
  3160. INC D
  3161. INC D
  3162. INC H
  3163. INC H
  3164. SET 7,D
  3165. SET 7,H
  3166. RET
  3167. EJECT VERTICAL BIT ROTATE
  3168. **********
  3169. * VERTICAL PLOT NORMAL
  3170. **********
  3171. VPLOTN EQU *
  3172. CALL VERRT ROTATE CHAR DATA TO SAVE5F
  3173. CALL VADR.ADJ ADJUST SCREEN ADDRESSES
  3174. LD A,(BP) FOR VERTICAL WRITING
  3175. AND 07
  3176. JP Z,FVPLTN ON X BOUNDARY, FAST PLOT
  3177. *
  3178. * OTHERWISE CHARACTER PLOTTING IS OVER THREE
  3179. * EIGHT BIT WORDS. ROW BY ROW, CHARACTER DATA
  3180. * ON THE SCREEN WITHIN THE RIGHTMOST AND LEFTMOST
  3181. * BYTES MUST BE LEFT UNDISTURBED WHILE THE NEW
  3182. * CHARACTER IS WRITTEN IN NORMAL MODE TO THE
  3183. * 16 BITS MAKING UP THE CHARACTER HEIGHT. THE
  3184. * RIGHT BYTE AND RIGHT OF MIDDLE BYTE ARE WRITTEN TO
  3185. * FIRST THEN THE LEFT BYTE AND LEFTMOST PART OF
  3186. * MIDDLE BYTE ARE WRITTEN TO ON A ROW BY ROW BASIS
  3187. * FOR THE 8 ROWS MAKING UP THE CHARACTER WIDTH.
  3188. *
  3189. EXX
  3190. CALL MASKS DE - MASKS FOR CHAR DATA
  3191. * AND DISPLAY WORDS
  3192. LD BC,0802H B-CHAR WIDTH COUNT, C-COLUMNS
  3193. EXX
  3194. LD HL,SAVE5F LWA OF VERTICAL CHAR DATA
  3195. PUSH HL
  3196. POP IX
  3197. LD HL,(DMAA) RIGHTMOST BYTE OF VERTICALS
  3198. LD DE,(VDMA1) MIDDLE BYTE OF VERTICALS
  3199. VNORM.0 EQU *
  3200. LD A,(BP)
  3201. AND 07
  3202. LD B,A
  3203. LD A,(IX+0)
  3204. VNORM.1 EQU *
  3205. RLA
  3206. RL C
  3207. DJNZ VNORM.1
  3208. EXX
  3209. AND D
  3210. EXX
  3211. LD B,A
  3212. LD A,(DE)
  3213. EXX
  3214. AND E
  3215. EXX
  3216. OR B
  3217. LD (DE),A
  3218. LD A,C
  3219. EXX
  3220. AND E
  3221. EXX
  3222. LD B,A
  3223. LD A,(HL)
  3224. EXX
  3225. AND D
  3226. EXX
  3227. OR B
  3228. LD (HL),A
  3229. EXX
  3230. DEC B REPEAT FOR CHAR WIDTH OF 8
  3231. JR Z,VNORM.2
  3232. EXX
  3233. DEC IX
  3234. DEC IX
  3235. DEC HL
  3236. DEC DE
  3237. CALL V.WRAP
  3238. JR VNORM.0
  3239. VNORM.2 EQU *
  3240. LD B,08 RESET INNER LOOP COUNT
  3241. DEC C
  3242. EXX
  3243. JR Z,VNORM.3
  3244. LD HL,(VDMA1) REPEAT FOR LEFTMOST BYTE
  3245. LD DE,(VDMA2) AND LEFT OF MIDDLE BYTE
  3246. LD BC,000DH
  3247. ADD IX,BC
  3248. JR VNORM.0
  3249. VNORM.3 EQU *
  3250. CALL V.ADV
  3251. RET
  3252. EJECT VERTICAL PLOT INVERSE
  3253. **********
  3254. * VERTICAL PLOT INVERSE
  3255. **********
  3256. SPACE 2
  3257. VPLOTI EQU *
  3258. CALL VADR.ADJ
  3259. CALL VERRT IX - LWA OF ROTATED CHAR DATA
  3260. LD A,(BP)
  3261. AND 07
  3262. JP Z,FVPLTI
  3263. *
  3264. * OTHERWISE CHARACTER PLOTTING IS OVER THREE
  3265. * EIGHT BIT WORDS. ROW BY ROW, CHARACTER DATA
  3266. * ON THE SCREEN WITHIN THE RIGHTMOST AND LEFTMOST
  3267. * BYTES MUST BE LEFT UNDISTURBED WHILE THE NEW
  3268. * CHARACTER IS WRITTEN IN NORMAL MODE TO THE
  3269. * 16 BITS MAKING UP THE CHARACTER HEIGHT. THE
  3270. * RIGHT BYTE AND RIGHT OF MIDDLE BYTE ARE WRITTEN TO
  3271. * FIRST THEN THE LEFT BYTE AND LEFTMOST PART OF
  3272. * MIDDLE BYTE ARE WRITTEN TO ON A ROW BY ROW BASIS
  3273. * FOR THE 8 ROWS MAKING UP THE CHARACTER WIDTH.
  3274. *
  3275. EXX
  3276. CALL MASKS DE - MASKS FOR CHAR DATA
  3277. * AND DISPLAY WORDS
  3278. LD BC,0802H B-CHAR WIDTH COUNT, C-COLUMNS
  3279. EXX
  3280. * IX-LWA ROTATED CHAR DATA
  3281. LD HL,(DMAA) RIGHTMOST BYTE OF VERTICALS
  3282. LD DE,(VDMA1) MIDDLE BYTE OF VERTICALS
  3283. VINV.0 EQU *
  3284. LD A,(BP)
  3285. AND 07
  3286. LD B,A
  3287. LD A,(IX+0)
  3288. CPL
  3289. VINV.1 EQU *
  3290. RLA
  3291. RL C
  3292. DJNZ VINV.1
  3293. EXX
  3294. AND D
  3295. EXX
  3296. LD B,A
  3297. LD A,(DE)
  3298. EXX
  3299. AND E
  3300. EXX
  3301. OR B
  3302. LD (DE),A
  3303. LD A,C
  3304. EXX
  3305. AND E
  3306. EXX
  3307. LD B,A
  3308. LD A,(HL)
  3309. EXX
  3310. AND D
  3311. EXX
  3312. OR B
  3313. LD (HL),A
  3314. EXX
  3315. DEC B REPEAT FOR CHAR WIDTH OF 8
  3316. JR Z,VINV.2
  3317. EXX
  3318. DEC IX
  3319. DEC IX
  3320. DEC HL
  3321. DEC DE
  3322. CALL V.WRAP
  3323. JR VINV.0
  3324. VINV.2 EQU *
  3325. LD B,08 RESET INNER LOOP COUNT
  3326. DEC C
  3327. EXX
  3328. JR Z,VINV.3
  3329. LD HL,(VDMA1) REPEAT FOR LEFTMOST BYTE
  3330. LD DE,(VDMA2) AND LEFT OF MIDDLE BYTE
  3331. LD BC,000DH
  3332. ADD IX,BC
  3333. JR VINV.0
  3334. VINV.3 EQU *
  3335. CALL V.ADV
  3336. RET
  3337. EJECT VERTICAL PLOT OVERSTRIKE WRITE
  3338. **********
  3339. * VERTICAL PLOT OVERSTRIKE WRITE
  3340. **********
  3341. SPACE 2
  3342. VPLOTOW EQU *
  3343. CALL VADR.ADJ
  3344. CALL VERRT IX - LWA OF ROTATED CHAR DATA
  3345. LD A,(BP)
  3346. AND 07
  3347. JP Z,FVPLTOW
  3348. *
  3349. * OTHERWISE CHARACTER PLOTTING IS OVER THREE
  3350. * EIGHT BIT WORDS. ROW BY ROW, CHARACTER DATA
  3351. * ON THE SCREEN WITHIN THE RIGHTMOST AND LEFTMOST
  3352. * BYTES MUST BE LEFT UNDISTURBED WHILE THE NEW
  3353. * CHARACTER IS WRITTEN IN NORMAL MODE TO THE
  3354. * 16 BITS MAKING UP THE CHARACTER HEIGHT. THE
  3355. * RIGHT BYTE AND RIGHT OF MIDDLE BYTE ARE WRITTEN TO
  3356. * FIRST THEN THE LEFT BYTE AND LEFTMOST PART OF
  3357. * MIDDLE BYTE ARE WRITTEN TO ON A ROW BY ROW BASIS
  3358. * FOR THE 8 ROWS MAKING UP THE CHARACTER WIDTH.
  3359. *
  3360. EXX
  3361. CALL MASKS DE - MASKS FOR CHAR DATA
  3362. * AND DISPLAY WORDS
  3363. LD BC,0802H B-CHAR WIDTH COUNT, C-COLUMNS
  3364. EXX
  3365. * IX-LWA OF ROTATED CHAR DATA
  3366. LD HL,(DMAA) RIGHTMOST BYTE OF VERTICALS
  3367. LD DE,(VDMA1) MIDDLE BYTE OF VERTICALS
  3368. VOW.0 EQU *
  3369. LD A,(BP)
  3370. AND 07
  3371. LD B,A
  3372. LD A,(IX+0)
  3373. VOW.1 EQU *
  3374. RLA
  3375. RL C
  3376. DJNZ VOW.1
  3377. EXX
  3378. AND D
  3379. EXX
  3380. EX DE,HL
  3381. OR (HL)
  3382. EX DE,HL
  3383. LD (DE),A
  3384. LD A,C
  3385. EXX
  3386. AND E
  3387. EXX
  3388. OR (HL)
  3389. LD (HL),A
  3390. EXX
  3391. DEC B REPEAT FOR CHAR WIDTH OF 8
  3392. JR Z,VOW.2
  3393. EXX
  3394. DEC IX
  3395. DEC IX
  3396. DEC HL
  3397. DEC DE
  3398. CALL V.WRAP
  3399. JR VOW.0
  3400. VOW.2 EQU *
  3401. LD B,08 RESET INNER LOOP COUNT
  3402. DEC C
  3403. EXX
  3404. JR Z,VOW.3
  3405. LD HL,(VDMA1) REPEAT FOR LEFTMOST BYTE
  3406. LD DE,(VDMA2) AND LEFT OF MIDDLE BYTE
  3407. LD BC,000DH
  3408. ADD IX,BC
  3409. JR VOW.0
  3410. VOW.3 EQU *
  3411. CALL V.ADV
  3412. RET
  3413. EJECT VERTICAL OVERSTRIKE ERASE
  3414. **********
  3415. * VERTICAL OVERSTRIKE ERASE
  3416. **********
  3417. SPACE 2
  3418. VPLOTOE EQU *
  3419. CALL VADR.ADJ
  3420. CALL VERRT IX - LWA OF ROTATED CHAR DATA
  3421. LD A,(BP)
  3422. AND 07
  3423. JP Z,FVPLTOE
  3424. *
  3425. * OTHERWISE CHARACTER PLOTTING IS OVER THREE
  3426. * EIGHT BIT WORDS. ROW BY ROW, CHARACTER DATA
  3427. * ON THE SCREEN WITHIN THE RIGHTMOST AND LEFTMOST
  3428. * BYTES MUST BE LEFT UNDISTURBED WHILE THE NEW
  3429. * CHARACTER IS WRITTEN IN NORMAL MODE TO THE
  3430. * 16 BITS MAKING UP THE CHARACTER HEIGHT. THE
  3431. * RIGHT BYTE AND RIGHT OF MIDDLE BYTE ARE WRITTEN TO
  3432. * FIRST THEN THE LEFT BYTE AND LEFTMOST PART OF
  3433. * MIDDLE BYTE ARE WRITTEN TO ON A ROW BY ROW BASIS
  3434. * FOR THE 8 ROWS MAKING UP THE CHARACTER WIDTH.
  3435. *
  3436. EXX
  3437. CALL MASKS DE - MASKS FOR CHAR DATA
  3438. * AND DISPLAY WORDS
  3439. LD BC,0802H B-CHAR WIDTH COUNT, C-COLUMNS
  3440. EXX
  3441. * IX-LWA OF ROTATED CHAR DATA
  3442. LD HL,(DMAA) RIGHTMOST BYTE OF VERTICALS
  3443. LD DE,(VDMA1) MIDDLE BYTE OF VERTICALS
  3444. VOE.0 EQU *
  3445. LD A,(BP)
  3446. AND 07
  3447. LD B,A
  3448. LD A,(IX+0)
  3449. CPL
  3450. VOE.1 EQU *
  3451. RLA
  3452. RL C
  3453. DJNZ VOE.1
  3454. EXX
  3455. AND D
  3456. OR E
  3457. EXX
  3458. EX DE,HL
  3459. AND (HL)
  3460. EX DE,HL
  3461. LD (DE),A
  3462. LD A,C
  3463. EXX
  3464. AND E
  3465. OR D
  3466. EXX
  3467. AND (HL)
  3468. LD (HL),A
  3469. EXX
  3470. DEC B REPEAT FOR CHAR WIDTH OF 8
  3471. JR Z,VOE.2
  3472. EXX
  3473. DEC IX
  3474. DEC IX
  3475. DEC HL
  3476. DEC DE
  3477. CALL V.WRAP
  3478. JR VOE.0
  3479. VOE.2 EQU *
  3480. LD B,08 RESET INNER LOOP COUNT
  3481. DEC C
  3482. EXX
  3483. JR Z,VOE.3
  3484. LD HL,(VDMA1) REPEAT FOR LEFTMOST BYTE
  3485. LD DE,(VDMA2) AND LEFT OF MIDDLE BYTE
  3486. LD BC,000DH
  3487. ADD IX,BC
  3488. JR VOE.0
  3489. VOE.3 EQU *
  3490. CALL V.ADV
  3491. RET
  3492. EJECT BLOCK WRITE/ERASE
  3493. * * * * * * * * * * * * * * * * * * * * *
  3494. *
  3495. *
  3496. * BLOCK WRITE/ERASE
  3497. *
  3498. * * * * * * * * * * * * * * * * * * * * *
  3499. SPACE 2
  3500. *
  3501. ABLOCK EQU *
  3502. CALL GETXY GET AN X AND Y COORD
  3503. LD A,(MODE4CNT) CHECK WHICH SET OF COORDS
  3504. XOR 1
  3505. LD (MODE4CNT),A
  3506. JR Z,ABLOCK1
  3507.  
  3508. LD (BLOCKX),HL FIRST SET OF COORDS
  3509. LD (BLOCKY),DE
  3510. RET
  3511.  
  3512. ABLOCK1 LD (XEND),HL SECOND SET OF COORDS
  3513. LD (YEND),DE
  3514. LD HL,BLOCKX POINT TO COORDS
  3515.  
  3516. * USER ENTRY POINT
  3517. BLOCK EQU *
  3518. LD DE,BLOCKX STORE USER'7S COORDINATES
  3519. LD BC,0008H TO PROGRAM MEMORY
  3520. LDIR STARTING AT BLOCKX
  3521. *
  3522. LD A,(BLOCKX) SAVE1 _ MASK FOR 1ST X COORD.
  3523. AND 07
  3524. CALL MASKS0
  3525. EX DE,HL
  3526. LD (SAVEL),HL
  3527. *
  3528. LD A,(XEND) SAVE2 _ MASK FOR 2ND X COORD.
  3529. AND 07
  3530. CALL MASKS0
  3531. EX DE,HL
  3532. LD (SAVER),HL
  3533. *
  3534. LD HL,BLOCKX+1 ENSURE EACH COORDINATE
  3535. LD B,04 IS 9 BITS MAX.
  3536. LD C,01
  3537. *
  3538. BLOCK0 EQU *
  3539. LD A,(HL)
  3540. AND C
  3541. LD (HL),A
  3542. INC HL
  3543. INC HL
  3544. DJNZ BLOCK0
  3545. *
  3546. MODE4.B EQU *
  3547. LD C,00
  3548. LD HL,(BLOCKX)
  3549. CALL CALDELX CALCULATE DELTA X
  3550. LD HL,(BLOCKY)
  3551. CALL CALDELY CALCULATE DELTA Y
  3552. BIT 4,C IF DELTA Y IS POSITIVE
  3553. LD HL,(YEND) USE YEND AS BEGINNING
  3554. JR Z,MODE4.C Y COORD.
  3555. LD HL,(BLOCKY) OTHERWISE, USE BLOCKY
  3556. *
  3557. MODE4.C EQU *
  3558. CALL R.OUTY THIS WILL COMPLEMENT Y
  3559. *
  3560. BIT 3,C IF DELTA X IS POSITIVE
  3561. LD HL,(BLOCKX) USE BLOCKX AS BEGINNING
  3562. LD BC,(SAVEL) XCOORD.
  3563. LD DE,(SAVER)
  3564. JR Z,MODE4.D
  3565. LD HL,(XEND) OTHERWISE, USE XEND
  3566. LD BC,(SAVER)
  3567. LD DE,(SAVEL)
  3568. *
  3569. MODE4.D EQU *
  3570. SLA D
  3571. LD A,D
  3572. LD (RMASK),A
  3573. LD A,B
  3574. LD (LMASK),A
  3575. LD A,C
  3576. XOR D
  3577. LD (MMASK),A
  3578. CALL R.OUTX SET BEGINNING X ON SCREEN
  3579. LD BC,(YDELTA)
  3580. LD HL,(XDELTA)
  3581. LD A,(BP)
  3582. AND 07
  3583. LD E,A
  3584. LD D,00
  3585. ADD HL,DE IS DELTA X + BP > 0
  3586. LD DE,0007
  3587. SBC HL,DE
  3588. JR C,MODE4.E LESS THAN 8 BIT WIDTH
  3589. JR NZ,MODE4.F MORE THAN 8 BIT WIDTH
  3590. *
  3591. MODE4.E EQU *
  3592. LD A,(MMASK) *CASE 1* DELTA X WITHIN 8 BITS
  3593. LD D,A
  3594. LD HL,(DMAA)
  3595. LD A,(M.MODE)
  3596. BIT 0,A
  3597. JP Z,BLOCKES
  3598. LD A,D
  3599. CPL
  3600. LD D,A
  3601. JP BLOCKWS
  3602. *
  3603. MODE4.F EQU *
  3604. LD HL,(DMAA)
  3605. EXX
  3606. LD DE,(XDELTA) WORD COUNT _ DELTA X / 8
  3607. LD A,E
  3608. AND 07
  3609. LD B,A
  3610. SRL D
  3611. RR E
  3612. SRL D
  3613. RR E
  3614. SRL E
  3615. LD A,(BP)
  3616. AND 07
  3617. ADD A,B
  3618. CP 08
  3619. JR C,MODE4.G
  3620. INC E GREATER THAN 0, WORD COUNT + 1
  3621. *
  3622. MODE4.G EQU *
  3623. EXX
  3624. LD A,(LMASK)
  3625. LD D,A
  3626. LD A,(M.MODE)
  3627. BIT 0,A
  3628. JP NZ,BLOCKW
  3629. *
  3630. LD A,(LMASK)
  3631. CPL
  3632. LD D,A
  3633. JP BLOCKE
  3634. EJECT SHORT BLOCK WRITE/ERASE
  3635. * * * * * * * * * * * * * * * * * * * * *
  3636. *
  3637. * SHORT BLOCK ERASE, LESS THAN ONE BYTE IN Y AXIS
  3638. *
  3639. * * * * * * * * * * * * * * * * * * * * *
  3640. SPACE 1
  3641. BLOCKES EQU *
  3642. LD A,(HL) LOAD DMA DATA
  3643. AND D AND MASK SAVE BITS
  3644. LD (HL),A
  3645. *
  3646. LD A,B AND TEST
  3647. OR C ZERO COUNT
  3648. JP Z,BLK.EXIT END OF PLOT
  3649. DEC BC DECREMENT LOOP COUNT
  3650. INC HL INCREMENT ADDRESS
  3651. JR BLOCKES
  3652. SPACE 2
  3653. * * * * * * * * * * * * * * * * * * * * *
  3654. *
  3655. * SHORT BLOCK WRITE, LESS THAN ONE BYTE IN Y AXIS
  3656. *
  3657. * * * * * * * * * * * * * * * * * * * * *
  3658. SPACE 1
  3659. BLOCKWS EQU *
  3660. LD A,(HL) LOAD DMA DATA
  3661. OR D WRITE
  3662. LD (HL),A
  3663. *
  3664. LD A,B AND TEST
  3665. OR C ZERO COUNT
  3666. JP Z,BLK.EXIT END OF PLOT
  3667. DEC BC DECREMENT LOOP COUNT
  3668. INC HL INCREMENT ADDRESS
  3669. JR BLOCKWS
  3670. EJECT
  3671. * * * * * * * * * * * * * * * * * * * * *
  3672. * BLOCK ERASE
  3673. * HL DMA ADDRESS
  3674. * D MASK
  3675. * E LINE COUNT
  3676. * BC X DELTA
  3677. *
  3678. * * * * * * * * * * * * * * * * * * * * *
  3679. SPACE 2
  3680. BLOCKE EQU *
  3681. LD A,(HL) LOAD DMA DATA
  3682. AND D AND MASK SAVE BITS
  3683. LD (HL),A
  3684. *
  3685. LD A,B AND TEST
  3686. OR C ZERO COUNT
  3687. JR Z,BLOCK1
  3688. DEC BC DECREMENT LOOP COUNT
  3689. INC HL INCREMENT ADDRESS
  3690. JR BLOCKE
  3691. *
  3692. BLOCK1 EQU *
  3693. LD BC,(YDELTA) LOAD WIDTH OF ERASE AREA
  3694. LD HL,(DMAA) LOAD REFRESH MEMORY ADDRESS
  3695. INC H DO NEXT COLUMN
  3696. INC H
  3697. SET 7,H REFRESH MEMORY ADDRESS BIT
  3698. EXX
  3699. DEC E DECREMENT LINE COUNT
  3700. EXX
  3701. JR NZ,BLOCK3 DO NEXT LINE IF NON ZERO
  3702. *
  3703. LD A,(RMASK) ELSE LOAD MASK
  3704. LD D,A
  3705. *
  3706. BLOCK2 EQU *
  3707. LD A,(HL) LOAD DMA DATA
  3708. AND D AND MASK SAVE BITS
  3709. LD (HL),A
  3710. *
  3711. LD A,B AND TEST
  3712. OR C ZERO COUNT
  3713. JR Z,BLK.EXIT END OF PLOT
  3714. DEC BC DECREMENT LOOP COUNT
  3715. INC HL INCREMENT ADDRESS
  3716. JR BLOCK2
  3717. *
  3718. BLOCK3 EQU *
  3719. LD D,H
  3720. LD E,L
  3721. LD (DMAA),HL STORE NEXT LINE ADDRESS
  3722. LD (HL),00H ERASE FIRST CELL
  3723. LD A,B
  3724. OR C TEST FOR SINGLE DOT WIDTH
  3725. JR Z,BLOCK1 SINGLE DOT
  3726. *
  3727. INC DE INCREMENT DESTINATION ADDRES
  3728. LDIR ERASE LINE
  3729. JR BLOCK1 TEST FOR LAST LINE
  3730. EJECT
  3731. * * * * * * * * * * * * * * * * * * * * *
  3732. *
  3733. * BLOCK WRITE
  3734. *
  3735. * * * * * * * * * * * * * * * * * * * * *
  3736. SPACE 2
  3737. BLOCKW EQU *
  3738. LD A,(HL) LOAD DMA DATA
  3739. OR D WRITE
  3740. LD (HL),A
  3741. *
  3742. LD A,B AND TEST
  3743. OR C ZERO COUNT
  3744. JR Z,BLOCKW1
  3745. DEC BC DECREMENT LOOP COUNT
  3746. INC HL INCREMENT ADDRESS
  3747. JR BLOCKW
  3748. *
  3749. BLOCKW1 EQU *
  3750. LD BC,(YDELTA) LOAD WIDTH OF WRITE AREA
  3751. LD HL,(DMAA) LOAD REFRESH MEMORY ADDRESS
  3752. INC H
  3753. INC H DO NEXT COLUMN
  3754. SET 7,H REFRESH MEMORY ADDRESS BIT
  3755. EXX
  3756. DEC E DECREMENT LINE COUNT
  3757. EXX
  3758. JR NZ,BLOCKW3 DO NEXT LINE IF NON ZERO
  3759. *
  3760. LD A,(RMASK) ELSE LOAD MASK
  3761. CPL
  3762. LD D,A
  3763. *
  3764. BLOCKW2 EQU *
  3765. LD A,(HL) LOAD DMA DATA
  3766. OR D WRITE
  3767. LD (HL),A
  3768. *
  3769. LD A,B AND TEST
  3770. OR C ZERO COUNT
  3771. JR Z,BLK.EXIT END OF PLOT
  3772. DEC BC DECREMENT LOOP COUNT
  3773. INC HL INCREMENT ADDRESS
  3774. JR BLOCKW2
  3775. *
  3776. BLOCKW3 EQU *
  3777. LD D,H
  3778. LD E,L
  3779. LD (DMAA),HL STORE NEXT LINE ADDRESS
  3780. LD (HL),0FFH STORE ONES IN DMA
  3781. LD A,B
  3782. OR C TEST FOR SINGLE DOT WIDTH
  3783. JR Z,BLOCKW1 SINGLE DOT
  3784. *
  3785. INC DE
  3786. LDIR
  3787. JR BLOCKW1 TEST FOR LAST LINE
  3788. * * * * * * * * * * * * * * * * * * * * *
  3789. *
  3790. * BLOCK WRITE/ERASE EXIT
  3791. * X COORDINATE IS SET TO FIRST X COORDINATE RECEIVED
  3792. * Y COORDINATE IS SET TO FIRST Y COORDINATE 7INUS 15
  3793. *
  3794. * * * * * * * * * * * * * * * * * * * * *
  3795. SPACE 2
  3796. BLK.EXIT EQU *
  3797. LD HL,(BLOCKX) LOAD FIRST X COORDINATE
  3798. CALL OUTX AND SET REFRESH ADDRESS
  3799. LD HL,(BLOCKY) LOAD FIRST Y COORDINATE
  3800. LD DE,-15 LOAD NEGATIVE FIFTEEN
  3801. ADD HL,DE AND ADD TO Y COORDINATE
  3802. CALL OUTY AND SET REFRESH ADDRESS
  3803. RET EXIT TO CALLER
  3804. *********
  3805. * GET X AND Y COORDINATES.
  3806. * POP RETURNS ARE EXECUTED UNTIL LOW X BYTE IS RECEIVED.
  3807. * THEN A NORMAL RETURN IS EXECUTED WITH THE X COORDINATE
  3808. * IN HL AND THE Y COORDINATE IN DE.
  3809. *********
  3810. GETXY EQU *
  3811. LD A,C RESTORE DATA
  3812. LD HL,NBYTES INCR. NUMBER OF INPUTS
  3813. INC (HL)
  3814. AND 60H IF CHAR AND 60H=20H, HI Y
  3815. CP 20H
  3816. JR NZ,LOYCHK OTHERWISE, CHECK FOR LO Y
  3817. LD A,1FH HIGH=(CHAR-32)*32
  3818. AND C
  3819. LD L,A
  3820. LD H,00
  3821. ADD HL,HL
  3822. ADD HL,HL
  3823. ADD HL,HL
  3824. ADD HL,HL
  3825. ADD HL,HL HL=HIGH
  3826. LD A,(NBYTES) IF THIS INPUT IS FIRST
  3827. CP 01 IN SEQ. IT IS HIGH Y BYE
  3828. JR Z,HIYBYTE
  3829. LD (HIX),HL OTHERWISE, IT IS HIGH X
  3830. POP AF POP AND RET TO IDLE
  3831. RET
  3832. *
  3833. HIYBYTE EQU *
  3834. LD (HIY),HL
  3835. POP AF
  3836. RET
  3837. LOYCHK EQU *
  3838. CP 60H IF CHAR AND 60H=60H, LO Y
  3839. JR NZ,LOXCHK OTHERWISE, CHECK FOR LOW X
  3840. LD A,C
  3841. AND 1FH
  3842. LD (LOY),A LOY=(CHAR-32)
  3843. POP AF POP AND RET TO IDLE
  3844. RET
  3845. *
  3846. LOXCHK EQU *
  3847. CP 40H IF CHAR AND 60H=40H, LO X
  3848. JR NZ,ERR ERR RETURN TO IDLE DEFAULT
  3849. LD A,C
  3850. AND 1FH LOX=(CHAR-32)
  3851. LD (LOX),A
  3852. LD HL,(HIX)
  3853. OR L
  3854. LD L,A
  3855. EX DE,HL DE HAS X COORD
  3856. LD A,(LOY)
  3857. LD HL,(HIY)
  3858. OR L
  3859. LD L,A
  3860. EX DE,HL HL HAS X COORD
  3861. * DE HAS Y COORD
  3862. XOR A CLEAR COMMAND MODE FLAG
  3863. LD (CMODE),A
  3864. LD (NBYTES),A SET NINPUTS TO 0
  3865. LD A,(SCALEFG) LOAD SCALE/NO SCALE FLAG
  3866. RRA
  3867. RET C IF SET, COORDS AS IS
  3868. *
  3869. CALL DIVBY2 OTHERWISE, SCALE BY
  3870. EX DE,HL BY FACTOR OF 2
  3871. CALL DIVBY2 TO SCALE INTO 511X511
  3872. EX DE,HL
  3873. PUSH HL SAVE X COORD.
  3874. LD HL,(BIAS) BIAS Y COORD.
  3875. ADD HL,DE
  3876. EX DE,HL
  3877. POP HL
  3878. RET
  3879. *
  3880. ERR EQU *
  3881. POP AF
  3882. RET
  3883. *
  3884. DIVBY2 EQU *
  3885. LD A,H
  3886. OR L
  3887. RET Z
  3888. LD A,H
  3889. AND 7FH
  3890. RRA
  3891. LD H,A
  3892. LD A,L
  3893. RRA
  3894. LD L,A
  3895. RET
  3896. **********
  3897. * GET NEXT 3 DATA BYTES AND ASSEMBLE THEM
  3898. * INTO A 2-BIT WORD IN C REG. AND A 16-BIT WORD IN HL REG.
  3899. **********
  3900. GET3 EQU *
  3901. LD A,3FH UNBIAS CHAR
  3902. AND C
  3903. LD C,A
  3904.  
  3905. LD HL,NBYTES
  3906. LD A,(HL)
  3907. INC (HL) INCREMENT NBYTES
  3908. AND A TEST NBYTES
  3909. JR NZ,GET3.1
  3910.  
  3911. LD L,C FIRST CHAR
  3912. LD H,A
  3913. LD (DWORD),HL
  3914. POP HL
  3915. RET
  3916.  
  3917. GET3.1 EQU *
  3918. DEC A
  3919. JR NZ,GET3.2
  3920.  
  3921. LD A,C SECOND CHAR
  3922. RRCA
  3923. RRCA
  3924. LD D,A
  3925. AND 0C0H
  3926. LD E,A
  3927. LD A,D
  3928. AND 0FH
  3929. LD D,A
  3930. LD HL,(DWORD)
  3931. ADD HL,DE
  3932. LD (DWORD),HL
  3933. POP HL
  3934. RET
  3935.  
  3936. GET3.2 EQU *
  3937. LD A,C THIRD CHAR
  3938. RLCA
  3939. RLCA
  3940. RLCA
  3941. RLCA
  3942. LD C,A
  3943. AND 0F0H
  3944. LD D,A
  3945. LD E,00H
  3946. LD HL,(DWORD)
  3947. ADD HL,DE
  3948. LD A,C
  3949. AND 03H
  3950. LD C,A
  3951. XOR A
  3952. LD (NBYTES),A CLEAR NBYTES
  3953. LD (CMODE),A CLEAR CMODE
  3954. RET
  3955. EJECT USER MODE ENTRY
  3956. * * * * * * * * * * * * * * * * * * * * *
  3957. *
  3958. * USER MODES
  3959. *
  3960. * * * * * * * * * * * * * * * * * * * * *
  3961. SPACE 2
  3962. MODE5 EQU *
  3963. CALL GET3 GET NEXT 3 BYTES IN C,H,L
  3964. EX DE,HL DE=BITS 16-01 (C=BITS 18-17)
  3965. LD HL,(MOD5A) LOAD MODE 5 ADDRESS
  3966. JP (HL)
  3967. *
  3968. MODE6 EQU *
  3969. CALL GET3 GET NEXT 3 BYTES IN C,H,L
  3970. EX DE,HL DE=BITS 16-01 (C=BITS 18-17)
  3971. LD HL,(MOD6A) LOAD MODE 6 ADDRESS
  3972. JP (HL)
  3973. *
  3974. MODE7 EQU *
  3975. CALL GET3 GET NEXT 3 BYTES IN C,H,L
  3976. EX DE,HL DE=BITS 16-01 (C=BITS 18-17)
  3977. LD HL,(MOD7A) LOAD MODE 7 ADDRESS
  3978. JP (HL)
  3979. EJECT ASSEMBLE COMM LINE INPUT
  3980. * * * * * * * * * * * * * * * * * * * * *
  3981. *
  3982. * PROCESS INTERRUPT MASK AND ENABLR DEVICES
  3983. *
  3984. * INTERRUPT MASK
  3985. * BIT 0 SERIAL CHANNEL
  3986. * BIT 1 UNUSED
  3987. * BIT 2 UNUSED
  3988. * BIT 3 EXTERNAL DEVICE
  3989. * BIT 4 COMM LINE CHARACTER REQUEST
  3990. * BIT 5 TOUCH PANEL
  3991. * BIT 6 KEYBOARD
  3992. * BIT 7 COMM LINE CHARACTER READY
  3993. *
  3994. *
  3995. * * * * * * * * * * * * * * * * * * * * *
  3996. SPACE 1
  3997. ENAB EQU *
  3998. LD L,A SAVE CURRENT ENABLE BITS
  3999. AND 20H MASK FOR TP ENABLE
  4000. JR Z,ENAB.1 IF ZERO, DISABLE TOUCH PANEL
  4001. LD A,(M.ENAB) TEST FOR REENABLE OF TP
  4002. AND 20H
  4003. JR NZ,ENAB.1 IF REENABLE, ENAB.1
  4004. IN A,(SYSSTAT) TEST FOR TOUCH PANEL DATA
  4005. BIT 4,A
  4006. JR Z,ENAB.1 NO DATA, ENAB.1
  4007. IN A,(TPDATA) RID OF EXTRA TOUCH
  4008. ENAB.1 EQU *
  4009. LD A,L
  4010. AND 68H MASK ENABLE BITS
  4011. OR 45H ENAB LONG INT, K/B AND SER CHN
  4012. LD (M.ENAB),A AND STORE
  4013. OUT (INTMSK),A ENABLE/DISABLE DEVICES
  4014. RET
  4015. EJECT M.CCR
  4016. * * * * * * * * * * * * * * * * * * * * *
  4017. *
  4018. * M.CCR AND CHARACTER PLOTTING PARAMETERS ARE SET IN
  4019. * ACCORDANCE EITH THE CONTENTS OF HL REGISTER PAIR.
  4020. *
  4021. * BIT FUNCTION
  4022. * 0 1=VERTICAL, 0=HORIZONTAL
  4023. * 1,2,3 CHARACTER MEMORY SELECT, 0-7
  4024. * 4 UNUSED
  4025. * 5 1=SIZE TWO CHARACTERS, 0=SIZE ONE CHARACTER
  4026. * 6 1=REVERSE, 0=FORWARD
  4027. * 7 1=UNCOVER CODE LAST CHARACTER CODE RECEIVED
  4028. *
  4029. * * * * * * * * * * * * * * * * * * * * *
  4030. SPACE 1
  4031. CCR EQU *
  4032. LD (M.CCR),HL STORE BIT SETTINGS IN M.CCR
  4033. LD A,0EH SET UP (MEMSEL)
  4034. AND L
  4035. CALL LDMEMSEL
  4036. LD A,(M.CCR) SET UP (SIZE)
  4037. LD HL,8
  4038. BIT 5,A
  4039. JR Z,CCR.1
  4040. ADD HL,HL
  4041. CCR.1 LD (SIZE),HL
  4042. JP CG.SEL SET UP (CG.ADR)
  4043. EJECT CHAR. GEN. SELECT
  4044. * * * * * * * * * * * * * * * * * * * * *
  4045. *
  4046. * CHARACTER GENERATOR SELECT
  4047. *
  4048. * THIS ROUTINE SELECTS THE CORRECT CHARACTER GENERATOR
  4049. * PLOT CHARACTERS DEPENDING ON HORIZONTAL OR VERTICAL P
  4050. * WEATHER CHARACTER STARTS ON BYTE BOUNDARY OR OFF SET,
  4051. * AND THE WRITE/ERASE BIT SETTING.
  4052. *
  4053. * * * * * * * * * * * * * * * * * * * * *
  4054. SPACE 2
  4055. CG.SEL EQU *
  4056. LD A,(M.MODE) LOAD WRITE/ERASE
  4057. AND 03 BITS FROM MODE SELECT.
  4058. LD C,A
  4059. LD A,(M.CCR) LOAD HOR/VERT BITS
  4060. SET 2,C
  4061. BIT 0,A TEST FOR HOR. OR VERT. PLOT
  4062. JR NZ,CGSEL1 JUMP IF VERT PLOT
  4063. RES 2,C ELSE CLEAR BIT FOR HORIZON
  4064. *
  4065. CGSEL1 EQU *
  4066. LD B,00 LOAD REGISTERS BC
  4067. SLA C FOR INDEX TO TABLE
  4068. LD HL,CG.TBL LOAD FWA OF TABLE
  4069. ADD HL,BC AND ADD INDEX
  4070. LD A,(HL) LOAD LOWER BITS OF CG ADDRES
  4071. LD (CG.ADR),A AND STORE
  4072. INC HL
  4073. LD A,(HL) LOAD UPPER BITS OF CG ADDRES
  4074. LD (CG.ADR+1),A AND STORE
  4075. RET
  4076. *
  4077. * CHARACTER GENERATOR ADDRESS TABLE
  4078. *
  4079. CG.TBL EQU *
  4080. DEFW HPLOTI HORIZONTAL PLOT INVERSE
  4081. DEFW HPLOTN HORIZONTAL PLOT NORMAL
  4082. DEFW HPLOTOE HORIZONTAL OVERSTRIKE ERASE
  4083. DEFW HPLOTOW HORIZONTAL OVERSTRIKE WRITE
  4084. DEFW VPLOTI
  4085. DEFW VPLOTN
  4086. DEFW VPLOTOE
  4087. DEFW VPLOTOW
  4088. EJECT
  4089. * * * * * * * * * * * * * * * * * * * * *
  4090. *
  4091. * CALCULATE DELTA OF X AND Y BEGIN AND END POINTS
  4092. *
  4093. * * * * * * * * * * * * * * * * * * * * *
  4094. SPACE 1
  4095. CALDELX EQU *
  4096. EX DE,HL
  4097. LD HL,(XEND) LOAD X END POINT
  4098. LD B,08H LOAD PLOTTING BIT
  4099. CALL CALDEL DO CALCULATION
  4100. LD (XDELTA),HL STORE DELTA
  4101. RET
  4102. *
  4103. CALDELY EQU *
  4104. EX DE,HL
  4105. LD HL,(YEND) LOAD Y END POINT
  4106. LD B,10H LOAD PLOTTING BIT
  4107. CALL CALDEL DO CALCULATION
  4108. LD (YDELTA),HL STORE DELTA Y
  4109. RET
  4110. *
  4111. CALDEL EQU *
  4112. AND A CLEAR CARRY BIT
  4113. SBC HL,DE SUBTRACT BEGIN POINT FROM EN
  4114. RET P RETURN IF RESULT POSITIVE
  4115. *
  4116. LD A,L
  4117. CPL COMPLIMENT
  4118. LD L,A NEGATIVE DELTA
  4119. LD A,H
  4120. CPL
  4121. LD H,A
  4122. INC HL
  4123. LD A,C
  4124. OR B LOAD NEGATIVE DELTA FLAG
  4125. LD C,A
  4126. RET
  4127. EJECT DIVIDE ROUTINE
  4128. * * * * * * * * * * * * * * * * * * * * *
  4129. *
  4130. * DIVIDEND HL REGISTERS
  4131. * DIVISOR DE REGISTERS
  4132. * QUOTIENT BC REGISTERS
  4133. *
  4134. * * * * * * * * * * * * * * * * * * * * *
  4135. SPACE 2
  4136. DIVIDE EQU *
  4137. LD BC,0040H SET SHIFT COUNT TO TEN PLACE
  4138. *
  4139. DIV1 EQU *
  4140. ADD HL,HL SHIFT DIVIDEND LEFT ONE PLAC
  4141. LD (SAVE1),HL AND SAVE
  4142. SBC HL,DE SUBTRACT DIVISOR FROM DIVIDE
  4143. JR NC,DIV2
  4144. *
  4145. LD HL,(SAVE1)
  4146. *
  4147. DIV2 EQU *
  4148. CCF COMPLIMENT CARRY
  4149. RL C SHIFT QUOTIENT
  4150. RL B INTO BC REGISTERS
  4151. JR NC,DIV1 REPEAT IF NOT COMPLETE
  4152. *
  4153. LD L,C
  4154. LD H,B
  4155. ADD HL,HL LEFT
  4156. ADD HL,HL JUSTIFY
  4157. ADD HL,HL FRACTIONAL
  4158. ADD HL,HL QUOTIENT
  4159. ADD HL,HL
  4160. ADD HL,HL
  4161. EX DE,HL
  4162. LD HL,8000H LOAD HALF BIT OFF SET
  4163. RET EXIT TO CALLER
  4164. EJECT INPUT TO USER
  4165. * * * * * * * * * * * * * * * * * * * * *
  4166. *
  4167. * INPUT FROM KEYBOARD, TOUCH PANEL OR EXTERNAL DEVICE
  4168. *
  4169. * DATA WORDS ARE LOADED FROM THE USER FIFO BUFFER AND T
  4170. * TO THE USER IN REGISTERS HL.
  4171. * ONE DATA WORD IS TRANSFERED EACH TIME THIS ROUTINE
  4172. * IS CALLED.
  4173. * IF THE USER BUFFER IS EMPTY, THE MOST SIGNIFICANT BIT
  4174. * OF H REGISTE IS SET.
  4175. *
  4176. * * * * * * * * * * * * * * * * * * * * *
  4177. SPACE 2
  4178. INPUT EQU *
  4179. LD DE,USBUF LOAD ADDRESS OF USER BUFFER
  4180. LD HL,8000H
  4181. LD A,(DE) LOAD BUFFER COUNT
  4182. OR A AND TEST FOR DATA IN BUFFE
  4183. RET Z NO DATA, RETURN TO CALLER
  4184. *
  4185. EX DE,HL
  4186. DEC (HL) DECREMENT COUNT
  4187. INC HL STEP ADDRESS TO
  4188. INC HL OUTPUT INDEX
  4189. LD A,07
  4190. AND (HL) MASK INDEX FOR EIGHT WORD BU
  4191. INC (HL) INCREMENT INDEX
  4192. *
  4193. INC HL ADVANCE ADDRESS TO START OF
  4194. RLCA
  4195. LD E,A LOAD INDEX TO
  4196. LD D,00 DE REGISTER PAIR
  4197. ADD HL,DE ADD INDEX TO START ADDRESS
  4198. LD E,(HL) LOAD LOWER BITS OF WORD
  4199. INC HL
  4200. LD D,(HL) LOAD UPPER BITS OF WORD
  4201. EX DE,HL
  4202. RET EXIT
  4203. EJECT
  4204. * * * * * * * * * * * * * * * * * * * * *
  4205. *
  4206. * SET STEP COORDINATE ROUTINE DIRECTION BITS
  4207. *
  4208. * THIS ROUTINE SETS THE DIRECTION OF THE STEP ROUTINES.
  4209. * THE LOWER TWO BITS OF HL REGISTERS ARE LOADED TO M.DI
  4210. * BIT 0 0 STEP Y FORWARD (UP)
  4211. * 1 STEP Y REVERSE (DOWN)
  4212. * BIT 1 0 STEP X FORWARD (RIGHT)
  4213. * 1 STEP X REVERSE (LEFT)
  4214. *
  4215. * * * * * * * * * * * * * * * * * * * * *
  4216. SPACE 1
  4217. DIR EQU *
  4218. LD (M.DIR),HL STORE DIRECTION BITS
  4219. RET
  4220. EJECT OUTPUT COORDINATES
  4221. * * * * * * * * * * * * * * * * * * * * *
  4222. *
  4223. * SET NEW Y COORDINATE
  4224. *
  4225. * * * * * * * * * * * * * * * * * * * * *
  4226. SPACE 1
  4227. OUTY EQU *
  4228. LD A,01 MASK FOR
  4229. AND H NINE BIT
  4230. LD H,A COORDINATE
  4231. LD (YREG),HL
  4232. CALL COMPHL
  4233. LD DE,(DMAA) LOAD DMA ADDRESS
  4234. RES 0,D
  4235. LD A,H
  4236. OR D LOAD UPPER BIT INTO ADDRESS
  4237. SET 7,A
  4238. LD H,A
  4239. LD (DMAA),HL STORE NEW REFRESH MEMORYY AD
  4240. INC H ADD TWO HUNDRED
  4241. INC H TO ADDRESS
  4242. SET 7,H SET REFRESH MEMORY BIT
  4243. LD (DMA1),HL AND STORE
  4244. INC H ADD FOUR HUNDRED
  4245. INC H TO REFRESH ADDRESS
  4246. SET 7,H SET REFRESH MEMORY BIT
  4247. LD (DMA2),HL AND STORE
  4248. LD A,L
  4249. AND 0F0H
  4250. LD L,A
  4251. LD A,01H
  4252. AND H
  4253. OR L
  4254. LD HL,BP
  4255. JR Z,OUTY1
  4256. RES 7,(HL)
  4257. JR INPY
  4258. OUTY1 SET 7,(HL)
  4259. *
  4260. * INPUT Y COORDINATE
  4261. *
  4262. INPY EQU *
  4263. LD HL,(YREG)
  4264. RET
  4265. EJECT OUTPUT Y COORDINATE
  4266. * * * * * * * * * * * * * * * * * * * * *
  4267. *
  4268. * SET NEW X COORDINATE
  4269. *
  4270. * * * * * * * * * * * * * * * * * * * * *
  4271. SPACE 1
  4272. OUTX EQU *
  4273. LD A,01 MASK FOR
  4274. AND H NINE BIT
  4275. LD H,A COORDINATE
  4276. LD (XREG),HL STORE NINE BIT COORDINATE
  4277. LD A,07H
  4278. AND L
  4279. LD E,A
  4280. LD A,(BP)
  4281. AND 80H
  4282. OR E
  4283. LD (BP),A
  4284. LD DE,(DMAA) LOAD DMA ADDRESS
  4285. LD A,81H LOAD MASK
  4286. AND D MASK SAVE BITS OF ADDRESS
  4287. LD D,A
  4288. LD A,0F8H
  4289. AND L MASK NEW BITS
  4290. SRL A
  4291. SRL A
  4292. OR D INCLUDE Y BITS INTO ADDRESS
  4293. LD D,A
  4294. BIT 0,H TEST UPPER BIT
  4295. JR Z,OUTX1
  4296. SET 6,D SET UPPER BIT
  4297. OUTX1 EQU *
  4298. SET 7,D
  4299. LD (DMAA),DE LOAD NEW DMA ADDRESS
  4300. INC D ADD TWO HUNDRED
  4301. INC D TO REFRESH ADDRESS
  4302. SET 7,D SET REFRESH MEMORY BIT
  4303. LD (DMA1),DE AND STORE
  4304. INC D ADD FOUR HUNDRED
  4305. INC D TO REFRESH ADDRESS
  4306. SET 7,D SET REFRESH MEMORY BIT
  4307. LD (DMA2),DE AND STORE
  4308. SPACE 2
  4309. *
  4310. * INPUT X COORDINATE
  4311. *
  4312. INPX EQU *
  4313. LD HL,(XREG)
  4314. RET
  4315. EJECT COMPLEMENT HL REGISTER PAIR
  4316. *
  4317. COMPHL EQU *
  4318. LD A,L
  4319. CPL
  4320. LD L,A
  4321. LD A,H
  4322. CPL
  4323. AND 01
  4324. LD H,A
  4325. RET
  4326. EJECT STEP X AND Y COORDINATES
  4327. * * * * * * * * * * * * * * * * * * * * *
  4328. *
  4329. *
  4330. * STEP X COORDINATE
  4331. *
  4332. * STEP THE X COORDINATE ONE DOT DEPENDING ON THE SETTIN
  4333. * BIT 1 OF M.DIR.
  4334. *
  4335. * * * * * * * * * * * * * * * * * * * * *
  4336. SPACE 1
  4337. STEPX EQU *
  4338. CALL INPX
  4339. LD A,(M.DIR)
  4340. BIT 1,A TEST FOR DIRECTION OF STEP
  4341. JR NZ,STEPX1 STEP NEGATIVE IF NOT ZERO
  4342. SPACE 1
  4343. INC HL
  4344. JP R.OUTX LOAD X COORDINATE
  4345. *
  4346. STEPX1 EQU *
  4347. DEC HL
  4348. JP R.OUTX LOAD Y COORDINATE
  4349. SPACE 2
  4350. * * * * * * * * * * * * * * * * * * * * *
  4351. *
  4352. *
  4353. * STEP Y COORDINATE
  4354. *
  4355. * STEP THE Y COORDINATE ONE DOT DEPENDING ON THE SETTIN
  4356. * OF BIT 0 OF M.DIR.
  4357. *
  4358. * * * * * * * * * * * * * * * * * * * * *
  4359. SPACE 1
  4360. STEPY EQU *
  4361. CALL INPY
  4362. LD A,(M.DIR) LOAD STEP DIRECTION FLAG
  4363. BIT 0,A TEST DIRECTION OF STEP
  4364. JR NZ,STEPY1 GO NEGATIVE IF NOT ZERO
  4365. SPACE 1
  4366. INC HL
  4367. JP R.OUTY LOAD Y COORDINATE
  4368. SPACE 1
  4369. SPACE 1
  4370. STEPY1 EQU *
  4371. DEC HL
  4372. JP R.OUTY LOAD Y COORDINATE
  4373. EJECT MASK GENERATOR
  4374. EJECT
  4375. *
  4376. * MASK GENERATOR
  4377. *
  4378. * ENTRY
  4379. * B = LOOP COUNT, (LOWER THREE BITS OF Y COOR
  4380. *
  4381. * EXIT
  4382. * D = 11100000
  4383. * E = 00011111
  4384. * H = 11011111
  4385. * L = 00100000
  4386. *
  4387. MASKS EQU *
  4388. LD A,(BP) LOAD LOWER THREE BITS OF Y
  4389. AND 07H
  4390. *
  4391. MASKS0 EQU *
  4392. LD B,A
  4393. OR A TEST BITS FOR ZERO
  4394. LD A,0FFH LOAD A ALL ONES
  4395. LD L,01H
  4396. JR Z,MASKS2 NO SHIFT IF ZERO
  4397. *
  4398. MASKS1 EQU *
  4399. SLA A SHIFT LEFT ZERO FILLING
  4400. SLA L
  4401. DJNZ MASKS1 STAY IN LOOP FOR BP COUNT
  4402. *
  4403. MASKS2 EQU *
  4404. LD D,A LOAD 11110000
  4405. CPL
  4406. LD E,A LOAD 00001111
  4407. LD A,L
  4408. CPL
  4409. LD H,A LOAD 11101111
  4410. RET
  4411. EJECT CHARACTER CONVERT ROUTINE
  4412. SPACE 2
  4413. * CONVERT CHARACTER DATA TO ACCOMMODATE DISPLAY CHANGE
  4414. * ENTRY HL NUMBER CHARACTERS TO CONVERT
  4415. * DE FWA OF CHARACTER DATA
  4416. SPACE 2
  4417. CONVERT EQU *
  4418. LD A,L STORE NUMBER OF CHARS
  4419. LD (NCHARS),A TO CONVERT
  4420. CON0 EQU *
  4421. PUSH DE CHARACTER DATA SOURCE ADDR
  4422. LD C,E ON STACK AND BC
  4423. LD B,D
  4424. LD HL,SAVE1+8 TEMP DEST. ADDR OF ODD ROWS
  4425. EXX BRING IN AUX. REGS.
  4426. POP DE CHARACTER DATA SOURCE ADDR
  4427. INC DE POINTS TO EVEN ROWS
  4428. LD BC,0808H B';BIT COUNT; C';LOOP COUNT
  4429. LD HL,SAVE1 TEMP DESTIN. ADDR OF EVEN ROWS
  4430. CON1 EQU *
  4431. LD A,(DE) ROTATE UPPER BIT OF EVEN ROWS
  4432. RLA TO LOWER BIT OF DESTINATION
  4433. LD (DE),A SAVE ROTATED DATA OF SOURCE
  4434. RR (HL)
  4435. INC DE POINT TO NEXT EVEN ROW OF DATA
  4436. INC DE
  4437. EXX BRING IN MAIN REGS.
  4438. LD A,(DE) ROTATE UPPER BIT OF ODD ROWS
  4439. RLA TO LOWER BIT OF DESTINATION
  4440. LD (DE),A SAVE ROTATED DATA OF SOURCE
  4441. RR (HL)
  4442. INC DE POINT TO NEXT ODD ROW DATA
  4443. INC DE
  4444. EXX BRING IN AUX. REGS.
  4445. DJNZ CON1 DECREMENT BIT COUNT TO 0
  4446. EXX BRING IN MAIN REGS.
  4447. INC HL POINT TO NEXT DEST. WORD
  4448. * FOR ODD ROWS
  4449. LD E,C DE GETS SOURCE FWA AGAIN
  4450. LD D,B
  4451. PUSH DE
  4452. EXX BRING IN AUX. REGS.
  4453. POP DE DE GETS SOURCE FWA+1 FOR
  4454. INC DE EVEN ROWS
  4455. INC HL POINT TO NEXT DEST. WORD
  4456. * FOR EVEN ROWS
  4457. LD B,08 RESET BIT COUNT
  4458. DEC C DECREMENT LOOP COUNT TO 0
  4459. JR NZ,CON1
  4460. EXX BRING IN MAIN REGS.
  4461. LD E,C DE GETS SOURCE FWA
  4462. LD D,B
  4463. LD HL,SAVE1 HL GETS TEMPORARY FWA
  4464. LD BC,0010H BC GETS 16 BYTE COUNT
  4465. LDIR CONVERTED DATA TO SOURCE
  4466. LD A,(NCHARS) MORE DATA TO CONVERT'/
  4467. DEC A
  4468. LD (NCHARS),A RESTORE NUMBER OF CHARACTERS
  4469. JR NZ,CON0 NO, DO NEXT CHARACTER
  4470. RET RETURN TO CALLER
  4471. SPACE 4
  4472. **********
  4473. * BULK ERASE THE SCREEN
  4474. **********
  4475. BULKER EQU *
  4476. LD A,06H DO BULK ERASE
  4477. OUT (BLKERS),A
  4478. BULKER1 IN A,(SYSSTAT) GET SYSTEM STATUS
  4479. RLCA
  4480. JR C,BULKER1 WAIT UNTIL BULK ERASE DONE
  4481. RET
  4482. EJECT
  4483. **********
  4484. * JUMP TABLE FOR PLATO MODE ESCAPE SEQUENCES
  4485. **********
  4486. ESCADR.P EQU *
  4487. DEFB 03H ETX
  4488. DEFW AINIT
  4489. DEFB 11H DC1
  4490. DEFW DC1
  4491. DEFB 12H DC2
  4492. DEFW DC2
  4493. DEFB 13H DC3
  4494. DEFW DC3
  4495. DEFB 14H DC4
  4496. DEFW DC4
  4497. DEFB 0CH FF
  4498. DEFW BULKER
  4499. DEFB 40H AMPERSAND
  4500. DEFW SUPER
  4501. DEFB 32H 2
  4502. DEFW LCOORD
  4503. DEFB 41H UC A
  4504. DEFW SUB
  4505. DEFB 42H UC B
  4506. DEFW SELECTMM
  4507. DEFB 43H UC C
  4508. DEFW SELECTMM
  4509. DEFB 44H UC D
  4510. DEFW SELECTMM
  4511. DEFB 45H UC E
  4512. DEFW SELECTMM
  4513. DEFB 46H UC F
  4514. DEFW SELECTMM
  4515. DEFB 47H UC G
  4516. DEFW SELECTMM
  4517. DEFB 48H UC H
  4518. DEFW SELECTMM
  4519. DEFB 49H UC I
  4520. DEFW SELECTMM
  4521. DEFB 4AH UC J
  4522. DEFW HOR
  4523. DEFB 4BH UC K
  4524. DEFW VERT
  4525. DEFB 4CH UC L
  4526. DEFW FWD
  4527. DEFB 4DH UC M
  4528. DEFW REV
  4529. DEFB 4EH UC N
  4530. DEFW SIZE0
  4531. DEFB 4FH UC O
  4532. DEFW SIZE2
  4533. DEFB 50H UC P
  4534. DEFW SLDM2C
  4535. DEFB 51H UC Q
  4536. DEFW SSPECF
  4537. DEFB 52H UC R
  4538. DEFW LEXT
  4539. DEFB 53H UC S
  4540. DEFW SLDM2
  4541. DEFB 54H UC T
  4542. DEFW MODE567 (MODE 5)
  4543. DEFB 55H UC U
  4544. DEFW MODE567 (MODE 6)
  4545. DEFB 56H UC V
  4546. DEFW MODE567 (MODE 7)
  4547. DEFB 57H UC W
  4548. DEFW LADDR
  4549. DEFB 59H UC Y
  4550. DEFW LECHO
  4551. DEFB 5AH UC Z
  4552. DEFW LMARG
  4553. DEFB 1BH ESC
  4554. DEFW ESC
  4555. DEFB 0FFH END OF TABLE
  4556.  
  4557. **********
  4558. * JUMP TABLE FOR PLATO MODE CONTROL CODES
  4559. **********
  4560. CTLADR.P EQU *
  4561. DEFB 08H BS
  4562. DEFW BKSP
  4563. DEFB 0DH CR
  4564. DEFW CR
  4565. DEFB 09H HT
  4566. DEFW TAB
  4567. DEFB 0AH LF
  4568. DEFW LF
  4569. DEFB 0BH VT
  4570. DEFW VT
  4571. DEFB 0CH FF
  4572. DEFW FF
  4573. DEFB 19H EM
  4574. DEFW EM.1
  4575. DEFB 1BH ESC
  4576. DEFW ESC
  4577. DEFB 1CH FS
  4578. DEFW FS.1
  4579. DEFB 1DH GS
  4580. DEFW GS.1
  4581. DEFB 1FH US
  4582. DEFW US.1
  4583. DEFB 0FFH END OF TABLE
  4584. EJECT
  4585. ****************************************
  4586. * M0 CHARACTER SET *
  4587. ****************************************
  4588. M0CODE00 EQU * SPACE
  4589. HEX 00,00,00,00
  4590. HEX 00,00,00,00
  4591. HEX 00,00,00,00
  4592. HEX 00,00,00,00
  4593. M0CODE01 EQU * EXCLAMATION MARK
  4594. HEX 00,00,00,08
  4595. HEX 08,08,08,08
  4596. HEX 08,00,00,08
  4597. HEX 00,00,00,00
  4598. M0CODE02 EQU * DOUBLE QUOTATION MARK
  4599. HEX 00,00,00,14
  4600. HEX 14,14,00,00
  4601. HEX 00,00,00,00
  4602. HEX 00,00,00,00
  4603. M0CODE03 EQU * NUMBER SIGN
  4604. HEX 00,00,00,14
  4605. HEX 14,7F,14,7F
  4606. HEX 14,14,00,00
  4607. HEX 00,00,00,00
  4608. M0CODE04 EQU * DOLLAR SIGN
  4609. HEX 00,00,00,08
  4610. HEX 3E,49,09,3E
  4611. HEX 48,49,3E,08
  4612. HEX 00,00,00,00
  4613. M0CODE05 EQU * PERCENT SIGN
  4614. HEX 00,00,00,02
  4615. HEX 45,25,12,08
  4616. HEX 24,52,51,20
  4617. HEX 00,00,00,00
  4618. M0CODE06 EQU * AMPERSAND
  4619. HEX 00,00,00,04
  4620. HEX 0A,0A,04,46
  4621. HEX 49,31,31,4E
  4622. HEX 00,00,00,00
  4623. M0CODE07 EQU * SINGLE QUOTE(STRAIGHT)
  4624. HEX 00,08,08,08
  4625. HEX 00,00,00,00
  4626. HEX 00,00,00,00
  4627. HEX 00,00,00,00
  4628. M0CODE08 EQU * LEFT PARENTHESIS
  4629. HEX 00,00,00,40
  4630. HEX 20,10,10,10
  4631. HEX 10,10,10,20
  4632. HEX 40,00,00,00
  4633. M0CODE09 EQU * RIGHT PARENTHESIS
  4634. HEX 00,00,00,01
  4635. HEX 02,04,04,04
  4636. HEX 04,04,04,02
  4637. HEX 01,00,00,00
  4638. M0CODE0A EQU * ASTERISK
  4639. HEX 00,00,00,00
  4640. HEX 00,08,2A,14
  4641. HEX 14,2A,08,00
  4642. HEX 00,00,00,00
  4643. M0CODE0B EQU * PLUS SIGN
  4644. HEX 00,00,00,00
  4645. HEX 00,00,08,08
  4646. HEX 3E,08,08,00
  4647. HEX 00,00,00,00
  4648. M0CODE0C EQU * COMMA
  4649. HEX 00,00,00,00
  4650. HEX 00,00,00,00
  4651. HEX 00,00,0C,0C
  4652. HEX 08,04,00,00
  4653. M0CODE0D EQU * MINUS SIGN
  4654. HEX 00,00,00,00
  4655. HEX 00,00,00,00
  4656. HEX 3E,00,00,00
  4657. HEX 00,00,00,00
  4658. M0CODE0E EQU * PERIOD
  4659. HEX 00,00,00,00
  4660. HEX 00,00,00,00
  4661. HEX 00,00,0C,0C
  4662. HEX 00,00,00,00
  4663. M0CODE0F EQU * SLASH
  4664. HEX 00,00,00,00
  4665. HEX 00,40,20,10
  4666. HEX 08,04,02,01
  4667. HEX 00,00,00,00
  4668. M0CODE10 EQU * ZERO
  4669. HEX 00,00,00,00
  4670. HEX 5C,22,32,2A
  4671. HEX 2A,26,22,1D
  4672. HEX 00,00,00,00
  4673. M0CODE11 EQU * ONE
  4674. HEX 00,00,00,00
  4675. HEX 08,0C,08,08
  4676. HEX 08,08,08,1C
  4677. HEX 00,00,00,00
  4678. M0CODE12 EQU * TWO
  4679. HEX 00,00,00,00
  4680. HEX 1C,22,20,10
  4681. HEX 08,04,02,3E
  4682. HEX 00,00,00,00
  4683. M0CODE13 EQU * THREE
  4684. HEX 00,00,00,00
  4685. HEX 1C,22,20,18
  4686. HEX 20,20,22,1C
  4687. HEX 00,00,00,00
  4688. M0CODE14 EQU * FOUR
  4689. HEX 00,00,00,00
  4690. HEX 20,30,28,24
  4691. HEX 7E,20,20,20
  4692. HEX 00,00,00,00
  4693. M0CODE15 EQU * FIVE
  4694. HEX 00,00,00,00
  4695. HEX 3E,02,02,1E
  4696. HEX 20,20,10,0E
  4697. HEX 00,00,00,00
  4698. M0CODE16 EQU * SIX
  4699. HEX 00,00,00,00
  4700. HEX 18,04,02,1E
  4701. HEX 22,22,22,1C
  4702. HEX 00,00,00,00
  4703. M0CODE17 EQU * SEVEN
  4704. HEX 00,00,00,00
  4705. HEX 3E,20,10,10
  4706. HEX 08,08,04,04
  4707. HEX 00,00,00,00
  4708. M0CODE18 EQU * EIGHT
  4709. HEX 00,00,00,00
  4710. HEX 1C,22,22,1C
  4711. HEX 22,22,22,1C
  4712. HEX 00,00,00,00
  4713. M0CODE19 EQU * NINE
  4714. HEX 00,00,00,00
  4715. HEX 1C,22,22,22
  4716. HEX 3C,20,10,0C
  4717. HEX 00,00,00,00
  4718. M0CODE1A EQU * COLON
  4719. HEX 00,00,00,00
  4720. HEX 00,00,0C,0C
  4721. HEX 00,00,0C,0C
  4722. HEX 00,00,00,00
  4723. M0CODE1B EQU * SEMICOLON
  4724. HEX 00,00,00,00
  4725. HEX 00,00,0C,0C
  4726. HEX 00,00,0C,0C
  4727. HEX 08,04,00,00
  4728. M0CODE1C EQU * LESS THAN SIGN
  4729. HEX 00,00,00,00
  4730. HEX 00,10,08,04
  4731. HEX 02,04,08,10
  4732. HEX 00,00,00,00
  4733. M0CODE1D EQU * EQUAL SIGN
  4734. HEX 00,00,00,00
  4735. HEX 00,00,00,3E
  4736. HEX 00,3E,00,00
  4737. HEX 00,00,00,00
  4738. M0CODE1E EQU * GREATER THAN SIGN
  4739. HEX 00,00,00,00
  4740. HEX 00,04,08,10
  4741. HEX 20,10,08,04
  4742. HEX 00,00,00,00
  4743. M0CODE1F EQU * QUESTION MARK
  4744. HEX 00,00,00,1C
  4745. HEX 22,22,20,10
  4746. HEX 08,08,00,08
  4747. HEX 00,00,00,00
  4748. M0CODE20 EQU * COMMERCIAL AT SIGN
  4749. HEX 00,00,00,00
  4750. HEX 00,1C,22,59
  4751. HEX 55,55,39,02
  4752. HEX 1C,00,00,00
  4753. M0CODE21 EQU * UPPER CASE A
  4754. HEX 00,00,00,1C
  4755. HEX 22,41,41,7F
  4756. HEX 41,41,41,41
  4757. HEX 00,00,00,00
  4758. M0CODE22 EQU * UPPER CASE B
  4759. HEX 00,00,00,1F
  4760. HEX 21,21,3F,41
  4761. HEX 41,41,41,3F
  4762. HEX 00,00,00,00
  4763. M0CODE23 EQU * UPPER CASE C
  4764. HEX 00,00,00,3C
  4765. HEX 42,01,01,01
  4766. HEX 01,01,42,3C
  4767. HEX 00,00,00,00
  4768. M0CODE24 EQU * UPPER CASE D
  4769. HEX 00,00,00,1F
  4770. HEX 21,41,41,41
  4771. HEX 41,41,21,1F
  4772. HEX 00,00,00,00
  4773. M0CODE25 EQU * UPPER CASE E
  4774. HEX 00,00,00,7F
  4775. HEX 01,01,01,1F
  4776. HEX 01,01,01,7F
  4777. HEX 00,00,00,00
  4778. M0CODE26 EQU * UPPER CASE F
  4779. HEX 00,00,00,7F
  4780. HEX 01,01,01,0F
  4781. HEX 01,01,01,01
  4782. HEX 00,00,00,00
  4783. M0CODE27 EQU * UPPER CASE G
  4784. HEX 00,00,00,3C
  4785. HEX 42,01,01,01
  4786. HEX 71,41,42,3C
  4787. HEX 00,00,00,00
  4788. M0CODE28 EQU * UPPER CASE H
  4789. HEX 00,00,00,41
  4790. HEX 41,41,41,7F
  4791. HEX 41,41,41,41
  4792. HEX 00,00,00,00
  4793. M0CODE29 EQU * UPPER CASE I
  4794. HEX 00,00,00,3E
  4795. HEX 08,08,08,08
  4796. HEX 08,08,08,3E
  4797. HEX 00,00,00,00
  4798. M0CODE2A EQU * UPPER CASE J
  4799. HEX 00,00,00,7C
  4800. HEX 10,10,10,10
  4801. HEX 10,10,11,0E
  4802. HEX 00,00,00,00
  4803. M0CODE2B EQU * UPPER CASE K
  4804. HEX 00,00,00,41
  4805. HEX 21,11,09,05
  4806. HEX 0B,11,21,41
  4807. HEX 00,00,00,00
  4808. M0CODE2C EQU * UPPER CASE L
  4809. HEX 00,00,00,01
  4810. HEX 01,01,01,01
  4811. HEX 01,01,01,7F
  4812. HEX 00,00,00,00
  4813. M0CODE2D EQU * UPPER CASE M
  4814. HEX 00,00,00,41
  4815. HEX 63,55,49,41
  4816. HEX 41,41,41,41
  4817. HEX 00,00,00,00
  4818. M0CODE2E EQU * UPPER CASE N
  4819. HEX 00,00,00,41
  4820. HEX 43,45,45,49
  4821. HEX 51,51,61,41
  4822. HEX 00,00,00,00
  4823. M0CODE2F EQU * UPPER CASE O
  4824. HEX 00,00,00,1C
  4825. HEX 22,41,41,41
  4826. HEX 41,41,22,1C
  4827. HEX 00,00,00,00
  4828. M0CODE30 EQU * UPPER CASE P
  4829. HEX 00,00,00,3F
  4830. HEX 41,41,41,3F
  4831. HEX 01,01,01,01
  4832. HEX 00,00,00,00
  4833. M0CODE31 EQU * UPPER CASE Q
  4834. HEX 00,00,00,1C
  4835. HEX 22,41,41,41
  4836. HEX 41,41,22,1C
  4837. HEX 08,30,00,00
  4838. M0CODE32 EQU * UPPER CASE R
  4839. HEX 00,00,00,3F
  4840. HEX 41,41,41,3F
  4841. HEX 09,11,21,41
  4842. HEX 00,00,00,00
  4843. M0CODE33 EQU * UPPER CASE S
  4844. HEX 00,00,00,3E
  4845. HEX 41,01,01,3E
  4846. HEX 40,40,41,3E
  4847. HEX 00,00,00,00
  4848. M0CODE34 EQU * UPPER CASE T
  4849. HEX 00,00,00,7F
  4850. HEX 08,08,08,08
  4851. HEX 08,08,08,08
  4852. HEX 00,00,00,00
  4853. M0CODE35 EQU * UPPER CASE U
  4854. HEX 00,00,00,41
  4855. HEX 41,41,41,41
  4856. HEX 41,41,41,3E
  4857. HEX 00,00,00,00
  4858. M0CODE36 EQU * UPPER CASE V
  4859. HEX 00,00,00,41
  4860. HEX 41,22,22,22
  4861. HEX 14,14,08,08
  4862. HEX 00,00,00,00
  4863. M0CODE37 EQU * UPPER CASE W
  4864. HEX 00,00,00,41
  4865. HEX 41,41,49,49
  4866. HEX 49,49,55,22
  4867. HEX 00,00,00,00
  4868. M0CODE38 EQU * UPPER CASE X
  4869. HEX 00,00,00,41
  4870. HEX 41,22,14,08
  4871. HEX 14,22,41,41
  4872. HEX 00,00,00,00
  4873. M0CODE39 EQU * UPPER CASE Y
  4874. HEX 00,00,00,41
  4875. HEX 41,22,14,08
  4876. HEX 08,08,08,08
  4877. HEX 00,00,00,00
  4878. M0CODE3A EQU * UPPER CASE Z
  4879. HEX 00,00,00,7F
  4880. HEX 41,20,10,08
  4881. HEX 04,02,41,7F
  4882. HEX 00,00,00,00
  4883. M0CODE3B EQU * LEFT BRACKET
  4884. HEX 00,00,00,70
  4885. HEX 10,10,10,10
  4886. HEX 10,10,10,10
  4887. HEX 70,00,00,00
  4888. M0CODE3C EQU * REVERSE SLASH
  4889. HEX 00,00,00,00
  4890. HEX 00,01,02,04
  4891. HEX 08,10,20,40
  4892. HEX 00,00,00,00
  4893. M0CODE3D EQU * RIGHT BRACKET
  4894. HEX 00,00,00,07
  4895. HEX 04,04,04,04
  4896. HEX 04,04,04,04
  4897. HEX 07,00,00,00
  4898. M0CODE3E EQU * HAT
  4899. HEX 00,08,14,22
  4900. HEX 00,00,00,00
  4901. HEX 00,00,00,00
  4902. HEX 00,00,00,00
  4903. M0CODE3F EQU * UNDERLINE
  4904. HEX 00,00,00,00
  4905. HEX 00,00,00,00
  4906. HEX 00,00,00,00
  4907. HEX 00,7F,00,00
  4908. M0CODE40 EQU * SMALL REVERSE SLASH
  4909. HEX 00,02,04,08
  4910. HEX 00,00,00,00
  4911. HEX 00,00,00,00
  4912. HEX 00,00,00,00
  4913. M0CODE41 EQU * LOWER CASE A
  4914. HEX 00,00,00,00
  4915. HEX 00,00,1E,20
  4916. HEX 3E,21,21,5E
  4917. HEX 00,00,00,00
  4918. M0CODE42 EQU * LOWER CASE B
  4919. HEX 00,00,00,01
  4920. HEX 01,01,1D,23
  4921. HEX 41,41,23,1D
  4922. HEX 00,00,00,00
  4923. M0CODE43 EQU * LOWER CASE C
  4924. HEX 00,00,00,00
  4925. HEX 00,00,3C,42
  4926. HEX 01,01,42,3C
  4927. HEX 00,00,00,00
  4928. M0CODE44 EQU * LOWER CASE D
  4929. HEX 00,00,00,40
  4930. HEX 40,40,5C,62
  4931. HEX 41,41,62,5C
  4932. HEX 00,00,00,00
  4933. M0CODE45 EQU * LOWER CASE E
  4934. HEX 00,00,00,00
  4935. HEX 00,00,3C,42
  4936. HEX 7F,01,02,7C
  4937. HEX 00,00,00,00
  4938. M0CODE46 EQU * LOWER CASE F
  4939. HEX 00,00,00,30
  4940. HEX 48,08,1C,08
  4941. HEX 08,08,08,1C
  4942. HEX 00,00,00,00
  4943. M0CODE47 EQU * LOWER CASE G
  4944. HEX 00,00,00,00
  4945. HEX 00,00,5E,21
  4946. HEX 21,1E,01,3E
  4947. HEX 41,3E,00,00
  4948. M0CODE48 EQU * LOWER CASE H
  4949. HEX 00,00,00,03
  4950. HEX 02,02,3A,46
  4951. HEX 42,42,42,42
  4952. HEX 00,00,00,00
  4953. M0CODE49 EQU * LOWER CASE I
  4954. HEX 00,00,00,08
  4955. HEX 00,00,0C,08
  4956. HEX 08,08,08,1C
  4957. HEX 00,00,00,00
  4958. M0CODE4A EQU * LOWER CASE J
  4959. HEX 00,00,00,08
  4960. HEX 00,00,0C,08
  4961. HEX 08,08,08,08
  4962. HEX 08,08,06,00
  4963. M0CODE4B EQU * LOWER CASE K
  4964. HEX 00,00,00,03
  4965. HEX 02,02,32,0A
  4966. HEX 06,0A,12,63
  4967. HEX 00,00,00,00
  4968. M0CODE4C EQU * LOWER CASE L
  4969. HEX 00,00,00,0C
  4970. HEX 08,08,08,08
  4971. HEX 08,08,08,1C
  4972. HEX 00,00,00,00
  4973. M0CODE4D EQU * LOWER CASE M
  4974. HEX 00,00,00,00
  4975. HEX 00,00,37,49
  4976. HEX 49,49,49,49
  4977. HEX 00,00,00,00
  4978. M0CODE4E EQU * LOWER CASE N
  4979. HEX 00,00,00,00
  4980. HEX 00,00,3B,46
  4981. HEX 42,42,42,42
  4982. HEX 00,00,00,00
  4983. M0CODE4F EQU * LOWER CASE O
  4984. HEX 00,00,00,00
  4985. HEX 00,00,1C,22
  4986. HEX 41,41,22,1C
  4987. HEX 00,00,00,00
  4988. M0CODE50 EQU * LOWER CASE P
  4989. HEX 00,00,00,00
  4990. HEX 00,00,1D,23
  4991. HEX 41,41,23,1D
  4992. HEX 01,01,01,00
  4993. M0CODE51 EQU * LOWER CASE Q
  4994. HEX 00,00,00,00
  4995. HEX 00,00,5C,62
  4996. HEX 41,41,62,5C
  4997. HEX 40,40,40,00
  4998. M0CODE52 EQU * LOWER CASE R
  4999. HEX 00,00,00,00
  5000. HEX 00,00,3B,46
  5001. HEX 02,02,02,02
  5002. HEX 00,00,00,00
  5003. M0CODE53 EQU * LOWER CASE S
  5004. HEX 00,00,00,00
  5005. HEX 00,00,3E,01
  5006. HEX 3E,40,41,3E
  5007. HEX 00,00,00,00
  5008. M0CODE54 EQU * LOWER CASE T
  5009. HEX 00,00,00,04
  5010. HEX 04,04,3F,04
  5011. HEX 04,04,04,38
  5012. HEX 00,00,00,00
  5013. M0CODE55 EQU * LOWER CASE U
  5014. HEX 00,00,00,00
  5015. HEX 00,00,21,21
  5016. HEX 21,21,21,5E
  5017. HEX 00,00,00,00
  5018. M0CODE56 EQU * LOWER CASE V
  5019. HEX 00,00,00,00
  5020. HEX 00,00,63,22
  5021. HEX 14,14,08,08
  5022. HEX 00,00,00,00
  5023. M0CODE57 EQU * LOWER CASE W
  5024. HEX 00,00,00,00
  5025. HEX 00,00,41,49
  5026. HEX 49,49,55,22
  5027. HEX 00,00,00,00
  5028. M0CODE58 EQU * LOWER CASE X
  5029. HEX 00,00,00,00
  5030. HEX 00,00,43,24
  5031. HEX 18,18,24,42
  5032. HEX 00,00,00,00
  5033. M0CODE59 EQU * LOWER CASE Y
  5034. HEX 00,00,00,00
  5035. HEX 00,00,41,41
  5036. HEX 41,22,14,08
  5037. HEX 04,02,01,00
  5038. M0CODE5A EQU * LOWER CASE Z
  5039. HEX 00,00,00,00
  5040. HEX 00,00,3F,11
  5041. HEX 08,04,22,3F
  5042. HEX 00,00,00,00
  5043. M0CODE5B EQU * LEFT BRACE
  5044. HEX 00,00,00,60
  5045. HEX 10,10,10,10
  5046. HEX 08,10,10,10
  5047. HEX 10,60,00,00
  5048. M0CODE5C EQU * DOUBLE VERTICAL BAR
  5049. HEX 00,00,0E,0E
  5050. HEX 0E,0E,00,0E
  5051. HEX 0E,0E,0E,00
  5052. HEX 00,00,00,00
  5053. M0CODE5D EQU * RIGHT BRACE
  5054. HEX 00,00,00,03
  5055. HEX 04,04,04,04
  5056. HEX 08,04,04,04
  5057. HEX 04,03,00,00
  5058. M0CODE5E EQU * APPROXIMATION SIGN
  5059. HEX 00,00,00,00
  5060. HEX 00,00,00,4C
  5061. HEX 32,00,00,00
  5062. HEX 00,00,00,00
  5063. M0CODE5F EQU * RUBOUT
  5064. HEX 00,00,00,3E
  5065. HEX 3E,3E,3E,3E
  5066. HEX 3E,3E,00,00
  5067. HEX 00,00,00,00
  5068. M0CODE60 EQU * UNDERLINE CURSOR
  5069. HEX 00,00,00,00
  5070. HEX 00,00,00,00
  5071. HEX 00,00,00,00
  5072. HEX 00,00,00,FF
  5073. M0CODE61 EQU * CROSSHAIR CURSOR
  5074. HEX 00,00,00,00
  5075. HEX 00,00,00,00
  5076. HEX 00,00,00,04
  5077. HEX 04,1F,04,04
  5078. M1CODE00 EQU * SPACE
  5079. HEX 00,00,00,00
  5080. HEX 00,00,00,00
  5081. HEX 00,00,00,00
  5082. HEX 00,00,00,00
  5083. M1CODE01 EQU * SHORTER SLASH
  5084. HEX 00,00,00,00
  5085. HEX 00,40,20,10
  5086. HEX 08,04,02,01
  5087. HEX 00,00,00,00
  5088. M1CODE02 EQU * EQUIVALENCE SIGN
  5089. HEX 00,00,00,00
  5090. HEX 00,00,3E,00
  5091. HEX 3E,00,3E,00
  5092. HEX 00,00,00,00
  5093. M1CODE03 EQU * TILDE
  5094. HEX 00,00,4C,32
  5095. HEX 00,00,00,00
  5096. HEX 00,00,00,00
  5097. HEX 00,00,00,00
  5098. M1CODE04 EQU * LEFT DOUBLE ARROW
  5099. HEX 00,00,00,00
  5100. HEX 00,08,0C,7A
  5101. HEX 01,7A,0C,08
  5102. HEX 00,00,00,00
  5103. M1CODE05 EQU * NOT EQUAL SIGN
  5104. HEX 00,00,00,00
  5105. HEX 00,40,20,7F
  5106. HEX 08,7F,02,01
  5107. HEX 00,00,00,00
  5108. M1CODE06 EQU * UP ARROW
  5109. HEX 00,00,00,00
  5110. HEX 00,08,1C,3E
  5111. HEX 08,08,08,08
  5112. HEX 00,00,00,00
  5113. M1CODE07 EQU * RIGHT ARROW
  5114. HEX 00,00,00,00
  5115. HEX 00,00,10,30
  5116. HEX 7F,30,10,00
  5117. HEX 00,00,00,00
  5118. M1CODE08 EQU * DOWN ARROW
  5119. HEX 00,00,00,00
  5120. HEX 00,08,08,08
  5121. HEX 08,3E,1C,08
  5122. HEX 00,00,00,00
  5123. M1CODE09 EQU * LEFT ARROW
  5124. HEX 00,00,00,00
  5125. HEX 00,00,04,06
  5126. HEX 7F,06,04,00
  5127. HEX 00,00,00,00
  5128. M1CODE0A EQU * MULTIPLY SIGN
  5129. HEX 00,00,00,00
  5130. HEX 00,00,24,18
  5131. HEX 18,24,00,00
  5132. HEX 00,00,00,00
  5133. M1CODE0B EQU * UPPER CASE SIGMA
  5134. HEX 00,00,00,7F
  5135. HEX 02,04,08,10
  5136. HEX 08,04,02,7F
  5137. HEX 00,00,00,00
  5138. M1CODE0C EQU * UPPER CASE DELTA
  5139. HEX 00,00,00,00
  5140. HEX 08,08,14,14
  5141. HEX 22,22,41,7F
  5142. HEX 00,00,00,00
  5143. M1CODE0D EQU * LOGICAL UNION
  5144. HEX 00,00,00,00
  5145. HEX 00,00,22,22
  5146. HEX 22,1C,00,00
  5147. HEX 00,00,00,00
  5148. M1CODE0E EQU * LOGICAL INTERSECTION
  5149. HEX 00,00,00,00
  5150. HEX 00,00,1C,22
  5151. HEX 22,22,00,00
  5152. HEX 00,00,00,00
  5153. M1CODE0F EQU * DIVIDE SIGN
  5154. HEX 00,00,00,00
  5155. HEX 00,00,08,00
  5156. HEX 3E,00,08,00
  5157. HEX 00,00,00,00
  5158. M1CODE10 EQU * LOWER CASE ALPHA
  5159. HEX 00,00,00,00
  5160. HEX 00,00,46,49
  5161. HEX 29,11,19,66
  5162. HEX 00,00,00,00
  5163. M1CODE11 EQU * LOWER CASE BETA
  5164. HEX 00,00,00,00
  5165. HEX 18,24,22,1E
  5166. HEX 22,42,42,3E
  5167. HEX 02,02,01,00
  5168. M1CODE12 EQU * LOWER CASE DELTA
  5169. HEX 00,00,00,0C
  5170. HEX 12,22,04,0C
  5171. HEX 12,22,22,1C
  5172. HEX 00,00,00,00
  5173. M1CODE13 EQU * LOWER CASE LAMBDA
  5174. HEX 00,00,00,02
  5175. HEX 04,04,08,08
  5176. HEX 14,14,22,22
  5177. HEX 00,00,00,00
  5178. M1CODE14 EQU * LOWER CASE MU
  5179. HEX 00,00,00,00
  5180. HEX 00,00,24,24
  5181. HEX 24,24,24,5C
  5182. HEX 04,04,03,00
  5183. M1CODE15 EQU * LOWER CASE PI
  5184. HEX 00,00,00,00
  5185. HEX 00,40,3E,15
  5186. HEX 14,14,14,14
  5187. HEX 00,00,00,00
  5188. M1CODE16 EQU * LOWER CASE RHO
  5189. HEX 00,00,00,00
  5190. HEX 00,00,30,48
  5191. HEX 44,44,26,1A
  5192. HEX 02,01,01,00
  5193. M1CODE17 EQU * LOWER CASE SIGMA
  5194. HEX 00,00,00,00
  5195. HEX 00,00,7C,0A
  5196. HEX 11,11,11,0E
  5197. HEX 00,00,00,00
  5198. M1CODE18 EQU * LOWER CASE OMEGA
  5199. HEX 00,00,00,00
  5200. HEX 00,00,22,41
  5201. HEX 49,49,49,36
  5202. HEX 00,00,00,00
  5203. M1CODE19 EQU * LESS THAN OR EQUAL TO
  5204. HEX 00,00,00,00
  5205. HEX 30,0C,03,0C
  5206. HEX 30,00,3F,00
  5207. HEX 00,00,00,00
  5208. M1CODE1A EQU * GREATER THAN OR EQUAL TO
  5209. HEX 00,00,00,00
  5210. HEX 06,18,60,18
  5211. HEX 06,00,7E,00
  5212. HEX 00,00,00,00
  5213. M1CODE1B EQU * THETA
  5214. HEX 00,00,00,1C
  5215. HEX 22,41,41,7F
  5216. HEX 41,41,22,1C
  5217. HEX 00,00,00,00
  5218. M1CODE1C EQU * SINGLE QUOTE(STRAIGHT)
  5219. HEX 00,00,00,08
  5220. HEX 08,08,00,00
  5221. HEX 00,00,00,00
  5222. HEX 00,00,00,00
  5223. M1CODE1D EQU * DEGREE SIGN
  5224. HEX 00,00,00,0C
  5225. HEX 12,12,0C,00
  5226. HEX 00,00,00,00
  5227. HEX 00,00,00,00
  5228. M1CODE1E EQU * VERTICAL BAR
  5229. HEX 00,00,00,08
  5230. HEX 08,08,08,08
  5231. HEX 08,08,08,08
  5232. HEX 00,00,00,00
  5233. M1CODE1F EQU * RIGHT ARROW HEAD
  5234. HEX 00,00,00,03
  5235. HEX 05,09,12,24
  5236. HEX 48,24,12,09
  5237. HEX 05,03,00,00
  5238. M1CODE20 EQU * CENTER OF COPYRIGHT
  5239. HEX 00,00,7F,00
  5240. HEX 00,3C,42,01
  5241. HEX 01,42,3C,00
  5242. HEX 00,7F,00,00
  5243. M1CODE21 EQU * UMLAUT
  5244. HEX 00,00,00,14
  5245. HEX 00,00,00,00
  5246. HEX 00,00,00,00
  5247. HEX 00,00,00,00
  5248. M1CODE22 EQU * SQUARE
  5249. HEX 00,00,00,00
  5250. HEX 00,00,3E,22
  5251. HEX 22,3E,00,00
  5252. HEX 00,00,00,00
  5253. M1CODE23 EQU * PAD
  5254. HEX FF,FF,FF,FF
  5255. HEX FF,FF,FF,FF
  5256. HEX FF,FF,FF,FF
  5257. HEX FF,FF,FF,FF
  5258. M1CODE24 EQU * DIAMOND
  5259. HEX 00,00,00,00
  5260. HEX 00,08,1C,3E
  5261. HEX 7F,3E,1C,08
  5262. HEX 00,00,00,00
  5263. M1CODE25 EQU * PAD
  5264. HEX FF,FF,FF,FF
  5265. HEX FF,FF,FF,FF
  5266. HEX FF,FF,FF,FF
  5267. HEX FF,FF,FF,FF
  5268. M1CODE26 EQU * PAD
  5269. HEX FF,FF,FF,FF
  5270. HEX FF,FF,FF,FF
  5271. HEX FF,FF,FF,FF
  5272. HEX FF,FF,FF,FF
  5273. M1CODE27 EQU * PAD
  5274. HEX FF,FF,FF,FF
  5275. HEX FF,FF,FF,FF
  5276. HEX FF,FF,FF,FF
  5277. HEX FF,FF,FF,FF
  5278. M1CODE28 EQU * PAD
  5279. HEX FF,FF,FF,FF
  5280. HEX FF,FF,FF,FF
  5281. HEX FF,FF,FF,FF
  5282. HEX FF,FF,FF,FF
  5283. M1CODE29 EQU * PAD
  5284. HEX FF,FF,FF,FF
  5285. HEX FF,FF,FF,FF
  5286. HEX FF,FF,FF,FF
  5287. HEX FF,FF,FF,FF
  5288. M1CODE2A EQU * PAD
  5289. HEX FF,FF,FF,FF
  5290. HEX FF,FF,FF,FF
  5291. HEX FF,FF,FF,FF
  5292. HEX FF,FF,FF,FF
  5293. M1CODE2B EQU * PAD
  5294. HEX FF,FF,FF,FF
  5295. HEX FF,FF,FF,FF
  5296. HEX FF,FF,FF,FF
  5297. HEX FF,FF,FF,FF
  5298. M1CODE2C EQU * PAD
  5299. HEX FF,FF,FF,FF
  5300. HEX FF,FF,FF,FF
  5301. HEX FF,FF,FF,FF
  5302. HEX FF,FF,FF,FF
  5303. M1CODE2D EQU * MATRIX MULTIPLY
  5304. HEX 00,00,00,00
  5305. HEX 00,00,0C,12
  5306. HEX 12,0C,00,00
  5307. HEX 00,00,00,00
  5308. M1CODE2E EQU * PAD
  5309. HEX FF,FF,FF,FF
  5310. HEX FF,FF,FF,FF
  5311. HEX FF,FF,FF,FF
  5312. HEX FF,FF,FF,FF
  5313. M1CODE2F EQU * PAD
  5314. HEX FF,FF,FF,FF
  5315. HEX FF,FF,FF,FF
  5316. HEX FF,FF,FF,FF
  5317. HEX FF,FF,FF,FF
  5318. M1CODE30 EQU * PAD
  5319. HEX FF,FF,FF,FF
  5320. HEX FF,FF,FF,FF
  5321. HEX FF,FF,FF,FF
  5322. HEX FF,FF,FF,FF
  5323. M1CODE31 EQU * PAD
  5324. HEX FF,FF,FF,FF
  5325. HEX FF,FF,FF,FF
  5326. HEX FF,FF,FF,FF
  5327. HEX FF,FF,FF,FF
  5328. M1CODE32 EQU * PAD
  5329. HEX FF,FF,FF,FF
  5330. HEX FF,FF,FF,FF
  5331. HEX FF,FF,FF,FF
  5332. HEX FF,FF,FF,FF
  5333. M1CODE33 EQU * PAD
  5334. HEX FF,FF,FF,FF
  5335. HEX FF,FF,FF,FF
  5336. HEX FF,FF,FF,FF
  5337. HEX FF,FF,FF,FF
  5338. M1CODE34 EQU * PAD
  5339. HEX FF,FF,FF,FF
  5340. HEX FF,FF,FF,FF
  5341. HEX FF,FF,FF,FF
  5342. HEX FF,FF,FF,FF
  5343. M1CODE35 EQU * PAD
  5344. HEX FF,FF,FF,FF
  5345. HEX FF,FF,FF,FF
  5346. HEX FF,FF,FF,FF
  5347. HEX FF,FF,FF,FF
  5348. M1CODE36 EQU * PAD
  5349. HEX FF,FF,FF,FF
  5350. HEX FF,FF,FF,FF
  5351. HEX FF,FF,FF,FF
  5352. HEX FF,FF,FF,FF
  5353. M1CODE37 EQU * PAD
  5354. HEX FF,FF,FF,FF
  5355. HEX FF,FF,FF,FF
  5356. HEX FF,FF,FF,FF
  5357. HEX FF,FF,FF,FF
  5358. M1CODE38 EQU * VECTOR CROSS PRODUCT
  5359. HEX 00,00,00,00
  5360. HEX 00,41,22,14
  5361. HEX 08,14,22,41
  5362. HEX 00,00,00,00
  5363. M1CODE39 EQU * RIGHT ACCENT MARK
  5364. HEX 00,20,10,08
  5365. HEX 00,00,00,00
  5366. HEX 00,00,00,00
  5367. HEX 00,00,00,00
  5368. M1CODE3A EQU * LEFT ACCENT MARK
  5369. HEX 00,02,04,08
  5370. HEX 00,00,00,00
  5371. HEX 00,00,00,00
  5372. HEX 00,00,00,00
  5373. M1CODE3B EQU * EMBEDDED RIGHT PAREN
  5374. HEX 00,00,00,01
  5375. HEX 02,04,0C,14
  5376. HEX 24,14,0C,06
  5377. HEX 01,00,00,00
  5378. M1CODE3C EQU * CEDILLA
  5379. HEX 00,00,00,00
  5380. HEX 00,00,00,00
  5381. HEX 00,00,00,20
  5382. HEX 10,08,00,00
  5383. M1CODE3D EQU * EMBEDDED LEFT PAREN
  5384. HEX 00,00,00,40
  5385. HEX 20,10,18,14
  5386. HEX 12,14,18,30
  5387. HEX 40,00,00,00
  5388. M1CODE3E EQU * MAD HAT
  5389. HEX 00,22,14,08
  5390. HEX 00,00,00,00
  5391. HEX 00,00,00,00
  5392. HEX 00,00,00,00
  5393. M1CODE3F EQU * UP AND DOWN ARROWS
  5394. HEX 00,00,00,00
  5395. HEX 00,08,1C,3E
  5396. HEX 08,3E,1C,08
  5397. HEX 00,00,00,00
  5398.  
  5399. LENGTH2 EQU *-FWA2 END OF SECOND CHECKSUM AREA
  5400.  
  5401. EJECT BUFFERS AND DATA STORE AREAS
  5402. BEGVAR1 EQU * START OF FIRST VARIABLE AREA
  5403.  
  5404. ****************************************
  5405. * USER BUFFER *
  5406. ****************************************
  5407. USBUF DEFS 1 DIFFERENCE COUNT
  5408. DEFS 1 INPUT INDEX
  5409. DEFS 1 OUTPUT INDEX
  5410. DEFS 16 BUFFER STORE AREA
  5411. SPACE 2
  5412. ****************************************
  5413. * RECEIVE BUFFER, JOB STACK *
  5414. ****************************************
  5415. RXBUF EQU *
  5416. DEFS 1 DATA WORD COUNT
  5417. DEFS 1 INPUT INDEX
  5418. DEFS 1 OUTPUT INDEX
  5419. DEFS 256 BUFFER STORE AREA
  5420. SPACE 2
  5421. ****************************************
  5422. * TRANSMIT BUFFER *
  5423. ****************************************
  5424. TXBUF EQU *
  5425. DEFS 1 DATA WORD COUNT
  5426. DEFS 1 INPUT INDEX
  5427. DEFS 1 OUTPUT INDEX
  5428. DEFS 8 DATA STORE AREA
  5429. SPACE 2
  5430. ****************************************
  5431. * DATA WORD STORE FOR PROCESSING*
  5432. ****************************************
  5433. DWORD DEFS 5
  5434. SPACE 2
  5435. ****************************************
  5436. * EXTERNAL DEVICE DATA STORE *
  5437. ****************************************
  5438. EXTD DEFS 2 EXTERNAL DEVICE DATA
  5439. EJECT STACK/INTERRUPT TABLE/VARIABLES
  5440.  
  5441. ENDVAR1 EQU * END OF FIRST VARIABLE AREA
  5442.  
  5443. ****************************************
  5444. * VARIABLES SET OR ACCESSED BY THE *
  5445. * ROM RESIDENT PROGRAM. *
  5446. * NOTE...THESE ADDRESSES MUST BE FIXED *
  5447. * AND THEIR VALUES CANNOT BE CHANGED *
  5448. * BY R.INIT *
  5449. ****************************************
  5450.  
  5451. ORG 22D0H+OFFSET
  5452.  
  5453. CKSUMTBL DEFS 2 START ADDR OF CHECKSUM TABLE
  5454. CHECKSUM DEFS 1 CHECKSUM SET BY THE LOADER
  5455. LOADFLAG DEFS 1 3CH=CODE IS LOADED
  5456. RESETFLG DEFS 1 3CH=DO SIMPLE RESET
  5457. MODE DEFS 1 OPERATIONS AND MODE
  5458.  
  5459.  
  5460. ****************************************
  5461. * PLATO VARIABLES *
  5462. * NOTE...THESE ADDRESSES MUST BE FIXED *
  5463. ****************************************
  5464.  
  5465. ORG 22EAH+OFFSET
  5466. BEGVAR2 EQU * START OF SECOND VARIABLE AREA
  5467.  
  5468. M.VERS DEFS 1 CONTROLWARE VERSION - CHANGES
  5469. * WITH NEW PRODUCTION VERSION
  5470. M.TYPE DEFS 1 TERMINAL ID CODE
  5471. M.CLOCK DEFS 2 REAL TIME CLOCK
  5472. M.EXTPA DEFS 2 INTERNAL INT. PROC. ADDRESS
  5473. M.MARGIN DEFS 2 MARGIN USED FOR CR
  5474. M.JOBS DEFS 2 JOB STACK COUNT
  5475. M.CCR DEFS 2 CHARACTER PLOTTING PARAMETERS
  5476. M.MODE DEFS 2 TERMINAL OPERATING MODE
  5477. M.DIR DEFS 2 DIRECTION OF COORDINATE STEP
  5478. M.KSW DEFS 2 DEVICE INPUT DIRECTOR
  5479. M.ENAB DEFS 2 INTERNAL INTERRUPT MASK
  5480. DEFS 2 UNUSED
  5481.  
  5482. MOD5A DEFS 2 MODE 5 ADDRESS
  5483. MOD6A DEFS 2 MODE 6 ADDRESS
  5484. MOD7A DEFS 2 MODE 7 ADDRESS
  5485.  
  5486. MEM2 DEFS 2 M2 CHARACTER SET ADDRESS
  5487. MEM3 DEFS 2 M3 CHARACTER SET ADDRESS
  5488. MEM4 DEFS 2 M4 CHARACTER SET ADDRESS
  5489. MEM5 DEFS 2 M5 CHARACTER SET ADDRESS
  5490. MEM6 DEFS 2 M6 CHARACTER SET ADDRESS
  5491. MEM7 DEFS 2 M7 CHARACTER SET ADDRESS
  5492. EJECT
  5493. ****************************************
  5494. * PROCESSOR STACK *
  5495. ****************************************
  5496. DEFS 40H
  5497. ZSTACK EQU *
  5498.  
  5499.  
  5500. ****************************************
  5501. * SCRATCH AREA *
  5502. ****************************************
  5503. SPACE 2
  5504. SAVE1 DEFS 2
  5505. SAVE2 DEFS 12
  5506. SAVE8 DEFS 2
  5507. SAVE0F DEFS 16
  5508. SAVE1F DEFS 16
  5509. SAVE2F DEFS 16
  5510. SAVE3F DEFS 16
  5511. SAVE4F DEFS 16
  5512. SAVE5F DEFS 16
  5513.  
  5514. CURDATA DEFS 10 TEMP SAVE AREA FOR CURSOR DATA
  5515. EJECT CONTROLWARE VARIABLES
  5516. SPACE 2
  5517. ****************************************
  5518. * 'CONTROLWARE 'VARIABLES *
  5519. ****************************************
  5520. ***********
  5521. * PLATO VARIABLES(NOT NECESSARILY PLATO UNIQUE)
  5522. ***********
  5523. BLOCKX DEFS 2 BEGINNING X COORD. FOR MODE 4
  5524. BLOCKY DEFS 2 BEGINNING Y COORD. FOR MODE 4
  5525. XEND DEFS 2 ENDING X COORD FOR MODES 1,4
  5526. YEND DEFS 2 ENDING Y COORD FOR MODES 1,4
  5527. SAVEL DEFS 2 FOR BLOCK MODE
  5528. SAVER DEFS 2 FOR BLOCK MODE
  5529. * THE ABOVE TAGS MUST BE IN THIS ORDER FOR BLOCK MODE
  5530. BP DEFS 1 COORDINATE BIT POSITION
  5531. CG.ADR DEFS 2 CHARACTER GENERATOR ADDRESS
  5532. CHFWA DEFS 2 CHARACTER DATA FWA
  5533. CONFLG DEFS 1 CONVERT CHAR. DATA FLAG
  5534. DMAA DEFS 2 DISPLAY MEMORY ADDRESS
  5535. DMA1 DEFS 2 DISPLAY MEMORY ADDRESS + 200H
  5536. DMA2 DEFS 2 DISPLAY MEMORY ADDRESS + 400H
  5537. EXT.IN DEFS 1 EXT. DEVICE INPUT ADDRESS
  5538. EXT.OUT DEFS 1 EXT. DEVICE OUTPUT ADDRESS
  5539. LMASK DEFS 1 BLOCK MODE LEFT MASK
  5540. MEMREG DEFS 2 LOAD MEMORY ADDRESS
  5541. MEMSEL DEFS 2 CHARACTER MEMORY SELECT ADDR.
  5542. MODE4CNT DEFS 1 DATA WORD COUNT FOR MODE 4
  5543. MMASK DEFS 1 MIDDLE MASK FOR BLOCK MODE
  5544. NCHARS DEFS 1 CHARACTER CONVERSION COUNT
  5545. NDATAB DEFS 1 DATA WORD COUNT FOR MODE 2 CON
  5546. RMASK DEFS 1 RIGHT MASK FOR BLOCK MODE
  5547. SIZE DEFS 2 CHARACTER SIZE
  5548. VDMA1 DEFS 2 DMAA - 200H FOR VERTICAL CHAR.
  5549. VDMA2 DEFS 2 DMAA - 400H FOR VERTICAL CHAR.
  5550. VECFLG DEFS 1 VECTOR PARAMETER FLAG
  5551. XDELTA DEFS 2 X AXIS DELTA
  5552. XREG DEFS 2 CURRENT 9 BIT X COORD.
  5553. YDELTA DEFS 2 Y AXIS DELTA
  5554. YREG DEFS 2 CURRENT 9 BIT Y COORD.
  5555. **********
  5556. * 401X/PLATO VARIABLES
  5557. **********
  5558. SPACE 2
  5559. BIAS DEFS 2 BIAS OF Y COORD
  5560. BYPASS DEFS 1 BYPASS CONDITION FLAG
  5561. CHBASE DEFS 2 401X CHAR DATA BASE ADDR
  5562. CKSUM DEFS 1 IDLE RAM CHECKSUM
  5563. CKSUMADD DEFS 2 CURRENT CHECKSUM ADDRESS
  5564. CKSUMTAD DEFS 2 CURRENT CHECKSUM TABLE ADDRESS
  5565. CKSUMWC DEFS 2 CURRENT CHECKSUM WORD COUNT
  5566. CLK.1 DEFS 1 ERR PROTOCOL FLAG
  5567. CLK.2 DEFS 1 ERR PROTOCOL FLAG
  5568. CLOCK DEFS 2 BLINK CURSOR CLOCK
  5569. CMODE DEFS 1 COMMAND MODE
  5570. CRLFFG DEFS 1 CR/LF FLAG
  5571. CTLADR DEFS 2 CONTROL CODE BASE ADDR
  5572. CURSAVED DEFS 1 CURSOR DATA SAVED FLAG
  5573. DASH DEFS 1 DASH/SOLID VECT FLAG
  5574. DARK DEFS 1 FLAG FOR DARK VECTOR
  5575. DOTS DEFS 2 DOT MOVEMENT FOR GIN MODE
  5576. ESCADR DEFS 2 ESC SEQUENCE BASE ADDR
  5577. E.CNTR DEFS 1 ERR PROTOCOL FLAG
  5578. EREG DEFS 1 ERR PROTOCOL FLAG
  5579. ESEGLEN DEFS 1 ERASE SEGMENT LENGTH COUNT
  5580. G.CTLFLG DEFS 1 CTL MODE FLAG
  5581. G.ESC DEFS 1 ESCAPE FLAG
  5582. G.MEMSEL DEFS 2 BASE ADDR OF SEL CHAR SET
  5583. G.SIZE DEFS 1 CHARACTER SIZE
  5584. G.SUPCUR DEFS 1 UPPRESS CURSOR FLAG
  5585. G.TTYFLG DEFS 1 TTY CAPS LOCK FLAG
  5586. G.XREG DEFS 2 GIN CROSSHAIR X COORDINATE
  5587. G.YREG DEFS 2 GIN CROSSHAIR Y COORDINATE
  5588. GIN.KEY DEFS 1 GIN CHARACTER KEY
  5589. HEIGHT DEFS 1 CHARACTER HEIGHT
  5590. HIX DEFS 2 HIGH X BYTE
  5591. HIY DEFS 2 HIGH Y BYTE
  5592. LOX DEFS 1 LOW X BYTE
  5593. LOY DEFS 1 LOW Y BYTE
  5594. KBAADR DEFS 2 KEYBOARD TO ASCII CONVERT
  5595. KEYDATA DEFS 1 KEYBOARD DATA FLAG
  5596. LINEND DEFS 2 LINE END
  5597. LINT.CTR DEFS 1 LONG INTERVAL INT CTR (MOD 21)
  5598. LOC.RMT DEFS 1 LOCAL/REMOTE FLAG
  5599. MREG DEFS 1 ERR PROTOCOL FLAG
  5600. NBYTES DEFS 1 GET3 BYTE COUNT
  5601. NREG DEFS 1 ERR PROTOCOL FLAGS
  5602. PAGEND DEFS 2 PAGE END
  5603. SAVE DEFS 2 TEMPORARY STORAGE
  5604. SCALEFG DEFS 1 SCALE/NO SCALE FLAG
  5605. SH.SUP DEFS 1 ERR PROTOCOL FLAG
  5606. STATLINE DEFS 1 STATUS LINE ACTIVE FLAG
  5607. STATUS DEFS 4 STATUS LINE FLAGS
  5608. TSTAT DEFS 1 TERMINAL STATUS WORD FOR TEK.
  5609. VECFLAG DEFS 1
  5610. WEFLAG DEFS 1 CURSOR W/E FLAG
  5611. WIDTH DEFS 1 CHARACTER WIDTH FLAG
  5612. WSEGLEN DEFS 1 SEGMENT LENGTH
  5613.  
  5614. ENDVAR2 EQU * END OF SECOND VARIABLE AREA
  5615. FWA3 EQU * START OF THIRD CHECKSUM AREA
  5616.  
  5617. STRAP DEFW 0022H 401X MODE STRAP OPTIONS
  5618. SC.OC DEFB 7EH SER CH OUTPUT CONTROL WORD
  5619. EJECT
  5620. **********
  5621. * UNIMPLEMENTED OR UNDEFINED COMMANDS COME HERE
  5622. **********
  5623. TEMP EQU *
  5624. RET
  5625.  
  5626. **********
  5627. * ROUTINES TO EXECUTE CONTROL CODES AND ESCAPE SEQUENCES
  5628. **********
  5629. DC1 EQU *
  5630. LD L,0 SELECT INVERSE VIDEO
  5631. JR DCX
  5632.  
  5633. DC2 EQU *
  5634. LD L,3 SELECT OVERSTRIKE WRITE
  5635. JR DCX
  5636.  
  5637. DC3 EQU *
  5638. LD L,2 SELECT OVERSTRIKE ERASE
  5639. JR DCX
  5640.  
  5641. DC4 EQU *
  5642. LD L,1 SELECT CLEAR WRITE
  5643.  
  5644. DCX EQU *
  5645. CALL MODESET1
  5646. RET
  5647.  
  5648. ESC EQU *
  5649. LD HL,G.ESC SET ESCAPE FLAG
  5650. LD (HL),1
  5651. RET
  5652.  
  5653. LCOORD EQU *
  5654. LD A,2 SELECT COMMAND LOAD COORDINATE
  5655. JR CMDSET
  5656. *
  5657. SSPECF EQU *
  5658. LD A,4 SELECT COMMAND SEL SPEC FN
  5659. JR CMDSET
  5660. *
  5661. LECHO EQU *
  5662. LD A,6 SELECT COMMAND LOAD ECHO
  5663. JR CMDSET
  5664. *
  5665. LADDR EQU *
  5666. LD A,8 SELECT COMMAND LOAD ADDRESS
  5667. JR CMDSET
  5668. *
  5669. LEXT EQU *
  5670. LD A,10 SELECT COMMAND LOAD EXT DATA
  5671.  
  5672. CMDSET EQU *
  5673. LD (CMODE),A SAVE COMMAND MODE
  5674. CMDSET.1 EQU *
  5675. XOR A CLEAR BYTE COUNTER
  5676. LD (NBYTES),A
  5677. RET
  5678. *
  5679. LMARG EQU *
  5680. CALL R.INPX
  5681. LD A,(M.CCR)
  5682. AND 01H
  5683. JR Z,LMARG.1 HORIZONTAL, HL HAS X
  5684. CALL R.INPY GET Y IN HL
  5685. LMARG.1 LD (M.MARGIN),HL
  5686. RET
  5687. *
  5688. SLDM2C EQU * SELECT PLATO DATA MODE 2
  5689. LD A,1 WITH CONVERT
  5690. JR SLDM2.1
  5691.  
  5692. SLDM2 EQU * SELECT PLATO DATA MODE 2
  5693. XOR A WITHOUT CONVERT
  5694. SLDM2.1 LD (CONFLG),A SET/CLEAR CONVERT FLAG
  5695. XOR A CLEAR MODE 2 BYTE COUNT
  5696. LD (NDATAB),A
  5697. LD C,2 SELECT MODE 2
  5698. CALL MODESET2 (LOAD MODE)
  5699. JR CMDSET.1
  5700. *
  5701. FS.1 EQU *
  5702. LD C,0 SELECT MODE 0
  5703. CALL MODESET2 (POINT PLOT)
  5704. JR CMDSET.1
  5705. *
  5706. GS.1 EQU *
  5707. LD C,1 SELECT MODE 1
  5708. CALL MODESET2 (GRAPH)
  5709. LD A,(MODE)
  5710. LD (DARK),A SELECT DARK VECTORS
  5711. JR CMDSET.1
  5712. *
  5713. EM.1 EQU *
  5714. LD C,4 SELECT MODE 4
  5715. CALL MODESET2 (BLOCK)
  5716. XOR A CLEAR TWICE FLAG
  5717. LD (MODE4CNT),A
  5718. JR CMDSET.1
  5719.  
  5720. US.1 EQU *
  5721. LD C,3 SELECT MODE 3
  5722. CALL MODESET2 (ALPHA)
  5723. RET
  5724.  
  5725. MODE567 EQU *
  5726. LD A,C GET ESC SEQ CHAR (54H,55H,56H)
  5727. SUB 4FH CHANGE TO 05, 06, 07
  5728. LD C,A
  5729. CALL MODESET2 SELECT MODE (5, 6 OR 7)
  5730. JR CMDSET.1
  5731. EJECT
  5732. ********************************************************
  5733. * THE FOLLOWING CODE AND DATA ARE UNIQUE TO
  5734. * ASCII OPERATIONS AND MAY BE OVERLAID BY
  5735. * USER PROGRAMS IF OPERATING ONLY IN PLATO OPERATIONS.
  5736. ********************************************************
  5737.  
  5738. *********
  5739. * ASCII INITIALIZE
  5740. **********
  5741. AINIT EQU *
  5742. LD A,3 SET (M.KSW) TO PUT INPUT DATA
  5743. LD (M.KSW),A INTO THE USER BUFFER
  5744. LD HL,100 INITIALIZE BLINK COUNTER
  5745. LD (CLOCK),HL (BLINK 3 TIMES PER SECOND)
  5746. LD A,0B5H SET TERMINAL STATUS WORD
  5747. LD (TSTAT),A
  5748. LD HL,IGTASC SELECT IGT ASCII KEYBOARD
  5749. LD (KBAADR),HL
  5750. LD HL,CTLADR.A SELECT ASCII CTL TBL
  5751. LD (CTLADR),HL
  5752. LD HL,ESCADR.A SELECT ASCII ESC SEQ TBL
  5753. LD (ESCADR),HL
  5754. CALL ASIZE1 SELECT A0 CHARACTER SET
  5755. LD HL,0070H SET Y BIAS
  5756. LD (BIAS),HL
  5757. XOR A
  5758. LD (MODE),A SELECT ASCII OPERATIONS
  5759. LD (SCALEFG),A DO SCALE IN GRAPH MODE
  5760. LD HL,001EH SET ALPHA/OVERSTRIKE WRITE
  5761. CALL R.MODE
  5762. LD HL,256 PUT CROSSHAIR IN CENTER OF
  5763. LD (G.XREG),HL SCREEN
  5764. LD (G.YREG),HL
  5765. CALL AFF CLR SCREEN, HOME, SET ALPHA
  5766. RET
  5767. **********
  5768. * ASCII 401X IDLE LOOP
  5769. **********
  5770. AIDLE EQU * ASCII IDLE
  5771. * IN A,(EXTSTAT) CHECK FOR CARRIER
  5772. * BIT 4,A
  5773. * JR NZ,AIDLE0 JUMP IF CARRIER OFF
  5774. * LD A,0DFH CARRIER ON, SO
  5775. * OUT (PNLLTS),A CLEAR ERROR LIGHT
  5776. *
  5777. AIDLE0 EQU *
  5778. CALL R.EXEC TEST FOR RECEIVE/TRANSMIT DATA
  5779. CALL R.INPUT TEST FOR DATA FROM OPERATOR
  5780. LD E,L
  5781. LD D,H
  5782. ADD HL,HL TEST IF DATA FROM KB OR TP
  5783. JR C,AIDLE2 NO DATA, BLINK CURSOR
  5784.  
  5785. LD A,07 HAVE DATA
  5786. AND H
  5787. JR NZ,AIDLE1 JUMP IF NOT KEYBOARD DATA
  5788. CALL KEY PROCESS KEYBOARD DATA
  5789. JR AIDLE2
  5790.  
  5791. AIDLE1 XOR A
  5792. LD (KEYDATA),A CLEAR KEYBOARD DATA FLAG
  5793. LD A,06
  5794. AND H
  5795. CP 02
  5796. CALL Z,GIN.TP PROCESS TP DATA
  5797. * CALL Z,TOUCH PROCESS TP DATA
  5798.  
  5799. AIDLE2 EQU *
  5800. CALL BLINK BLINK THE CURSOR
  5801. JP IDLE
  5802. EJECT
  5803. **********
  5804. * ROUTINE TO BLINK THE CURSOR
  5805. **********
  5806. BLINK EQU *
  5807. LD A,(G.SUPCUR) IS THE CURSOR SUPPRESSED
  5808. OR A
  5809. RET NZ EXIT IF YES
  5810.  
  5811. LD HL,(CLOCK) DECREMENT BLINK COUNTER
  5812. DEC HL
  5813. LD (CLOCK),HL
  5814. LD A,L
  5815. OR H
  5816. RET NZ EXIT IF NOT ZERO YET
  5817.  
  5818. LD HL,100 RESET BLINK COUNTER
  5819. LD (CLOCK),HL
  5820. CALL CUR.SAVE SAVE CURSOR DATA IF NECESSARY
  5821. LD HL,WEFLAG TOGGLE CURSOR W/E FLAG
  5822. LD A,(HL)
  5823. XOR 01
  5824. LD (HL),A
  5825. ADD A,2 SET B=2 OR 3
  5826. LD B,A
  5827. LD C,60H
  5828. LD A,(MODE) TEST MODE
  5829. CP 8
  5830. JR NZ,BLINK1 NORMAL CURSOR IF NOT GIN MODE
  5831. INC C CROSSHAIR CURSOR IF GIN MODE
  5832. BLINK1 LD HL,(CHBASE) WRITE OR ERASE THE CURSOR
  5833. CALL JMPHL
  5834. RET
  5835. SPACE 4
  5836. * SAVE DISPLAY DATA AT THE CURSOR POSITION
  5837. CUR.SAVE EQU *
  5838. LD HL,CURSAVED
  5839. BIT 0,(HL)
  5840. RET NZ EXIT IF ALREADY SAVED
  5841. SET 0,(HL) SET SAVED FLAG
  5842. LD DE,CURDATA+9 POINT TO DATA SAVE AREA
  5843. LD HL,(DMAA) LEFT HALF OF DATA
  5844. CALL CUR.SAV1
  5845. LD HL,(DMA1) RIGHT HALF OF DATA
  5846.  
  5847. CUR.SAV1 EQU *
  5848. LD BC,5 BYTE COUNT
  5849. CUR.SAV2 LDD (DE)=(HL), DECR DE,HL,BC
  5850. RET PO EXIT IF BC=0
  5851. LD A,L LOOP IF HL NOT 0FFH
  5852. INC A
  5853. JR NZ,CUR.SAV2
  5854. BIT 0,H LOOP IF H IS EVEN
  5855. JR Z,CUR.SAV2
  5856. INC H COLUMN OVERFLOW, SO REALIGN
  5857. INC H
  5858. SET 7,H
  5859. JR CUR.SAV2 LOOP
  5860. SPACE 4
  5861. * ERASE CURSOR BY RESTORING SAVED DISPLAY DATA
  5862. CUR.ERAS EQU *
  5863. LD HL,CURSAVED
  5864. BIT 0,(HL)
  5865. RET Z EXIT IF NOTHING SAVED
  5866. RES 0,(HL) CLEAR SAVED FLAG
  5867. LD HL,CURDATA+9 POINT TO DATA SAVE AREA
  5868. LD DE,(DMAA) LEFT HALF OF DATA
  5869. CALL CUR.ERS1
  5870. LD DE,(DMA1) RIGHT HALF OF DATA
  5871.  
  5872. CUR.ERS1 EQU *
  5873. LD BC,5 BYTE COUNT
  5874. CUR.ERS2 LDD (DE)=(HL), DECR DE,HL,BC
  5875. RET PO EXIT IF BC=0
  5876. LD A,E LOOP IF DE NOT 0FFH
  5877. INC A
  5878. JR NZ,CUR.ERS2
  5879. BIT 0,D LOOP IF D IS EVEN
  5880. JR Z,CUR.ERS2
  5881. INC D COLUMN OVERFLOW, SO REALIGN
  5882. INC D
  5883. SET 7,D
  5884. JR CUR.ERS2 LOOP
  5885. EJECT
  5886. **********
  5887. * PROCESS KEYBOARD INPUT
  5888. **********
  5889. KEY EQU *
  5890. LD A,01 SET KEYBOARD DATA FLAG
  5891. LD (KEYDATA),A
  5892. CALL KBCON GET ASCII KB DATA IN A AND C
  5893. RET Z IGNORE UNDEFINED KEYS
  5894. ADD A,A TEST FOR SPECIAL CODE
  5895. JP C,SPCODE CARRY, SPECIAL CODE
  5896.  
  5897. KEY0 EQU *
  5898. LD HL,G.CTLFLG TEST FOR CTL AS
  5899. BIT 0,(HL) PREVIOUS KEY
  5900. JR Z,KEY3 NO, JUMP
  5901.  
  5902. RES 0,(HL) CLEAR CTL FLAG
  5903. LD A,C
  5904. CP 60H IS CODE 60H-7FH
  5905. JR C,KEY1 NO, JUMP
  5906.  
  5907. RET Z YES, IGNORE 60H CODE
  5908. CP 7BH IS CODE 7BH-7FH
  5909. RET NC YES, IGNORE CODE
  5910. SUB 60H CHANGE 61H-7AH TO 01H-1AH
  5911. JR KEY4
  5912.  
  5913. KEY1 EQU *
  5914. CP 40H IS CODE 40H-5FH
  5915. JR C,KEY2 NO, JUMP
  5916.  
  5917. AND 0FH YES, CHANGE 4X AND 5X TO 0X
  5918. JR Z,KEY4 40H AND 50H GENERATE 00H
  5919. CP 0BH IS CODE NOW 0BH-0FH
  5920. RET C NO, IGNORE
  5921. ADD A,10H YES CHANGE TO 1BH-1FH
  5922. JR KEY4
  5923.  
  5924. KEY2 EQU *
  5925. CP 20H IS CHAR A CTL CODE
  5926. JR C,XMTEST YES, PROCESS IT
  5927.  
  5928. CP 39H CTL 9
  5929. JR Z,SCALE
  5930. CP 3DH CTL =
  5931. JR Z,UNSCALE
  5932. CP 30H CTL 0
  5933. JR Z,ONLINE
  5934. CP 31H CTL 1
  5935. JR Z,OFFLINE
  5936. RET IGNORE OTHER CODES
  5937.  
  5938. KEY3 EQU * HAVE A NON-CONTROL CODE
  5939. LD A,(G.TTYFLG) IS ALL CAPS SELECTED
  5940. OR A
  5941. JR Z,XMTEST NO, JUMP
  5942.  
  5943. LD A,C IS CHAR 61H OR MORE
  5944. CP 61H
  5945. JR C,KEY4 NO, JUMP
  5946. CP 7BH YES, IS IT 7BH OR MORE
  5947. JR NC,KEY4 YES, JUMP
  5948. SUB 20H CONVERT 61H-7AH TO 41H-5AH
  5949.  
  5950. KEY4 EQU *
  5951. LD C,A SAVE MODIFIED CHAR IN C
  5952.  
  5953. XMTEST EQU *
  5954. LD A,(MODE)
  5955. CP 8
  5956. JP Z,GIN.KB DO GIN INPUT IF GIN MODE
  5957.  
  5958. CALL XMIT.1A TRANSMIT CHAR IF NOT LOCAL
  5959. CALL R.XJOB PROCESS DATA LOCALLY
  5960. RET
  5961. EJECT
  5962. **********
  5963. * THE FOLLOWING CONTROL KEY SEQUENCES PERFORM LOCAL FUNCTIONS
  5964. **********
  5965. OFFLINE EQU *
  5966. LD A,0DFH CLEAR ERR LIGHT
  5967. OUT (PNLLTS),A
  5968. LD A,01 SET LOCAL FLAG
  5969. JR OFFLINE1
  5970. *
  5971. ONLINE EQU *
  5972. XOR A CLEAR LOCAL FLAG
  5973. OFFLINE1 LD (LOC.RMT),A
  5974. RET
  5975. *
  5976. SCALE EQU *
  5977. XOR A SET SCALE FLAG
  5978. LD HL,0070H SCREEN BIAS VALUE
  5979. JR SCALE1
  5980. *
  5981. UNSCALE EQU *
  5982. LD A,01 CLEAR SCALE FLAG
  5983. LD HL,0000 SCREEN BIAS VALUE
  5984. SCALE1 LD (SCALEFG),A
  5985. LD (BIAS),HL
  5986. RET
  5987. SPACE 4
  5988. * * * * * * * * * * * * * * * * * * * *
  5989. * THE FOLLOWING KEYS PERFORM LOCAL FUNCTIONS
  5990. * * * * * * * * * * * * * * * * * * * *
  5991. SPCODE EQU *
  5992. LD C,A
  5993. LD B,0
  5994. LD HL,SPTBL
  5995. ADD HL,BC
  5996. LD E,(HL)
  5997. INC HL
  5998. LD D,(HL)
  5999. EX DE,HL
  6000. JP (HL)
  6001.  
  6002. SPTBL EQU *
  6003. DEFW G.CTL
  6004. DEFW G.RESET
  6005. DEFW G.TTY
  6006. DEFW G.TTYLOK
  6007. DEFW G.PAGE
  6008. DEFW G.ERASE
  6009. * DEFW G.HELP
  6010. SPACE 4
  6011. *
  6012. G.CTL EQU *
  6013. LD A,01 SET CTL FLAG
  6014. LD (G.CTLFLG),A
  6015. RET
  6016. *
  6017. G.RESET EQU *
  6018. CALL CUR.ERAS ERASE CURSOR
  6019. CALL ASIZE1 RESET TO SIZE 1 CHARACTERS
  6020. CALL AFF.1 HOME POSITION
  6021. RET
  6022. *
  6023. G.PAGE EQU *
  6024. CALL AFF CLEAR SCREEN, HOME POSITION
  6025. RET
  6026. *
  6027. G.TTY EQU * CLEAR TTY FLAG
  6028. XOR A
  6029. JR G.TTY1
  6030. *
  6031. G.TTYLOK EQU *
  6032. LD A,01 SET TTY FLAG
  6033. G.TTY1 LD (G.TTYFLG),A
  6034. RET
  6035. *
  6036. G.ERASE EQU *
  6037. CALL BS BACKSPACE
  6038. LD BC,0100H B=W/E BITS, C=CHAR(SPACE)
  6039. CALL ACHARGEN DISPLAY THE SPACE
  6040. LD C,08
  6041. JP KEY0
  6042. *********
  6043. * ASCII KEYBOARD TABLE
  6044. IGTASC EQU *
  6045. HEX 30,31,32,33 0X
  6046. HEX 34,35,36,37
  6047. HEX 38,39,40,5C
  6048. HEX 09,5E,2B,2D
  6049. HEX 7D,1B,FF,08 1X
  6050. HEX 83,FF,0D,0A
  6051. * HEX 83,86,0D,0A
  6052. HEX FF,7F,FF,80
  6053. HEX 84,FF,FF,FF
  6054. HEX 3C,3E,5B,5D 2X
  6055. HEX 24,25,5F,27
  6056. HEX 2A,28,60,7C
  6057. HEX 09,7E,23,26
  6058. HEX 7B,1B,FF,85 3X
  6059. HEX 82,FF,0D,0A
  6060. * HEX 82,86,0D,0A
  6061. HEX FF,7F,FF,80
  6062. HEX 81,FF,FF,FF
  6063. HEX 20,61,62,63 4X
  6064. HEX 64,65,66,67
  6065. HEX 68,69,6A,6B
  6066. HEX 6C,6D,6E,6F
  6067. HEX 70,71,72,73 5X
  6068. HEX 74,75,76,77
  6069. HEX 78,79,7A,3D
  6070. HEX 3B,2F,2E,2C
  6071. HEX 20,41,42,43 6X
  6072. HEX 44,45,46,47
  6073. HEX 48,49,4A,4B
  6074. HEX 4C,4D,4E,4F
  6075. HEX 50,51,52,53 7X
  6076. HEX 54,55,56,57
  6077. HEX 58,59,5A,29
  6078. HEX 3A,3F,21,22
  6079. EJECT
  6080. **********
  6081. * JUMP TABLE FOR ASCII MODE ESCAPE SEQUENCES
  6082. **********
  6083. ESCADR.A EQU *
  6084. DEFB 07H BEL
  6085. DEFW BEL
  6086. DEFB 08H BS
  6087. DEFW BS
  6088. DEFB 0DH CR
  6089. DEFW ESC
  6090. DEFB 02H STX
  6091. DEFW PINIT
  6092. DEFB 18H CAN
  6093. DEFW CAN
  6094. DEFB 60H REVERSE ACCENT
  6095. DEFW VECTNORM
  6096. DEFB 61H LC A
  6097. DEFW VECTDOT
  6098. DEFB 63H LC C
  6099. DEFW VECTSDSH
  6100. DEFB 64H LC D
  6101. DEFW VECTLDSH
  6102. DEFB 11H DC1
  6103. DEFW DC1
  6104. DEFB 12H DC2
  6105. DEFW DC2
  6106. DEFB 13H DC3
  6107. DEFW DC3
  6108. DEFB 14H DC4
  6109. DEFW DC4
  6110. DEFB 05H ENQ
  6111. DEFW ENQ
  6112. DEFB 0CH FF
  6113. DEFW AFF
  6114. DEFB 1DH GS
  6115. DEFW GS
  6116. DEFB 09H HT
  6117. DEFW HTAB
  6118. DEFB 0AH LF
  6119. DEFW ESC
  6120. DEFB 3BH SEMICOLON
  6121. DEFW ASIZE1
  6122. DEFB 3AH COLON
  6123. DEFW ASIZE1
  6124. DEFB 39H 9
  6125. DEFW ASIZE1
  6126. DEFB 38H 8
  6127. DEFW ASIZE1
  6128. DEFB 37H 7
  6129. DEFW ASIZE2
  6130. DEFB 1AH SUB
  6131. DEFW ASUB
  6132. DEFB 1FH US
  6133. DEFW US
  6134. DEFB 0BH VT
  6135. DEFW AVT
  6136. DEFB 00H NUL
  6137. DEFW ESC
  6138. DEFB 1BH ESC
  6139. DEFW ESC
  6140. DEFB 0FFH END OF TABLE
  6141. **********
  6142. * JUMP TABLE FOR ASCII MODE CONTROL CODES
  6143. **********
  6144. CTLADR.A EQU *
  6145. DEFB 0DH CR
  6146. DEFW ACR
  6147. DEFB 0AH LF
  6148. DEFW ALF
  6149. DEFB 08H BS
  6150. DEFW BS
  6151. DEFB 1BH ESC
  6152. DEFW ESC
  6153. DEFB 1FH US
  6154. DEFW US
  6155. DEFB 1CH FS
  6156. DEFW FS
  6157. DEFB 1DH GS
  6158. DEFW GS
  6159. DEFB 09H HT
  6160. DEFW HTAB
  6161. DEFB 0BH VT
  6162. DEFW AVT
  6163. DEFB 07H BEL
  6164. DEFW BEL
  6165. DEFB 0FFH END OF TABLE
  6166.  
  6167. **********
  6168. * ROUTINES TO EXECUTE CONTROL CODES AND ESCAPE SEQUENCES
  6169. **********
  6170. BEL EQU *
  6171. LD A,01H SOUND AUDIBLE ALARM
  6172. OUT (MISCTL),A
  6173. XOR A CLEAR BYPASS
  6174. LD (BYPASS),A
  6175. RET
  6176.  
  6177. BS EQU *
  6178. CALL CUR.ERAS
  6179. XOR A CLEAR BYPASS
  6180. LD (BYPASS),A
  6181. CALL R.INPX MOVE X BACK ONE CHAR WIDTH
  6182. LD A,(WIDTH)
  6183. CPL
  6184. INC A
  6185. LD E,A
  6186. LD D,0FFH
  6187. ADD HL,DE
  6188. BIT 7,H IF X COORD NEGATIVE
  6189. JR NZ,BS.SCK GO CHECK CHAR SIZE
  6190.  
  6191. BS.END EQU *
  6192. CALL R.OUTX SET NEW X COORD
  6193. RET
  6194.  
  6195. BS.SCK EQU *
  6196. LD A,(G.SIZE) CHECK CHAR SIZE
  6197. OR A
  6198. JR NZ,BS.VT JUMP IF SIZE 2
  6199. DEC HL SUBT 2 FROM X, SINCE
  6200. DEC HL SIZE 1 USES ONLY 510 DOTS
  6201.  
  6202. BS.VT EQU *
  6203. LD A,L VT REQUIRED IF X NEG
  6204. CP 0F8H AND LOWER 8 BITS OF X ARE
  6205. JR NZ,BS.END 0F8H WITH SIZE 2 CHAR
  6206. CALL R.OUTX
  6207. CALL VT.1
  6208. RET
  6209.  
  6210. CAN EQU *
  6211. LD HL,BYPASS SET BYPASS
  6212. LD (HL),1
  6213. RET
  6214.  
  6215. ACR EQU *
  6216. CALL US.2 CLR CURSOR,SET ALPHA,CLR BYPASS
  6217. CALL CR.1 DO CARRIAGE RETURN
  6218. LD HL,(STRAP) TEST FOR AUTO CR/LF
  6219. BIT 3,L
  6220. RET Z RETURN IF NOT SET
  6221. LD A,(KEYDATA) RETURN IF NOT KEYBOARD DATA
  6222. OR A
  6223. RET Z
  6224. LD (CRLFFG),A SET SCROLL FLAG
  6225. CALL LF.1A DO A LINE FEED
  6226. CALL SCROLLCK SEE IF SCROLL REQUIRED
  6227. CALL SCROLLCL CLEAR SCROLL FLAG
  6228. RET
  6229.  
  6230. CR.1 EQU *
  6231. LD HL,0000H SET TO LEFT MARGIN
  6232. CALL R.OUTX
  6233. RET
  6234.  
  6235.  
  6236. ENQ EQU *
  6237. LD A,(MODE) IF NOT GIN MODE THEN
  6238. CP 8
  6239. JR Z,ENQ.1
  6240. LD A,(TSTAT) SEND TERMINAL STATUS
  6241. LD C,A
  6242. CALL XMIT.1A
  6243.  
  6244. ENQ.1 CALL R.INPX GET X COORD
  6245. CALL HILO AND SEND IN 2 BYTES
  6246. LD HL,(BIAS) SAVE -BIAS ON STACK
  6247. CALL COMPHL
  6248. PUSH HL
  6249. CALL R.INPY GET Y COORD
  6250. POP DE SUBT THE BIAS
  6251. ADD HL,DE
  6252. CALL HILO AND SEND IN 2 BYTES
  6253. LD HL,(STRAP) TEST GIN TRANSMISSION
  6254. BIT 1,L
  6255. JR Z,ENQ.2 JUMP IF SEND NOTHING AUTO
  6256.  
  6257. PUSH HL SAVE STRAP VALUE
  6258. LD C,0DH SEND CAR RET
  6259. CALL XMIT.1A
  6260. POP HL GET SAVED STRAP
  6261. BIT 2,L
  6262. JR Z,ENQ.2 SEND CR ONLY
  6263. LD C,04H SEND EOT
  6264. CALL XMIT.1A
  6265.  
  6266. ENQ.2 EQU *
  6267. CALL GIN.EXIT DISABLE TP, SAVE CURSOR POS.
  6268. LD HL,MODE TEST MODE
  6269. LD A,(HL)
  6270. CP 8
  6271. RET NZ EXIT IF NOT GIN MODE
  6272. LD (HL),3 SET ALPHA MODE
  6273. RET
  6274.  
  6275. GIN.EXIT EQU *
  6276. LD A,(MODE) TEST MODE
  6277. CP 8
  6278. RET NZ JUST EXIT IF NOT GIN MODE
  6279. CALL CUR.ERAS ERASE THE CURSOR
  6280. CALL R.INPX SAVE CROSSHAIR POSITION
  6281. LD (G.XREG),HL
  6282. INC HL ADJUST FOR CROSSHAIR OFFSET
  6283. INC HL
  6284. CALL R.OUTX
  6285. CALL R.INPY
  6286. LD (G.YREG),HL
  6287. INC HL
  6288. INC HL
  6289. CALL R.OUTY
  6290. LD H,04H LOAD INTERRUPT MASK
  6291. LD A,(M.ENAB)
  6292. AND 0D8H DISABLE TOUCH PANEL
  6293. LD L,A
  6294. CALL R.SSF
  6295. RET
  6296.  
  6297. HILO EQU *
  6298. LD A,(MODE) CHECK MODE
  6299. CP 8
  6300. JR NZ,HILO.2 NO BIAS IF NOT GIN MODE
  6301. INC HL BIAS FOR CENTER OF CROSSHAIR
  6302. INC HL
  6303. HILO.2 LD A,(SCALEFG) IF SCALING THEN
  6304. OR A
  6305. JR NZ,HILO.1
  6306. ADD HL,HL DOUBLE COORD VALUE
  6307. HILO.1 LD A,1FH GET LOWER 5 BITS
  6308. AND L
  6309. PUSH AF AND TEMP SAVE
  6310. ADD HL,HL GET UPPER 5 BITS IN H REG.
  6311. ADD HL,HL
  6312. ADD HL,HL
  6313. LD A,H
  6314. AND 1FH MASK TO 5 BITS
  6315. OR 20H BIAS VALUE
  6316. LD C,A
  6317. CALL XMIT.1A SEND UPPER BITS
  6318. POP AF GET SAVED LOWER BITS
  6319. OR 20H BIAS VALUE
  6320. LD C,A
  6321. CALL XMIT.1A SEND LOWER BITS
  6322. RET
  6323.  
  6324. * CLEAR THE SCREEN AND HOME THE CURSOR
  6325. AFF EQU * PAGE GETS YOU HERE
  6326. CALL CUR.ERAS ERASE THE CURSOR
  6327. CALL BULKER DO BULK ERASE
  6328.  
  6329. AFF.1 EQU * RESET KEY GETS YOU HERE
  6330. CALL US.2 SET ALPHA, ENABLE CURSOR
  6331. CALL CR.1 CARRIAGE RETURN
  6332. CALL ALF.2 SET TO TOP LINE
  6333. RET
  6334.  
  6335. * SELECT POINT PLOT MODE
  6336. FS EQU *
  6337. CALL CUR.ERAS ERASE CURSOR
  6338. LD A,01 SUPPRESS THE CURSOR
  6339. LD (G.SUPCUR),A
  6340. XOR A CLEAR BYPASS
  6341. LD (BYPASS),A
  6342. LD A,0B5H SET TERMINAL STATUS
  6343. LD (TSTAT),A
  6344. CALL GIN.EXIT DISABLE TP, SAVE CURSOR POS.
  6345. JP FS.1
  6346.  
  6347. * SELECT GRAPH MODE
  6348. GS EQU *
  6349. CALL CUR.ERAS ERASE CURSOR
  6350. LD A,01 SUPPRESS THE CURSOR
  6351. LD (G.SUPCUR),A
  6352. XOR A CLEAR BYPASS
  6353. LD (BYPASS),A
  6354. LD A,0B9H SET TERMINAL STATUS
  6355. LD (TSTAT),A
  6356. CALL GIN.EXIT DISABLE TP, SAVE CURSOR POS.
  6357. JP GS.1
  6358.  
  6359. * SELECT ALPHA MODE
  6360. US EQU *
  6361. LD A,(MODE) IS THIS GIN MODE
  6362. CP 8
  6363. RET Z YES - EXIT
  6364.  
  6365. US.2 EQU *
  6366. CALL CUR.ERAS ERASE THE CURSOR
  6367. XOR A CLEAR BYPASS
  6368. LD (BYPASS),A
  6369. LD (G.SUPCUR),A ENABLE THE CURSOR
  6370. LD A,0B5H SET TERMINAL STATUS
  6371. LD (TSTAT),A
  6372. CALL GIN.EXIT DISABLE TP, SAVE CURSOR POS.
  6373. JP US.1 SELECT ALPHA MODE
  6374.  
  6375. * MOVE CURSOR DOWN ONE CHARACTER LINE.
  6376. ALF EQU *
  6377. CALL CUR.ERAS ERASE THE CURSOR
  6378. XOR A CLEAR BYPASS
  6379. LD (BYPASS),A
  6380. CALL LF.1A DO A LINE FEED
  6381. LD A,(KEYDATA) IS THIS KEYBOARD DATA
  6382. OR A
  6383. JR Z,LFSCROL JUMP IF NOT
  6384. LD HL,(STRAP) YES - TEST FOR AUTO. LF/CR
  6385. BIT 4,L
  6386. CALL NZ,CR.1 IF AUTO, DO CR
  6387. LFSCROL EQU *
  6388. CALL SCROLLCK
  6389. CALL SCROLLCL
  6390. RET
  6391.  
  6392. LF.1A EQU *
  6393. CALL R.INPY GET CURRENT Y
  6394. EX DE,HL STORE Y IN DE
  6395. LD HL,(PAGEND) CHECK FOR PAGEND
  6396. LD A,D
  6397. OR A
  6398. JR NZ,CHANGEY NOT PG BOTTOM.
  6399. LD A,E CHANGE Y ONLY.
  6400. CP L
  6401. JR C,ALF.2 PAGE BOTTOM REACHED
  6402. *
  6403. CHANGEY EQU *
  6404. EX DE,HL JUST CHANGE Y COORD
  6405. JR LF.3
  6406. *
  6407. ALF.2 EQU *
  6408. LD HL,200H SET Y TO PAGE TOP
  6409. *
  6410. LF.3 EQU *
  6411. LD A,(HEIGHT)
  6412. CPL
  6413. INC A A HAS -HEIGHT
  6414. LD E,A
  6415. LD D,0FFH
  6416. ADD HL,DE
  6417. CALL R.OUTY
  6418. RET
  6419. EJECT
  6420. * NONDESTRUCTIVE FORWARD SPACE CURSOR ONE CHARACTER POSITION
  6421. HTAB EQU *
  6422. CALL CUR.ERAS ERASE THE CURSOR
  6423. XOR A CLEAR BYPASS
  6424. LD (BYPASS),A
  6425.  
  6426. HTAB.1 EQU *
  6427. LD HL,(XREG) UPDATE X COORDINATE
  6428. LD A,(WIDTH)
  6429. LD E,A
  6430. LD D,0
  6431. ADD HL,DE
  6432. CALL R.OUTX
  6433. *
  6434. LINENDCK EQU *
  6435. CALL R.INPX GET CURRENT X
  6436. EX DE,HL IN DE
  6437. LD A,(G.SIZE) CHECK CHAR SIZE
  6438. OR A
  6439. JR Z,LEND.S1
  6440. LD A,E SIZE 2, SO CHECK X COORD.
  6441. OR D IF ZERO, IT HAS WRAPPED
  6442. JR Z,PGCHK SO DO CR/LF.
  6443. RET
  6444. *
  6445. LEND.S1 EQU *
  6446. LD HL,(LINEND) SIZE 1 AND X AT LINEND.
  6447. LD A,D DE HAS CURRENT X
  6448. CP H
  6449. RET C
  6450. JR NZ,PGCHK IF LINEND DO CR/LF
  6451. LD A,E RETURN, LINE FEED.
  6452. CP L OTHERWISE SIMPLY RETURN.
  6453. RET C
  6454. RET Z
  6455. LD HL,0000H
  6456. CALL R.OUTX
  6457.  
  6458. PGCHK EQU *
  6459. CALL CR.1
  6460. CALL LF.1A
  6461. LD A,(G.SUPCUR) TEST IF CURSOR ON
  6462. OR A
  6463. CALL Z,SCROLL SCROLL IF ON
  6464. CALL SCROLLCL
  6465. RET
  6466. *
  6467. SCROLLCK EQU *
  6468. LD A,(G.SUPCUR) TEST SUPPRESS CURSOR
  6469. OR A
  6470. RET NZ
  6471. LD A,(CRLFFG) TEST CR/LF SEQUENCE
  6472. OR A
  6473. CALL NZ,SCROLL
  6474. CALL SCROLLCL CLEAR SCROLL FLAG
  6475. RET
  6476.  
  6477. SCROLL EQU *
  6478. LD HL,0000H SET UP X1,Y1 AND X2,Y2
  6479. LD (BLOCKX),HL FOR ERASING A LINE
  6480. LD HL,(LINEND)
  6481. LD (XEND),HL
  6482. CALL R.INPY
  6483. LD (YEND),HL
  6484. EX DE,HL
  6485. LD HL,(HEIGHT)
  6486. DEC HL
  6487. ADD HL,DE
  6488. LD (BLOCKY),HL
  6489. LD A,(M.MODE) TEMP SAVE M.MODE
  6490. PUSH AF
  6491. LD L,00H SET ERASE BITS
  6492. CALL MODESET1
  6493. LD HL,BLOCKX ERASE THE LINE
  6494. CALL R.BLOCK
  6495. POP AF GET SAVED M.MODE
  6496. LD (M.MODE),A
  6497. LD A,(G.SIZE) TEST FOR SIZE 2 CHARS
  6498. OR A
  6499. RET NZ EXIT IF SIZE 2
  6500. CALL R.INPY SIZE 1, SO GET Y COORD
  6501. INC HL
  6502. INC HL ADD 2
  6503. CALL R.OUTY AND OUTPUT NEW Y
  6504. RET
  6505.  
  6506. ASIZE1 EQU *
  6507. CALL CUR.ERAS ERASE CURSOR
  6508. LD HL,A0CODE00 SELECT SIZE 1
  6509. LD (G.MEMSEL),HL
  6510. LD HL,CHGEN.S1
  6511. LD (CHBASE),HL
  6512. LD HL,509 85 CHARS PER LINE
  6513. LD (LINEND),HL 36 LINES PER PAGE
  6514. LD HL,PAGEND SET LINEND, PAGEND AND
  6515. LD (HL),22 HEIGHT ACCORDINGLY
  6516. LD HL,HEIGHT
  6517. LD (HL),14
  6518. LD HL,WIDTH
  6519. LD (HL),6
  6520. XOR A SET SIZE TO ZERO
  6521. LD (G.SIZE),A (SIZE 1 CHARS)
  6522. RET
  6523.  
  6524. ASIZE2 EQU *
  6525. CALL CUR.ERAS ERASE CURSOR
  6526. LD HL,M0CODE00 POINT TO IST CHAR DATA
  6527. LD (G.MEMSEL),HL
  6528. LD HL,CHGEN.S2
  6529. LD (CHBASE),HL
  6530. LD HL,511 64 CHARS PER LINE
  6531. LD (LINEND),HL 32 LINES PER PAGE
  6532. LD HL,PAGEND SET PAGEND,LINEND AND
  6533. LD (HL),0 HEIGHT ACCORDINGLY
  6534. LD HL,HEIGHT
  6535. LD (HL),16
  6536. LD HL,WIDTH
  6537. LD (HL),8
  6538. LD A,1 INDICATE SIZE 2 CHARS
  6539. LD (G.SIZE),A
  6540. RET
  6541.  
  6542. ASUB EQU *
  6543. CALL CUR.ERAS ERASE CURSOR
  6544. XOR A ENABLE CURSOR DISPLAY
  6545. LD (G.SUPCUR),A
  6546. INC A SET BYPASS
  6547. LD (BYPASS),A
  6548. LD H,04H LOAD INTERRUPT MASK
  6549. LD A,(M.ENAB)
  6550. OR 20H ENABLE TOUCH PANEL
  6551. LD L,A
  6552. CALL R.SSF
  6553. LD A,8 SELECT GIN MODE
  6554. LD (MODE),A
  6555. LD HL,(G.XREG) GET GIN CURSOR POS.
  6556. CALL R.OUTX
  6557. LD HL,(G.YREG)
  6558. CALL R.OUTY
  6559. RET
  6560. EJECT
  6561. VECTNORM EQU *
  6562. LD HL,DASH
  6563. LD (HL),0
  6564. RET
  6565.  
  6566. VECTDOT EQU *
  6567. LD HL,DASH
  6568. LD (HL),1
  6569. LD HL,VECTAB
  6570. LD A,(HL)
  6571. LD (WSEGLEN),A
  6572. INC HL
  6573. LD A,(HL)
  6574. LD (ESEGLEN),A
  6575. RET
  6576.  
  6577. VECTSDSH EQU *
  6578. LD HL,DASH
  6579. LD (HL),1
  6580. LD HL,VECTAB+2
  6581. LD A,(HL)
  6582. LD (WSEGLEN),A
  6583. INC HL
  6584. LD A,(HL)
  6585. LD (ESEGLEN),A
  6586. RET
  6587.  
  6588. VECTLDSH EQU *
  6589. LD HL,DASH
  6590. LD (HL),1
  6591. LD HL,VECTAB+4
  6592. LD A,(HL)
  6593. LD (WSEGLEN),A
  6594. INC HL
  6595. LD A,(HL)
  6596. LD (ESEGLEN),A
  6597. RET
  6598.  
  6599. * MOVE CURSOR UP ONE CHARACTER LINE
  6600. AVT EQU *
  6601. CALL CUR.ERAS ERASE THE CURSOR
  6602. XOR A CLEAR BYPASS
  6603. LD (BYPASS),A
  6604.  
  6605. VT.1 EQU *
  6606. CALL R.INPY
  6607. LD A,(HEIGHT)
  6608. LD E,A
  6609. LD D,0
  6610. ADD HL,DE
  6611. LD A,(G.SIZE) IF SIZE 2, AUTO WRAP
  6612. OR A
  6613. JR NZ,VT.2
  6614. LD A,H SIZE 1, CHECK FOR PAGE TOP
  6615. CP 2 IF Y DOES NOT EXCEED 512,
  6616. JR C,VT.2 THEN DO A SIMPLE VT
  6617. LD HL,(PAGEND) OTHERWISE WRAP TO PAGE END
  6618. LD A,(HEIGHT) PAGEND MINUS HEIGHT
  6619. CPL
  6620. INC A
  6621. LD E,A
  6622. LD D,0FFH
  6623. ADD HL,DE
  6624.  
  6625. VT.2 EQU *
  6626. CALL R.OUTY
  6627. RET
  6628.  
  6629. *KERMIT, 401X DASHED VECTOR HERE
  6630. G.LINE1 EQU *
  6631. RET
  6632.  
  6633. VECTAB EQU *
  6634. HEX 03,03 DOTTED VECTOR COUNTS
  6635. HEX 08,03 SHORT DASHED VECTOR COUNTS
  6636. HEX 10,04 LONG DASHED VECTOR COUNTS
  6637. EJECT
  6638. **********
  6639. * ASCII ALPHA MODE EXECUTION
  6640. **********
  6641. ALPHMODE EQU *
  6642. LD A,C GET CHAR
  6643. CP 7FH
  6644. RET Z IGNORE IF RUBOUT
  6645. SUB 20H BIAS CHAR
  6646. LD C,A
  6647. CALL SCROLLCL CLEAR SCROLL FLAG
  6648. LD A,(M.MODE) PUT W/E BITS IN B REG.
  6649. LD B,A
  6650.  
  6651. **********
  6652. * ASCII MODE CHARACTER GENERATOR.
  6653. * ON ENTRY THE CHAR-20H IS IN THE C REG.
  6654. * AND DESIRED WRITE/ERASE BITS ARE IN THE B REG.
  6655. **********
  6656. ACHARGEN EQU *
  6657. PUSH BC TEMP SAVE CHAR AND W/E BITS
  6658. CALL CUR.ERAS ERASE THE CURSOR
  6659. POP BC GET SAVED CHAR AND W/E BITS
  6660. LD HL,(CHBASE) DISPLAY THE CHARACTER
  6661. CALL JMPHL CHGEN.S1 OR CHGEN.S2
  6662. CALL HTAB.1 MOVE TO NEXT CHAR POSITION
  6663. RET
  6664.  
  6665. CHGEN.S2 EQU * 8 BY 16 CHARS
  6666. EXX SET DATA MASK
  6667. LD L,00H
  6668. EXX
  6669. INC C GET CHAR+1
  6670. LD E,0
  6671. JR CHGENS1
  6672.  
  6673. CHGEN.S1 EQU * 6 BY 14 CHARS
  6674. EXX SET DATA MASK
  6675. LD L,0C0H
  6676. EXX
  6677. INC C GET CHAR+1
  6678. LD E,C
  6679.  
  6680. CHGENS1 EQU *
  6681. LD D,0
  6682. LD L,C SET IX TO BOTTOM OF CHAR DATA
  6683. LD H,D
  6684. ADD HL,HL
  6685. ADD HL,HL
  6686. ADD HL,HL
  6687. SBC HL,DE
  6688. ADD HL,HL
  6689. DEC HL
  6690. EX DE,HL
  6691. LD IX,(G.MEMSEL)
  6692. ADD IX,DE
  6693.  
  6694. LD A,B GET W/E BITS
  6695. EXX
  6696. LD C,00H SET UP XOR MASK
  6697. BIT 0,A CHECK WRITE/ERASE BIT
  6698. JR NZ,CHGENS1B
  6699. DEC C C = 0FFH
  6700.  
  6701. CHGENS1B EQU *
  6702. LD DE,0FFFFH
  6703. BIT 1,A CHECK OVERSTRIKE/NORMAL BIT
  6704. JR NZ,CHGENS1D
  6705.  
  6706. LD E,L NORMAL, SO PUT DATA MASK IN E
  6707. LD A,(BP) CHECK BIT POSITION
  6708. AND 07H
  6709. JR Z,CHGENS1D DONE IF 0
  6710.  
  6711. LD B,A POSITION DATA MASK
  6712. LD A,D
  6713. SCF
  6714. CHGENS1C RL E
  6715. RLA
  6716. DJNZ CHGENS1C
  6717. LD D,A
  6718.  
  6719. CHGENS1D EQU * FALL INTO CHARACTER GENERATOR
  6720. EXX
  6721. **********
  6722. * ASCII HORIZONTAL PLOT
  6723. **********
  6724. HPLOTA EQU *
  6725. LD HL,(DMAA)
  6726. LD DE,(DMA1)
  6727. LD A,(HEIGHT)
  6728. LD B,A
  6729. HPLOTA1 EQU *
  6730. LD A,(IX+0) GET CHAR DATA
  6731. EXX
  6732. LD L,A HL ';= CHAR DATA
  6733. LD H,00H
  6734. LD A,(BP) GET BIT POS
  6735. AND 07H
  6736. JR Z,HPLOTA3
  6737. LD B,A
  6738. HPLOTA2 EQU * POSITION CHAR DATA
  6739. ADD HL,HL
  6740. DJNZ HPLOTA2
  6741.  
  6742. HPLOTA3 EQU *
  6743. EXX
  6744. LD A,(HL) MODIFY LEFT PART OF CHAR
  6745. EXX
  6746. XOR C
  6747. AND E
  6748. OR L
  6749. XOR C
  6750. EXX
  6751. LD (HL),A
  6752. LD A,(DE) MODIFY RIGHT PART OF CHAR
  6753. EXX
  6754. XOR C
  6755. AND D
  6756. OR H
  6757. XOR C
  6758. EXX
  6759. LD (DE),A
  6760. DEC DE UPDATE POINTERS
  6761. DEC HL
  6762. DEC IX
  6763. DEC B
  6764. RET Z EXIT IF ALL LINES DISPLAYED
  6765. LD A,L LOOP IF L NOT 0FFH
  6766. INC A
  6767. JR NZ,HPLOTA1
  6768. BIT 0,H LOOP IF H IS EVEN
  6769. JR Z,HPLOTA1
  6770. INC H COLUMN OVERFLOW
  6771. INC H
  6772. SET 7,H
  6773. INC D
  6774. INC D
  6775. SET 7,D
  6776. JR HPLOTA1
  6777. EJECT
  6778. EJECT
  6779. * * * * * * * * * * * * * * * * * * * *
  6780. *
  6781. * GIN MODE CURSOR POSITIONING VIA TOUCH PANEL
  6782. *
  6783. * * * * * * * * * * * * * * * * * * * *
  6784. GIN.TP EQU *
  6785. PUSH DE SAVE TP DATA ON STACK
  6786. CALL CUR.ERAS ERASE CURSOR
  6787. POP DE RESTORE DATA
  6788. PUSH DE SAVE DATA AGAIN
  6789. CALL GIN.TP1 GET Y COORD
  6790. CALL R.OUTY
  6791. POP DE DATA IN DE ONCE AGAIN
  6792. LD A,E
  6793. RRCA
  6794. RRCA
  6795. RRCA
  6796. RRCA
  6797. LD E,A
  6798. CALL GIN.TP1 GET X COORD
  6799. CALL R.OUTX
  6800. RET
  6801. *
  6802. GIN.TP1 EQU *
  6803. LD A,0FH MASK WITH LOWER 4 BITS
  6804. AND E
  6805. LD L,A
  6806. LD H,00 HL = TP VALUE * 32
  6807. ADD HL,HL
  6808. ADD HL,HL
  6809. ADD HL,HL
  6810. ADD HL,HL
  6811. ADD HL,HL
  6812. LD DE,14 ADD 14 (BIAS TO SQAURE CENTER)
  6813. ADD HL,DE
  6814. RET
  6815.  
  6816. * * * * * * * * * * * * * * * * * * * *
  6817. *
  6818. * GIN MODE CURSOR POSITIONING VIA KEYBOARD
  6819. * AND GIN MODE TRANSMISSION
  6820. *
  6821. * * * * * * * * * * * * * * * * * * * *
  6822. GIN.KB EQU *
  6823. LD A,C IS CHAR A CR
  6824. CP 0DH
  6825. JR Z,GIN.XMT SEND LAST KEY IF YES
  6826.  
  6827. GIN.1 EQU *
  6828. LD A,C SAVE GIN CHAR KEY
  6829. LD (GIN.KEY),A
  6830. LD HL,1 ASSUME FINE GRID
  6831. BIT 5,A LOOK AT BIT 5
  6832. JR NZ,GIN.2 FINE GRID IF SET
  6833. ADD HL,HL COARSE GRID IF CLEAR
  6834. ADD HL,HL
  6835. GIN.2 LD (DOTS),HL SAVE GRID MOVEMENT VALUE
  6836. LD A,C GET SAVED CHAR CODE
  6837. AND 0DFH CLEAR BIT 5
  6838. LD B,A AND SAVE IN B REG
  6839. LD HL,MOVTAB SEARCH CURSOR MOVE TABLE
  6840. GIN.3 EQU * FOR THE CHAR
  6841. LD A,(HL)
  6842. CP 0FFH
  6843. JR Z,GIN.XMT JUMP IF NOT A CURSOR MOVE KEY
  6844. CP B CHECK FOR MATCH
  6845. JR Z,MOVCURS JUMP IF MATCH
  6846. INC HL UPDATE TO NEXT TABLE ENTRY
  6847. INC HL
  6848. INC HL
  6849. JR GIN.3
  6850.  
  6851. MOVCURS EQU *
  6852. INC HL MATCH FOUND
  6853. LD E,(HL) JUMP TO CURSOR MOVE ROUTINE
  6854. INC HL
  6855. LD D,(HL)
  6856. PUSH DE TEMP SAVE ADDRESS
  6857. CALL CUR.ERAS ERASE THE CURSOR
  6858. POP HL THEN GET SAVED ADDRESS
  6859. CALL JMPHL AND DO THE JUMP
  6860. RET
  6861.  
  6862. GIN.XMT EQU *
  6863. LD A,(GIN.KEY) SEND LAST KEY STORED
  6864. LD C,A
  6865. CALL XMIT.1A
  6866. CALL ENQ.1 SEND CURSOR POSITION
  6867. RET
  6868.  
  6869. MOVTAB EQU * TABLE OF CURSOR MOVE KEYS
  6870. DEFB 41H UC A
  6871. DEFW WEST
  6872. DEFB 43H UC C
  6873. DEFW SEAST
  6874. DEFB 44H UC D
  6875. DEFW EAST
  6876. DEFB 45H UC E
  6877. DEFW NEAST
  6878. DEFB 51H UC Q
  6879. DEFW NWEST
  6880. DEFB 57H UC W
  6881. DEFW NORTH
  6882. DEFB 58H UC X
  6883. DEFW SOUTH
  6884. DEFB 5AH UC Z
  6885. DEFW SWEST
  6886. DEFB 0FFH END OF TABLE
  6887.  
  6888. SEAST EQU *
  6889. CALL SOUTH
  6890.  
  6891. EAST EQU *
  6892. CALL R.INPX
  6893. LD DE,(DOTS)
  6894. ADD HL,DE
  6895. CALL R.OUTX
  6896. RET
  6897.  
  6898. NEAST EQU *
  6899. CALL EAST
  6900.  
  6901. NORTH EQU *
  6902. CALL R.INPY
  6903. LD DE,(DOTS)
  6904. ADD HL,DE
  6905. CALL R.OUTY
  6906. RET
  6907.  
  6908. NWEST EQU *
  6909. CALL NORTH
  6910.  
  6911. WEST EQU *
  6912. CALL R.INPX
  6913. LD DE,(DOTS)
  6914. OR A
  6915. SBC HL,DE
  6916. CALL R.OUTX
  6917. RET
  6918.  
  6919. SWEST EQU *
  6920. CALL WEST
  6921.  
  6922. SOUTH EQU *
  6923. CALL R.INPY
  6924. LD DE,(DOTS)
  6925. OR A
  6926. SBC HL,DE
  6927. CALL R.OUTY
  6928. RET
  6929. * EJECT
  6930. ** SELECT OR DESELECT STATUS LINE DISPLAY MODE
  6931. *G.HELP EQU *
  6932. * LD A,(MODE) IGNORE IF GIN MODE
  6933. * CP 8
  6934. * RET Z
  6935. *
  6936. * LD HL,STATLINE
  6937. * LD A,(HL) TOGGLE STATUS LINE FLAG
  6938. * XOR 20H
  6939. * LD (HL),A
  6940. * LD B,A
  6941. * LD H,04H ENABLE OR DISABLE TOUCH PANEL
  6942. * LD A,(M.ENAB)
  6943. * RES 5,A
  6944. * OR B
  6945. * LD L,A
  6946. * CALL R.SSF
  6947. *
  6948. * LD A,(STATLINE) IF STATUS LINE SELECTED
  6949. * OR A
  6950. * JR NZ,DSTAT THEN DISPLAY IT
  6951. *
  6952. ** CLEAR STATUS LINE
  6953. ** CLEARS FROM Y=14 THROUGH Y=27 ACROSS ENTIRE SCREEN
  6954. *STAT.ERS EQU *
  6955. * LD H,80H
  6956. *STAT.ER1 EQU *
  6957. * INC H
  6958. * LD D,H
  6959. * LD L,0E4H
  6960. * LD E,0E5H
  6961. * LD BC,13
  6962. * LD (HL),0
  6963. * LDIR
  6964. * INC H
  6965. * JR NZ,STAT.ER1
  6966. * RET
  6967. *
  6968. ** INTERPRET WHAT TO DO WITH TOUCH PANEL DATA
  6969. *TOUCH EQU *
  6970. * LD A,(MODE) ARE WE IN GIN MODE
  6971. * CP 8
  6972. * JP Z,GIN.TP YES, HANDLE AS GIN INPUT
  6973. *
  6974. ** UPDATE STATUS LINE DISPLAY VIA THE TOUCH PANEL.
  6975. ** ON ENTRY E7-E4 IS X COORD AND E3-E0 IS Y COORD.
  6976. *STAT.UP EQU *
  6977. * LD A,E SET BC=X COORD DIV 2
  6978. * RLCA
  6979. * RLCA
  6980. * RLCA
  6981. * AND 7
  6982. * CP 4 IGNORE TOUCH IF X TOO LARGE
  6983. * RET NC
  6984. * LD C,A
  6985. * LD B,0
  6986. * ADD A,C SET DE=3*(X COORD DIV 2)
  6987. * ADD A,C
  6988. * LD E,A
  6989. * LD D,B
  6990. * LD HL,STATTBL+2 FIND THE FIELD TO CHANGE
  6991. * ADD HL,DE
  6992. * LD A,(HL) GET NO. OF FIELD VALUES
  6993. * LD HL,STATUS
  6994. * ADD HL,BC
  6995. * INC (HL) INCR SELECTED FIELD VALUE
  6996. * SUB (HL)
  6997. * JR NZ,DSTAT
  6998. * LD (HL),A RESET IF OVERFLOW
  6999. *
  7000. ** DISPLAY THE CURRENT VALUES ON THE STATUS LINE
  7001. *DSTAT EQU *
  7002. * CALL CUR.ERAS ERASE THE CURSOR
  7003. * CALL R.INPX SAVE XY AND SET TO
  7004. * LD (G.XREG),HL STATUS LINE VALUES
  7005. * CALL R.INPY
  7006. * LD (G.YREG),HL
  7007. * LD HL,6
  7008. * CALL R.OUTX
  7009. * LD HL,14
  7010. * CALL R.OUTY
  7011. * CALL STAT.ERS ERASE STATUS LINE
  7012. * LD HL,STATUS
  7013. * PUSH HL
  7014. * LD C,4
  7015. * LD HL,STATTBL
  7016. *DSTAT1 EQU *
  7017. * LD E,(HL) FIND THE CURRENT FIELD INFO
  7018. * INC HL
  7019. * LD D,(HL) DE=ADDRESS OF MESSAGE
  7020. * INC HL
  7021. * INC HL
  7022. * EX (SP),HL
  7023. * LD B,(HL) B=CURRENT FIELD FLAG VALUE
  7024. * INC HL
  7025. * EX (SP),HL
  7026. * INC B
  7027. * JR DSTAT3
  7028. *
  7029. *DSTAT2 EQU *
  7030. * LD A,(DE)
  7031. * INC DE
  7032. * OR A
  7033. * JR NZ,DSTAT2
  7034. *
  7035. *DSTAT3 EQU *
  7036. * DJNZ DSTAT2
  7037. *
  7038. *DSTAT4 EQU *
  7039. * LD A,(DE) GET FIRST CHAR OF THE FIELD
  7040. * PUSH BC NOW DISPLAY THE WORD
  7041. * PUSH HL
  7042. *
  7043. *DSTAT5 EQU *
  7044. * LD C,A CHAR TO C
  7045. * LD B,1 SET W/E BITS IN B FOR REWRITE
  7046. * PUSH DE
  7047. * CALL ACHARGEN DISPLAY THE CHAR
  7048. * POP DE
  7049. * INC DE
  7050. * LD A,(DE)
  7051. * OR A
  7052. * JR NZ,DSTAT5
  7053. *
  7054. *DSTAT6 EQU *
  7055. * CALL R.INPX ADVANCE TO THE NEXT FIELD
  7056. *DSTAT7 EQU *
  7057. * INC HL
  7058. * LD A,L
  7059. * AND 3FH
  7060. * CP 6
  7061. * JR NZ,DSTAT7
  7062. * CALL R.OUTX
  7063. *
  7064. * POP HL
  7065. * POP BC
  7066. * DEC C
  7067. * JR NZ,DSTAT1
  7068. *
  7069. * POP HL JUNK STATUS POINTER
  7070. * LD HL,(G.XREG) RETURN SAVED X AND Y POS.
  7071. * CALL R.OUTX
  7072. * LD HL,(G.YREG)
  7073. * CALL R.OUTY
  7074. * RET
  7075. *
  7076. ** DATA FOR STATUS LINE FIELDS
  7077. *STATTBL EQU *
  7078. * DEFW LNLOCMSG
  7079. * DEFB 2
  7080. * DEFW BAUDMSG
  7081. * DEFB 2
  7082. * DEFW SCALEMSG
  7083. * DEFB 2
  7084. * DEFW CAPSMSG
  7085. * DEFB 2
  7086. *
  7087. *LNLOCMSG EQU *
  7088. * HEX 2C,29,2E,25,00 LINE
  7089. * HEX 2C,2F,23,21,2C,00 LOCAL
  7090. *BAUDMSG EQU *
  7091. * HEX 11,12,10,10,00 1200
  7092. * HEX 13,10,10,00 300
  7093. *SCALEMSG EQU *
  7094. * HEX 33,23,21,2C,25,00 SCALE
  7095. * HEX 35,2E,33,23,21,2C,25,00 UNSCALE
  7096. *CAPSMSG EQU *
  7097. * HEX 23,21,30,33,00 CAPS
  7098. * HEX 21,2C,2C,00 ALL
  7099. EJECT
  7100. * SMALL SIZE 6 BY 14 CHARACTERS
  7101. *
  7102. A0CODE00 EQU * SPACE
  7103. HEX 00,00,00,00
  7104. HEX 00,00,00,00
  7105. HEX 00,00,00,00
  7106. HEX 00,00
  7107. A0CODE01 EQU * EXCLAMATION MARK
  7108. HEX 00,00,04,04
  7109. HEX 04,04,04,04
  7110. HEX 00,00,04,00
  7111. HEX 00,00
  7112. A0CODE02 EQU * DOUBLE QUOTES
  7113. HEX 00,00,0A,0A
  7114. HEX 0A,00,00,00
  7115. HEX 00,00,00,00
  7116. HEX 00,00
  7117. A0CODE03 EQU * NUMBER SIGN
  7118. HEX 00,00,0A,0A
  7119. HEX 1F,0A,1F,0A
  7120. HEX 0A,00,00,00
  7121. HEX 00,00
  7122. A0CODE04 EQU * DOLLAR SIGN
  7123. HEX 00,00,04,0E
  7124. HEX 15,05,0E,14
  7125. HEX 15,0E,04,00
  7126. HEX 00,00
  7127. A0CODE05 EQU * PERCENT SIGN
  7128. HEX 00,00,00,00
  7129. HEX 03,13,08,04
  7130. HEX 02,19,18,00
  7131. HEX 00,00
  7132. A0CODE06 EQU * AMPERSAND
  7133. HEX 00,00,04,0A
  7134. HEX 0A,04,16,09
  7135. HEX 09,09,16,00
  7136. HEX 00,00
  7137. A0CODE07 EQU * SINGLE QUOTE
  7138. HEX 00,00,08,04
  7139. HEX 00,00,00,00
  7140. HEX 00,00,00,00
  7141. HEX 00,00
  7142. A0CODE08 EQU * LEFT PAREN
  7143. HEX 00,00,10,08
  7144. HEX 04,04,04,04
  7145. HEX 04,04,08,10
  7146. HEX 00,00
  7147. A0CODE09 EQU * RIGHT PAREN
  7148. HEX 00,00,01,02
  7149. HEX 04,04,04,04
  7150. HEX 04,04,02,01
  7151. HEX 00,00
  7152. A0CODE0A EQU * ASTERISK
  7153. HEX 00,00,00,00
  7154. HEX 04,15,0A,0A
  7155. HEX 15,04,00,00
  7156. HEX 00,00
  7157. A0CODE0B EQU * PLUS
  7158. HEX 00,00,00,00
  7159. HEX 00,04,04,1F
  7160. HEX 04,04,00,00
  7161. HEX 00,00
  7162. A0CODE0C EQU * COMMA
  7163. HEX 00,00,00,00
  7164. HEX 00,00,00,00
  7165. HEX 00,06,06,04
  7166. HEX 02,00
  7167. A0CODE0D EQU * MINUS
  7168. HEX 00,00,00,00
  7169. HEX 00,00,00,1F
  7170. HEX 00,00,00,00
  7171. HEX 00,00
  7172. A0CODE0E EQU * PERIOD
  7173. HEX 00,00,00,00
  7174. HEX 00,00,00,00
  7175. HEX 00,06,06,00
  7176. HEX 00,00
  7177. A0CODE0F EQU * SLASH
  7178. HEX 00,00,00,00
  7179. HEX 00,10,08,04
  7180. HEX 02,01,00,00
  7181. HEX 00,00
  7182. A0CODE10 EQU * NUMERAL ZERO
  7183. HEX 00,00,00,0E
  7184. HEX 11,11,19,15
  7185. HEX 13,11,0E,00
  7186. HEX 00,00
  7187. A0CODE11 EQU * NUMERAL ONE
  7188. HEX 00,00,00,04
  7189. HEX 06,04,04,04
  7190. HEX 04,04,0E,00
  7191. HEX 00,00
  7192. A0CODE12 EQU * NUMERAL TWO
  7193. HEX 00,00,00,0E
  7194. HEX 11,10,08,04
  7195. HEX 02,01,1F,00
  7196. HEX 00,00
  7197. A0CODE13 EQU * NUMERAL THREE
  7198. HEX 00,00,00,0E
  7199. HEX 11,10,0C,10
  7200. HEX 10,11,0E,00
  7201. HEX 00,00
  7202. A0CODE14 EQU * NUMERAL FOUR
  7203. HEX 00,00,00,10
  7204. HEX 18,14,12,1F
  7205. HEX 10,10,10,00
  7206. HEX 00,00
  7207. A0CODE15 EQU * NUMERAL FIVE
  7208. HEX 00,00,00,1F
  7209. HEX 01,01,0F,10
  7210. HEX 10,10,0F,00
  7211. HEX 00,00
  7212. A0CODE16 EQU * NUMERAL SIX
  7213. HEX 00,00,00,0C
  7214. HEX 02,01,0F,11
  7215. HEX 11,11,0E,00
  7216. HEX 00,00
  7217. A0CODE17 EQU * NUMERAL SEVEN
  7218. HEX 00,00,00,1F
  7219. HEX 10,08,08,04
  7220. HEX 04,02,02,00
  7221. HEX 00,00
  7222. A0CODE18 EQU * NUMERAL EIGHT
  7223. HEX 00,00,00,0E
  7224. HEX 11,11,0E,11
  7225. HEX 11,11,0E,00
  7226. HEX 00,00
  7227. A0CODE19 EQU * NUMERAL NINE
  7228. HEX 00,00,00,0E
  7229. HEX 11,11,11,1E
  7230. HEX 10,08,06,00
  7231. HEX 00,00
  7232. A0CODE1A EQU * COLON
  7233. HEX 00,00,00,00
  7234. HEX 00,06,06,00
  7235. HEX 00,06,06,00
  7236. HEX 00,00
  7237. A0CODE1B EQU * SEMICOLON
  7238. HEX 00,00,00,00
  7239. HEX 00,06,06,00
  7240. HEX 00,06,06,02
  7241. HEX 01,00
  7242. A0CODE1C EQU * LESS THAN
  7243. HEX 00,00,00,00
  7244. HEX 08,04,02,01
  7245. HEX 02,04,08,00
  7246. HEX 00,00
  7247. A0CODE1D EQU * EQUALS
  7248. HEX 00,00,00,00
  7249. HEX 00,00,1F,00
  7250. HEX 1F,00,00,00
  7251. HEX 00,00
  7252. A0CODE1E EQU * GREATER THAN
  7253. HEX 00,00,00,00
  7254. HEX 02,04,08,10
  7255. HEX 08,04,02,00
  7256. HEX 00,00
  7257. A0CODE1F EQU * QUESTION MARK
  7258. HEX 00,00,0E,11
  7259. HEX 11,08,04,04
  7260. HEX 04,00,04,00
  7261. HEX 00,00
  7262. A0CODE20 EQU * COMMERCIAL AT
  7263. HEX 00,00,00,00
  7264. HEX 00,0E,11,1D
  7265. HEX 1D,09,02,1C
  7266. HEX 00,00
  7267. A0CODE21 EQU * UPPER CASE A
  7268. HEX 00,00,04,0A
  7269. HEX 11,11,1F,11
  7270. HEX 11,11,11,00
  7271. HEX 00,00
  7272. A0CODE22 EQU * UPPER CASE B
  7273. HEX 00,00,0F,11
  7274. HEX 11,0F,11,11
  7275. HEX 11,11,0F,00
  7276. HEX 00,00
  7277. A0CODE23 EQU * UPPER CASE C
  7278. HEX 00,00,0E,11
  7279. HEX 01,01,01,01
  7280. HEX 01,11,0E,00
  7281. HEX 00,00
  7282. A0CODE24 EQU * UPPER CASE D
  7283. HEX 00,00,07,09
  7284. HEX 11,11,11,11
  7285. HEX 11,09,07,00
  7286. HEX 00,00
  7287. A0CODE25 EQU * UPPER CASE E
  7288. HEX 00,00,1F,01
  7289. HEX 01,01,0F,01
  7290. HEX 01,01,1F,00
  7291. HEX 00,00
  7292. A0CODE26 EQU * UPPER CASE F
  7293. HEX 00,00,1F,01
  7294. HEX 01,01,0F,01
  7295. HEX 01,01,01,00
  7296. HEX 00,00
  7297. A0CODE27 EQU * UPPER CASE G
  7298. HEX 00,00,0E,11
  7299. HEX 11,01,01,1D
  7300. HEX 11,11,0E,00
  7301. HEX 00,00
  7302. A0CODE28 EQU * UPPER CASE H
  7303. HEX 00,00,11,11
  7304. HEX 11,11,1F,11
  7305. HEX 11,11,11,00
  7306. HEX 00,00
  7307. A0CODE29 EQU * UPPER CASE I
  7308. HEX 00,00,1F,04
  7309. HEX 04,04,04,04
  7310. HEX 04,04,1F,00
  7311. HEX 00,00
  7312. A0CODE2A EQU * UPPER CASE J
  7313. HEX 00,00,1C,08
  7314. HEX 08,08,08,08
  7315. HEX 08,09,06,00
  7316. HEX 00,00
  7317. A0CODE2B EQU * UPPER CASE K
  7318. HEX 00,00,11,11
  7319. HEX 09,05,03,03
  7320. HEX 05,09,11,00
  7321. HEX 00,00
  7322. A0CODE2C EQU * UPPER CASE L
  7323. HEX 00,00,01,01
  7324. HEX 01,01,01,01
  7325. HEX 01,01,1F,00
  7326. HEX 00,00
  7327. A0CODE2D EQU * UPPER CASE M
  7328. HEX 00,00,11,1B
  7329. HEX 15,11,11,11
  7330. HEX 11,11,11,00
  7331. HEX 00,00
  7332. A0CODE2E EQU * UPPER CASE N
  7333. HEX 00,00,11,13
  7334. HEX 13,15,15,19
  7335. HEX 19,19,11,00
  7336. HEX 00,00
  7337. A0CODE2F EQU * UPPER CASE O
  7338. HEX 00,00,0E,11
  7339. HEX 11,11,11,11
  7340. HEX 11,11,0E,00
  7341. HEX 00,00
  7342. A0CODE30 EQU * UPPER CASE P
  7343. HEX 00,00,0F,11
  7344. HEX 11,11,0F,01
  7345. HEX 01,01,01,00
  7346. HEX 00,00
  7347. A0CODE31 EQU * UPPER CASE Q
  7348. HEX 00,00,0E,11
  7349. HEX 11,11,11,11
  7350. HEX 11,11,0E,08
  7351. HEX 10,00
  7352. A0CODE32 EQU * UPPER CASE R
  7353. HEX 00,00,0F,11
  7354. HEX 11,11,0F,03
  7355. HEX 05,09,11,00
  7356. HEX 00,00
  7357. A0CODE33 EQU * UPPER CASE S
  7358. HEX 00,00,0E,11
  7359. HEX 01,01,0E,10
  7360. HEX 10,11,0E,00
  7361. HEX 00,00
  7362. A0CODE34 EQU * UPPER CASE T
  7363. HEX 00,00,1F,04
  7364. HEX 04,04,04,04
  7365. HEX 04,04,04,00
  7366. HEX 00,00
  7367. A0CODE35 EQU * UPPER CASE U
  7368. HEX 00,00,11,11
  7369. HEX 11,11,11,11
  7370. HEX 11,11,0E,00
  7371. HEX 00,00
  7372. A0CODE36 EQU * UPPER CASE V
  7373. HEX 00,00,11,11
  7374. HEX 11,11,0A,0A
  7375. HEX 0A,04,04,00
  7376. HEX 00,00
  7377. A0CODE37 EQU * UPPER CASE W
  7378. HEX 00,00,11,11
  7379. HEX 11,11,11,11
  7380. HEX 15,1B,11,00
  7381. HEX 00,00
  7382. A0CODE38 EQU * UPPER CASE X
  7383. HEX 00,00,11,11
  7384. HEX 0A,04,04,0A
  7385. HEX 0A,11,11,00
  7386. HEX 00,00
  7387. A0CODE39 EQU * UPPER CASE Y
  7388. HEX 00,00,11,11
  7389. HEX 11,0E,04,04
  7390. HEX 04,04,04,00
  7391. HEX 00,00
  7392. A0CODE3A EQU * UPPER CASE Z
  7393. HEX 00,00,1F,11
  7394. HEX 10,08,04,02
  7395. HEX 01,11,1F,00
  7396. HEX 00,00
  7397. A0CODE3B EQU * LEFT BRACKET
  7398. HEX 00,00,1C,04
  7399. HEX 04,04,04,04
  7400. HEX 04,04,04,1C
  7401. HEX 00,00
  7402. A0CODE3C EQU * REVERSE SLASH
  7403. HEX 00,00,00,00
  7404. HEX 00,01,02,04
  7405. HEX 08,10,00,00
  7406. HEX 00,00
  7407. A0CODE3D EQU * RIGHT BRACKET
  7408. HEX 00,00,07,04
  7409. HEX 04,04,04,04
  7410. HEX 04,04,04,07
  7411. HEX 00,00
  7412. A0CODE3E EQU * HAT
  7413. HEX 00,00,00,04
  7414. HEX 0A,11,00,00
  7415. HEX 00,00,00,00
  7416. HEX 00,00
  7417. A0CODE3F EQU * UNDERLINE
  7418. HEX 00,00,00,00
  7419. HEX 00,00,00,00
  7420. HEX 00,00,00,00
  7421. HEX 1F,00
  7422. A0CODE40 EQU * SMALL REVERSE SLASH
  7423. HEX 00,00,04,08
  7424. HEX 00,00,00,00
  7425. HEX 00,00,00,00
  7426. HEX 00,00
  7427. A0CODE41 EQU * LOWER CASE A
  7428. HEX 00,00,00,00
  7429. HEX 00,0E,10,1E
  7430. HEX 11,11,1E,00
  7431. HEX 00,00
  7432. A0CODE42 EQU * LOWER CASE B
  7433. HEX 00,00,01,01
  7434. HEX 01,0D,13,11
  7435. HEX 11,13,0D,00
  7436. HEX 00,00
  7437. A0CODE43 EQU * LOWER CASE C
  7438. HEX 00,00,00,00
  7439. HEX 00,0E,11,01
  7440. HEX 01,11,0E,00
  7441. HEX 00,00
  7442. A0CODE44 EQU * LOWER CASE D
  7443. HEX 00,00,10,10
  7444. HEX 10,1E,11,11
  7445. HEX 11,11,1E,00
  7446. HEX 00,00
  7447. A0CODE45 EQU * LOWER CASE E
  7448. HEX 00,00,00,00
  7449. HEX 00,0E,11,1F
  7450. HEX 01,01,1E,00
  7451. HEX 00,00
  7452. A0CODE46 EQU * LOWER CASE F
  7453. HEX 00,00,0C,12
  7454. HEX 02,07,02,02
  7455. HEX 02,02,07,00
  7456. HEX 00,00
  7457. A0CODE47 EQU * LOWER CASE G
  7458. HEX 00,00,00,00
  7459. HEX 10,0E,11,11
  7460. HEX 0E,01,0E,11
  7461. HEX 0E,00
  7462. A0CODE48 EQU * LOWER CASE H
  7463. HEX 00,00,01,01
  7464. HEX 01,0D,13,11
  7465. HEX 11,11,11,00
  7466. HEX 00,00
  7467. A0CODE49 EQU * LOWER CASE I
  7468. HEX 00,00,04,00
  7469. HEX 00,06,04,04
  7470. HEX 04,04,0E,00
  7471. HEX 00,00
  7472. A0CODE4A EQU * LOWER CASE J
  7473. HEX 00,00,04,00
  7474. HEX 00,06,04,04
  7475. HEX 04,04,04,04
  7476. HEX 03,00
  7477. A0CODE4B EQU * LOWER CASE K
  7478. HEX 00,00,01,01
  7479. HEX 01,11,09,07
  7480. HEX 05,09,11,00
  7481. HEX 00,00
  7482. A0CODE4C EQU * LOWER CASE L
  7483. HEX 00,00,06,04
  7484. HEX 04,04,04,04
  7485. HEX 04,04,0E,00
  7486. HEX 00,00
  7487. A0CODE4D EQU * LOWER CASE M
  7488. HEX 00,00,00,00
  7489. HEX 00,1B,15,15
  7490. HEX 15,15,15,00
  7491. HEX 00,00
  7492. A0CODE4E EQU * LOWER CASE N
  7493. HEX 00,00,00,00
  7494. HEX 00,0D,13,11
  7495. HEX 11,11,11,00
  7496. HEX 00,00
  7497. A0CODE4F EQU * LOWER CASE O
  7498. HEX 00,00,00,00
  7499. HEX 00,0E,11,11
  7500. HEX 11,11,0E,00
  7501. HEX 00,00
  7502. A0CODE50 EQU * LOWER CASE P
  7503. HEX 00,00,00,00
  7504. HEX 00,0F,11,11
  7505. HEX 11,11,0F,01
  7506. HEX 01,01
  7507. A0CODE51 EQU * LOWER CASE Q
  7508. HEX 00,00,00,00
  7509. HEX 00,1E,11,11
  7510. HEX 11,11,1E,10
  7511. HEX 10,10
  7512. A0CODE52 EQU * LOWER CASE R
  7513. HEX 00,00,00,00
  7514. HEX 00,0D,13,01
  7515. HEX 01,01,01,00
  7516. HEX 00,00
  7517. A0CODE53 EQU * LOWER CASE S
  7518. HEX 00,00,00,00
  7519. HEX 00,1E,01,0E
  7520. HEX 10,11,0E,00
  7521. HEX 00,00
  7522. A0CODE54 EQU * LOWER CASE T
  7523. HEX 00,00,04,04
  7524. HEX 04,1F,04,04
  7525. HEX 04,04,18,00
  7526. HEX 00,00
  7527. A0CODE55 EQU * LOWER CASE U
  7528. HEX 00,00,00,00
  7529. HEX 00,11,11,11
  7530. HEX 11,11,0E,00
  7531. HEX 00,00
  7532. A0CODE56 EQU * LOWER CASE V
  7533. HEX 00,00,00,00
  7534. HEX 00,11,11,0A
  7535. HEX 0A,04,04,00
  7536. HEX 00,00
  7537. A0CODE57 EQU * LOWER CASE W
  7538. HEX 00,00,00,00
  7539. HEX 00,11,11,11
  7540. HEX 15,15,0A,00
  7541. HEX 00,00
  7542. A0CODE58 EQU * LOWER CASE X
  7543. HEX 00,00,00,00
  7544. HEX 00,11,0A,04
  7545. HEX 04,0A,11,00
  7546. HEX 00,00
  7547. A0CODE59 EQU * LOWER CASE Y
  7548. HEX 00,00,00,00
  7549. HEX 00,11,11,11
  7550. HEX 12,0C,08,04
  7551. HEX 02,01
  7552. A0CODE5A EQU * LOWER CASE Z
  7553. HEX 00,00,00,00
  7554. HEX 00,1F,11,08
  7555. HEX 04,12,1F,00
  7556. HEX 00,00
  7557. A0CODE5B EQU * LEFT BRACE
  7558. HEX 00,00,18,04
  7559. HEX 04,04,04,02
  7560. HEX 04,04,04,04
  7561. HEX 18,00
  7562. A0CODE5C EQU * ELONGATED COLON
  7563. HEX 00,00,06,06
  7564. HEX 06,06,00,06
  7565. HEX 06,06,06,00
  7566. HEX 00,00
  7567. A0CODE5D EQU * RIGHT BRACE
  7568. HEX 00,00,03,04
  7569. HEX 04,04,04,08
  7570. HEX 04,04,04,04
  7571. HEX 03,00
  7572. A0CODE5E EQU * APPROXIMATE
  7573. HEX 00,00,12,0D
  7574. HEX 00,00,00,00
  7575. HEX 00,00,00,00
  7576. HEX 00,00
  7577. A0CODE5F EQU * RUBOUT
  7578. HEX 00,00,00,1F
  7579. HEX 1F,1F,1F,1F
  7580. HEX 1F,1F,00,00
  7581. HEX 00,00
  7582. A0CODE60 EQU * UNDERLINE CURSOR
  7583. HEX 00,00,00,00
  7584. HEX 00,00,00,00
  7585. HEX 00,00,00,00
  7586. HEX 00,3F
  7587. A0CODE61 EQU * CROSSHAIR CURSOR
  7588. HEX 00,00,00,00
  7589. HEX 00,00,00,00
  7590. HEX 00,04,04,1F
  7591. HEX 04,04
  7592.  
  7593. LENGTH3 EQU *-FWA3 END OF THIRD CHECKSUM AREA
  7594.  
  7595. END
  7596. $EOF
plato/source/plaopl/aist2.txt ยท Last modified: 2023/08/05 18:54 by Site Administrator