User Tools

Site Tools


plato:source:plaopl:aist3

Table of Contents

AIST3

Table Of Contents

Source Code

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