Table of Contents

CPMASC

Table Of Contents

Source Code

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