User Tools

Site Tools


plato:source:plaopl:asc1ram

ASC1RAM

Table Of Contents

  • [00005] INTERACTIVE GRAPHICS

Source Code

ASC1RAM.txt
  1. ASC1RAM
  2. IDENT IGT,#4000
  3. CHIP
  4.  
  5. TITLE INTERACTIVE GRAPHICS
  6. ORG #4000
  7.  
  8. ********************
  9. *
  10. * EQUATE STATEMENTS
  11. *
  12. **************************************
  13. * PANEL SWITCHES
  14. RSF.PANL EQU #00
  15. PANLSWCH EQU #11 FOR BREADBOARD AND IST
  16. * INTERRUPT CONTROL
  17. COMCHAN EQU 1 CLA CHANNEL NUMBER
  18. COMCON EQU 2 CLA CONTROL FUNCTION
  19. COMSTA EQU 3 CLA STATUS FUNCTION
  20. * ASCII COMMUNICATIONS
  21. COMDATA EQU #E2 SERIAL CHANNEL DATA
  22. COMSTAT EQU #E3 SERIAL CHANNEL STATUS
  23. * TOUCH PANEL
  24. * KEYBOARD
  25. KEYCHAN EQU 2 KEYBOARD CHANNEL NUMBER
  26. KEYDAT EQU 2 KEYBOARD DATA
  27. KYBDCON EQU 0 KEYBOARD CONTROL FUNCTION
  28. * TOUCH PANEL
  29. TPCHAN EQU 3 TOUCH PANEL CHANNEL NUMBER
  30. TOUCHD EQU 0 TOUCH PANEL DATA
  31. TPCONT EQU 0 TOUCH PANEL CONTROL
  32. TOUCHS EQU 1 TOUCH PANEL STATUS
  33. TPDIS EQU 0 DISABLE TOUCH PANEL INTERRUPT
  34. TPEN EQU 1 ENABLE TOUCH PANEL INTERRUPT
  35. * VIDEO DISPLAY
  36. * VIDEO DISPLAY
  37. DISCHAN EQU 4 DISPLAY CHANNEL NUMBER
  38. DISDATA EQU 3 DISPLAY DATA
  39. DISCON1 EQU 6 DISPLAY CONTROL 1 FUNCTION
  40. DISCON2 EQU 7 DISPLAY CONTROL 2 FUNCTION
  41. YCOORD EQU 5 DISPLAY Y COORDINATE DATA
  42. XCOORD EQU 4 DISPLAY X COORDINATE DATA
  43. XYREAD EQU 2 DISPLAY READ XY BIT 9 FUNCTION
  44. YREAD EQU 1 DISPLAY READ Y REGISTER FUNCTION
  45. XREAD EQU 0 DISPLAY X REGISTER FUNCTION
  46. * EXTERNAL DEVICES
  47. IDCHAN EQU 5 ID CODE CHANNEL
  48. EXTCH5 EQU 5 EXTERNAL CHANNEL 5
  49. EXTCH6 EQU 6 EXTERNAL CHANNEL 6
  50. EXTCH7 EQU 7 EXTERNAL CHANNEL 7
  51. EXTDATA EQU 0 INPUT/OUTPUT DATA FUNCTION
  52. EXTCNTL EQU 1 EXTERNAL CONTROL OUTPUT FUNCTION
  53. EXTSTAT EQU 3 EXTERNAL IN STATUS
  54. IDLSBS EQU 0 INPUT LOWER BITS OF ID CODE.
  55. IDMSBS EQU 1 INPUT UPPER BITS OF ID CODE.
  56. SLDATA0 EQU 0 OUTPUT LOWER BITS OF SLIDE DATA.
  57. SLDATA1 EQU 1 OUTPUT UPPER BITS OF SLIDE DATA.
  58. OPCHAN EQU 0 OPERATORS PANEL CHANNEL NUMBER
  59. OPDATA EQU 0 OPERATORS PANEL OUTPUT DATA
  60. ***********************
  61. M.SBTYPE EQU #22E6
  62. M.CONFIG EQU #22E7
  63. M.M0 EQU #22E8
  64. M.VERS EQU #22EA
  65. M.TYPE EQU #22EB
  66. M.CLOCK EQU #22EC
  67. M.EXTPA EQU #22EE
  68. M.MARGIN EQU #22F0
  69. M.JOBS EQU #22F2
  70. M.CCR EQU #22F4
  71. M.MODE EQU #22F6
  72. M.DIR EQU #22F8
  73. M.KSW EQU #22FA
  74. M.ENAB EQU #22FC
  75. M.SELECT EQU #22FE
  76. *
  77. M0ADR EQU #0096 LOCATION OF M0 CHAR. SET ADR.
  78. M1ADR EQU #0098 LOCATION OF M1 CHAR. SET ADR.
  79. MODE5A EQU #2300
  80. MODE6A EQU #2302
  81. MODE7A EQU #2304
  82. *
  83. MEM2 EQU #2306
  84. MEM3 EQU #2308
  85. MEM4 EQU #230A
  86. MEM5 EQU #230C
  87. MEM6 EQU #230E
  88. MEM7 EQU #2310
  89. *
  90. SUPER EQU #009A
  91. SUB EQU #009D
  92. SELECTM0 EQU #00A0
  93. SELECTM1 EQU #00A3
  94. SELECTMM EQU #00A6
  95. HORZ EQU #00A9
  96. VERTICAL EQU #00AC
  97. FORWARD EQU #00AF
  98. REVERSE EQU #00B2
  99. SIZE.1 EQU #00B5
  100. SIZE.2 EQU #00B8
  101. BKSPACE EQU #00BB
  102. RETURN EQU #00BE
  103. TAB EQU #00C1
  104. LINEFEED EQU #00C4
  105. VERTAB EQU #00C7
  106. FORMFEED EQU #00CA
  107. *
  108. D.CNTL2 EQU #2050
  109. SIZE EQU #2051
  110. FWD.REV EQU #2052
  111. HOR EQU #2053
  112. VER EQU #2054
  113. X.PLOT EQU #2055
  114. Y.PLOT EQU #2057
  115. CHAR.GEN EQU #2059
  116. XREG EQU #205B
  117. YREG EQU #205D
  118. XSAVE EQU #205F
  119. YSAVE EQU #2061
  120. MEMSEL EQU #2063
  121. M.ORG EQU #2065
  122. *
  123. *
  124. M.HALT EQU #2314
  125. M.STATUS EQU #2316
  126. MODE EQU #2318
  127. SC.OC EQU #2319
  128. *
  129. A.INIT JMP ASTART
  130. R.DOT JMP POINT2 PLOT POINT
  131. R.LINE JMP LINE1 DRAW LINE
  132. R.CHARS JMP #0049
  133. R.BLOCK JMP BLOCK BLOCK WRITE/ERASE
  134. R.INPX JMP INPX READ DISPLAY X COORD
  135. R.INPY JMP INPY READ DISPLAY Y COORD
  136. R.OUTX JMP #0055
  137. R.OUTY JMP #0058
  138. R.XMIT JMP XMIT TRANSMIT DATA TO HLP
  139. R.MODE JMP #005E
  140. R.STEPX JMP STEPX STEPS X AXIS COORD
  141. R.STEPY JMP STEPY STEPS Y AXIS COORD
  142. R.WE JMP POINT3 W/E CURRENT POSITION
  143. R.DIR JMP DIR SET DIRECTION OF XY STEP
  144. R.INPUT JMP INPUT DIRECTS DEVICE INPUT
  145. R.SSF JMP SSF.X SELECT SPECIAL FUNCTION
  146. R.CCR JMP #0073
  147. R.EXTOUT JMP RESTORE
  148. R.EXEC JMP EXEC
  149. R.GJOB JMP GJOB
  150. R.XJOB JMP PPROC
  151. R.RETURN JMP RESTORE RESTORE, ENABLE, RETURN
  152. JMP RESTORE EXPANSION
  153. SERINP JMP SERCHN
  154. KBINP JMP KEYINP
  155. TPIN JMP TOUCHINP
  156. R.INIT JMP PSTART PLATO INITIALIZE
  157. *
  158. *
  159. *
  160. *STRAP DB #E8 NO ECHO, 'FRYE/'PEDERSON
  161. STRAP DB #22 #22 300 BAUD;#62 1200 BAUD
  162. DB #38
  163. * * * * * * *@* * * * * *
  164. * SERIAL CHANNEL INTERRUPT PROCESSOR
  165. *
  166. SERCHN EQU $
  167. IN COMSTAT INPUT SERIAL CHAN. STATUS
  168. RAL AND TEST, IS CHAN. READY
  169. JC EXT.PR
  170. *
  171. RAR TEST FOR
  172. RAR INTERRUPT PENDING
  173. JNC EXT.PR
  174. *
  175. RAR
  176. RAR TEST FOR CHAR. RDY
  177. JNC SERCHN1 NOT CHARACTER READY
  178. * 'CHARACTER 'READY
  179. IN COMDATA INPUT SERIAL DATA
  180. MOV C,A
  181. LDA MODE
  182. ANI #80
  183. MVI A,#7F
  184. JNZ SERCHN0
  185. ANA C ASCII, MASK FOR 7 BITS
  186. MOV C,A
  187. SERCHN0 EQU $
  188. LXI H,RXBUF LOAD RECEIVE BUFFER ADDR.
  189. MVI A,#FF LOAD MASK FOR INDEX
  190. CMP M TEST FOR FULL STACK
  191. JZ R.RETURN BUFFER FULL
  192. INR M INCREMENT DIFFERENCE COUNT
  193. INX H STEP TO INPUT INDEX
  194. ANA M MASK FOR LOWER SIX BITS.
  195. INR M INCREMENT INDEX.
  196. INX H STEP TO START
  197. INX H OF STACK STORE AREA.
  198. MOV E,A ADD INDEX
  199. MVI D,00 TO START
  200. DAD D OF STORE AREA.
  201. MOV M,C STORE SERIAL CHANNEL DATA.
  202. LDA M.JOBS
  203. INR A
  204. STA M.JOBS
  205. JMP R.RETURN
  206. *
  207. *
  208. SERCHN1 EQU $
  209. RAL TEST FOR CHAR. REQ.
  210. JNC R.RETURN NO CHARACTER REQ.
  211. * 'CHARACTER 'REQUEST
  212. LXI H,TXBUF LOAD ADDR. OF XMIT BUFFER
  213. XRA A TEST FOR EMPTY
  214. ORA M BUFFER.
  215. JZ SERCHN2 NO DATA
  216. DCR M DECREMENT DIFF. COUNT
  217. INX H STEP TO
  218. INX H OUT INDEX
  219. MVI A,7 LOAD MASK FOR INDEX
  220. ANA M MASK FOR INDEX BITS
  221. INR M INCREMENT INDEX
  222. INX H STEP TO STORE AREA.
  223. MOV E,A ADD INDEX TO
  224. MVI D,00 START OF
  225. DAD D STORE AREA.
  226. MOV A,M LOAD DATA TO TRANSMIT
  227. OUT COMDATA OUTPUT DATA
  228. SERCHN2 EQU $
  229. LDA SC.OC TURN OFF CHAR.REQ.INT.
  230. OUT COMSTAT
  231. JMP R.RETURN RETURN TO PROCESSING
  232. *
  233. * LOAD ALL REGISTERS FROM STACK TO RESTORE
  234. *
  235. RESTORE EQU $
  236. POP H RESTORE REGISTERS
  237. POP D
  238. POP B
  239. POP PSW
  240. EI ENABLE SYSTEM INTERRUPT
  241. RET
  242. *
  243. * KEYBOARD INTERRUPT
  244. *
  245. * * * * * * * * * * * * * * * * * * * * * * * *
  246. KEYINP IN KEYCHAN*32+KEYDAT
  247. CMA INPUT CHARACTER FROM KEY BOARD
  248. ANI #7F
  249. MVI H,#40 LOAD OP CODE AND CATAGORY BITS
  250. MOV L,A B05,LOAD DATA
  251. CALL FIFO.ST B05,STORE FOR USER/PLATO
  252. MVI A,#01 B05
  253. OUT KEYCHAN*32+KYBDCON B05,ENABLE KYBD INT.
  254. JMP RESTORE
  255. * * * * * * * * * * * * * * * * * * * * * * * *
  256. *
  257. * TOUCH PANEL INTERRUPT
  258. *
  259. * * * * * * * * * * * * * * * * * * * * * * * *
  260. TOUCHINP IN TPCHAN*32+TOUCHD
  261. MVI H,#41 LOAD OP CODE AND CATAGORY BITS
  262. MOV L,A LOAD DATA
  263. CALL FIFO.ST STORE FOR USER/PLATO.
  264. JMP RESTORE
  265. * * * * * * * * * * * * * * * * * * * * * * * *
  266. *
  267. * EXTERNAL INTERRUPT PROCESSOR.
  268. *
  269. * * * * * * * * * * * * * * * * * * * * * * * *
  270. EXT.PR EQU $
  271. *
  272. LHLD M.EXTPA
  273. MOV A,L
  274. ORA H
  275. JNZ EXT.PR2 JUMP TO USER IF ZERO
  276. *
  277. CALL EXT.IN INPUT DEVICE DATA
  278. MOV L,A AND LOAD UP FOR
  279. MVI H,#82 FIFO INSERT
  280. CALL FIFO.ST FOR TRANSFER.
  281. JMP RESTORE RETURN TO PREVIOUS PROCESSING.
  282. EXT.PR2 EQU $
  283. PCHL JUMP TO USER IF ZERO
  284. *
  285. PSTART EQU $
  286. MVI A,#0F
  287. STA PMC.FLG SET PLATO MASTER CLEAR FLAG
  288. CALL PLATO0 INITIALIZE PLATO
  289. JMP STRT.3
  290. *
  291. * INITIALIZE TERMINAL ROUTINE
  292. *
  293. ASTART EQU $
  294. LXI H,G.BEGIN HL _ BEGIN OF SCRATCH AREA
  295. LXI D,G.END DE _ END OF SCRATCH AREA
  296. STRT.1 MVI M,00 CLEAR SCRATCH AREA
  297. INX H
  298. MOV A,L
  299. CMP E
  300. JC STRT.1
  301. MOV A,H
  302. CMP D
  303. JC STRT.1
  304. LXI H,#180
  305. SHLD CLOCK
  306. CALL ASCII SET UP ASCII OPERATIONS
  307. LHLD STRAP TEST BIT 1
  308. MOV A,L
  309. ANI 01 ON/OVERSTRIKE
  310. JNZ STRT.2A OFF/NORMAL
  311. MVI L,07 SET OVERSTRIKE
  312. JMP STRT.2B
  313. STRT.2A EQU $
  314. MVI L,03 SET NORMAL WRITE
  315. *
  316. *
  317. STRT.2B EQU $
  318. CALL R.MODE VIA R.MODE
  319. XRA A
  320. STA M.KSW
  321. LXI H,#00 POSITION X
  322. CALL R.OUTX AND Y TO (0,511)
  323. CALL LF.2 Y=PAGE TOP - HEIGHT
  324. *
  325. STRT.3 EQU *
  326. LXI H,0000
  327. SHLD M.EXTPA ZERO OUT EXT PROCESSOR
  328. LXI H,0000
  329. SHLD EXT.OUT SET UP OUTPUT AND IN ROUTINE
  330. LXI H,#D300
  331. SHLD EXT.OUT+2
  332. LXI H,#C900
  333. SHLD EXT.OUT+4
  334. LXI H,#EBDB
  335. SHLD EXT.IN
  336. MVI A,#C9
  337. STA EXT.IN+2
  338. LDA SC.OC OUTPUT SERIAL CHANNEL
  339. OUT COMSTAT CONTROL WORD
  340. IN COMCHAN*32+COMSTA
  341. XRA A TURN OFF PLATO CHAN.
  342. OUT COMCHAN*32+COMCON
  343. INR A AND TURN ON KEYBOARD,SER.CHAN.
  344. OUT KEYCHAN*32+KYBDCON
  345. OUT EXTCH5*32+EXTCNTL
  346. EI ENABLE SYSTEM INTERRUPTS.
  347. *
  348. IDLE EQU $
  349. CALL EXEC
  350. JMP IDLE
  351.  
  352. EXEC EQU *
  353. LDA MODE
  354. RLC
  355. JNC IDLE0
  356. LDA EREG
  357. ANI #04
  358. CNZ TIMOUT
  359. IDLE0 EQU $
  360. LXI H,RXBUF LOAD RECEIVE BUFF. ADDR.
  361. XRA A CLEAR A REGISTER.
  362. ORA M INCLUSIVE OR A WITH DIFF.
  363. JZ IDLE2 NO DATA, CONTINUE
  364. LDA M.JOBS
  365. DCR A
  366. STA M.JOBS
  367. DCR M IS DATA, DEC. DIFF. COUNT
  368. INX H UNLOAD DATA; STEP TO OUT.
  369. INX H
  370. MVI A,#FF MASK OUT INDEX W/ BUFFR.LN
  371. ANA M
  372. INR M INCREMENT OUT INDEX.
  373. INX H BEGIN OF STORE FOR JOBSTK
  374. MOV E,A PLUS OUTPUT INDEX
  375. MVI D,00
  376. DAD D
  377. MOV C,M UNLOAD DATA INTO C
  378. LXI H,KBDATA CLEAR KB DATA FLAG
  379. MVI M,00
  380. LDA MODE
  381. ANI #80
  382. JZ IDLE1
  383. CALL ERRCHK
  384. JC EXEC
  385. MVI A,#7F
  386. ANA C
  387. MOV C,A
  388. CALL PPROC PROCESS PLATO MODE DATA
  389. JMP EXEC
  390. IDLE1 EQU $
  391. CALL TESTMODE PROCESS DATA
  392. *
  393. IDLE2 EQU $
  394. LDA TXBUF
  395. ORA A TEST XMIT BUFFR. FOR DATA
  396. JZ IDLE3 NO DATA, CONTINUE
  397. LXI H,KBDATA CLEAR KB DATA FLAG
  398. MVI M,00
  399. IN COMSTAT INPUT STATUS WORD
  400. RAR
  401. RAR
  402. JNC IDLE3 CHAR. REQ. LOW
  403. LDA SC.OC ENABLE CHAR REQ
  404. INR A
  405. OUT COMSTAT
  406. JMP EXEC
  407. *
  408. IDLE3 EQU $
  409. LXI H,RXBUF LOAD RECEIVE BUFF. ADDR.
  410. XRA A CLEAR A REGISTER.
  411. ORA M INCLUSIVE OR A WITH DIFF.
  412. JNZ EXEC
  413. CALL INDATA CHECK KB/TP INPUT BUFFER
  414. MOV E,L BUFFER AND SAVE IN DE
  415. MOV D,H
  416. DAD H TEST FOR NO DATA FLAG
  417. JC IDLE14 NO DATA, CONTINUE
  418. XCHG NONSHIFTED FOR P.XMIT
  419. LDA MODE
  420. ANI #80 IF PLATO OPERATION
  421. JZ IDLE3.A IDLE3.A, NOT PLATO OP.
  422. CALL P.XMIT
  423. RET
  424. IDLE3.A EQU $
  425. XCHG SHIFTED FOR ASCII TESTS
  426. MVI A,07
  427. ANA H TEST FOR KEY BOARD DATA
  428. JZ IDLE4 KEYBOARD DATA
  429. XRA A
  430. STA KBDATA CLEAR KB DATA FLAG
  431. MVI A,06 TEST FOR TOUCH PANEL DATA
  432. ANA H
  433. CPI 02
  434. JZ GIN.TP GO HANDLE TOUCH PANEL DATA
  435. JMP IDLE14 NOT KB DATA, NOT TP DATA
  436. IDLE4 EQU $
  437. LXI H,KBDATA SET KB DATA FLAG
  438. MVI M,01
  439. CALL KBCON CONVERT KB TO ASCII
  440. ANA A CLEAR CARRY
  441. RAL IF UPPER BIT SET,SPEC.CODE
  442. JNC IDLE8 OTHERWISE,CONT. PROCESSING
  443. * BC HAS INDEX INTO SPTBL
  444. MOV C,A
  445. MOV B,D
  446. LXI H,SPTBL
  447. DAD B
  448. MOV E,M
  449. INX H
  450. MOV D,M
  451. XCHG
  452. PCHL JUMP TO SPECIAL CODE
  453. *
  454. IDLE8 EQU $
  455. JZ IDLE9
  456. LDA G.TTYFLG IF TELETYPE FLAG SET
  457. ORA A CHECK FOR BIT 7 SET.
  458. JZ IDLE9
  459. MOV A,C
  460. ANI #40
  461. JZ IDLE9
  462. MOV A,C PUT DATA IN A REG
  463. ANI #5F TURN OFF BIT 6 OF 8
  464. MOV C,A
  465. *
  466. IDLE9 EQU $
  467. LDA G.CTLFLG TEST FOR CONTROL
  468. ORA A KEY AS PREVIOUS KEY
  469. JZ IDLE12 NO CONTROL KEY
  470. XRA A CLEAR CONTROL FLAG
  471. STA G.CTLFLG
  472. MOV A,C
  473. CPI #31
  474. JZ OFFLINE
  475. CPI #30
  476. JZ ONLINE
  477. CPI #3D CHECK FOR EXCEPTIONS TO
  478. JZ UNSCALE CTL KEY SEQUENCES.
  479. CPI #39
  480. JZ SCALE
  481. CPI #32
  482. JZ CURSON
  483. CPI #33
  484. JNZ IDLE10
  485. *
  486. CURSOFF EQU $
  487. LDA ECURSOR
  488. MOV B,A
  489. CALL DISCURS
  490. STA G.SUPCUR SUPPRESS CURSOR
  491. JMP EXEC
  492. *
  493. CURSON EQU $
  494. XRA A DO NOT SUPPRESS CURSOR
  495. STA G.SUPCUR
  496. JMP EXEC
  497. *
  498. OFFLINE EQU $
  499. LXI H,LOC.RMT SET OFFLINE CONDITION
  500. MVI M,1
  501. JMP EXEC
  502. *
  503. ONLINE EQU $
  504. LXI H,LOC.RMT SELECT ONLINE CONDITION
  505. MVI M,00
  506. JMP EXEC
  507. *
  508. SCALE EQU $
  509. XRA A CTL 3D
  510. STA SCALEFG WILL SCALE TO 511 X 511
  511. LXI H,#0070
  512. SHLD BIAS BIAS IS 112
  513. JMP EXEC
  514. *
  515. UNSCALE EQU $
  516. LXI H,SCALEFG CTL 39
  517. MVI M,01 ACCEPTS COORDS. AS IS
  518. LXI H,0000
  519. SHLD BIAS BIAS IS 0
  520. JMP EXEC
  521. *
  522. IDLE10 EQU $
  523. MVI A,#20 TEST FOR SHIFTED
  524. ANA C KEY INPUT.
  525. JNZ IDLE11 NOT SHIFTED
  526. MVI A,#10 ELSE TOGGLE
  527. XRA C BIT FOUR OF
  528. MOV C,A KEY INPUT.
  529. *
  530. IDLE11 EQU $
  531. MVI A,#1F LOAD MASK AND
  532. ANA C MASK CONTROL CODE
  533. MOV C,A
  534. XRA A CLEAR CONTROL FLAG
  535. STA G.CTLFLG
  536. *
  537. IDLE12 EQU $
  538. LDA MODE
  539. CPI #08 TEST FOR GIN MODE
  540. JNZ IDLE12.A
  541. CALL GIN.A GIN MODE, GIN.A
  542. JMP IDLE14 SKIP TO IDLE14
  543. IDLE12.A EQU $
  544. LDA LOC.RMT LOAD LOCAL/REMOTE FLAG
  545. ORA A
  546. CZ XMIT.1 STORE DATA FOR TRANSMIT
  547. *
  548. LDA BYPASS LOAD AND TEST FOR BYPASS
  549. ORA A
  550. JZ IDLE13 BYPASS NOT ON
  551. MOV A,C PUT DATA IN C REG.
  552. CPI #20 IF DATA IS CTL CODE,
  553. JNC IDLE14 KEY NOT CTL CODE
  554. *
  555. IDLE13 EQU $
  556. LHLD STRAP TEST FOR ECHO OPTION
  557. MOV A,L
  558. ANI #80
  559. JNZ IDLE14 NO ECHO
  560. CALL TESTMODE PROCESS ASCII OP. DATA
  561. *
  562. IDLE14 EQU $
  563. LXI H,KBDATA CLEAR KB DATA FLAG
  564. MVI M,00
  565. LDA MODE IF ALPHA, BLINK CURSOR
  566. CPI #08
  567. JZ IDLE15
  568. CPI #03
  569. RNZ
  570. IDLE15 EQU $
  571. LHLD CLOCK TEST BLINK COUNT
  572. DCX H
  573. SHLD CLOCK
  574. MOV A,L
  575. ORA H
  576. JNZ EXEC
  577. LXI H,#180
  578. SHLD CLOCK
  579. LDA WEFLAG CHECK FOR W/E CURSOR
  580. ORA A
  581. JZ BLINK
  582. MVI B,04
  583. CALL DISCURS ERASE CURSOR
  584. XRA A CLEAR W/E FLAG_WRITE
  585. STA WEFLAG
  586. RET
  587.  
  588. GJOB EQU *
  589. MVI C,0
  590. LDA EREG
  591. ANI #04
  592. CNZ TIMOUT
  593. LXI H,RXBUF
  594. XRA A
  595. ORA M
  596. RZ RETURN IF NO JOBS RECEIVED
  597. LDA M.JOBS
  598. DCR A
  599. STA M.JOBS
  600. DCR M
  601. INX H
  602. INX H
  603. MVI A,#FF
  604. ANA M
  605. INR M
  606. INX H
  607. MOV E,A
  608. MVI D,00
  609. DAD D
  610. MOV C,M
  611. LXI H,KBDATA
  612. MVI M,0
  613. CALL ERRCHK
  614. RC RETURN IF ERROR
  615. MVI A,#7F
  616. ANA C
  617. MOV C,A
  618. RET
  619.  
  620. *
  621. BLINK EQU $
  622. MVI B,6
  623. CALL DISCURS WRITE CURSOR
  624. MVI A,1 SET W/E FLAG_WRITE
  625. STA WEFLAG
  626. JMP EXEC
  627. *
  628. ERRCHK EQU $
  629. MVI A,#06
  630. CMP C
  631. JNZ E001 NOT ACK JUMP
  632. LDA EREG
  633. ORI #80
  634. STA EREG
  635. STC
  636. RET
  637. E001 LDA EREG
  638. RAR
  639. JNC E100 NOT STATE 0 JUMP
  640. MOV A,C
  641. ORA A
  642. JPO E006 P ERROR JUMP
  643. LDA EREG
  644. RAL
  645. JNC E006
  646. E002 EQU $
  647. MOV A,C
  648. ANI #7F
  649. SUI #20
  650. JM E003
  651. STA MREG
  652. STA NREG
  653. MVI A,#02
  654. STA EREG
  655. E003 LDA EREG
  656. ANI #0F
  657. STA EREG
  658. STC
  659. RET
  660. E006 LDA EREG
  661. ANI #0F
  662. STA EREG
  663. RET
  664. E100 EQU *
  665. RAR
  666. JNC E200 NOT STATE 1 JUMP
  667. MOV A,C
  668. ORA A
  669. JPE E104 NOT P ERROR JUMP
  670. XRA A
  671. ORI #04
  672. STA EREG
  673. E101 MVI C,#95 NAK
  674. E102 CALL XMIT.1
  675. JC E102
  676. LDA MREG
  677. ADI #20
  678. MOV C,A
  679. E103 CALL XMIT.1
  680. JC E103
  681. XRA A
  682. STA CLK.1
  683. STA CLK.2
  684. STC
  685. RET
  686. E104 LDA EREG
  687. ANI #80
  688. JZ E105 NO ACK FLAG JUMP
  689. MOV A,C
  690. ORA A
  691. RAL
  692. RRC
  693. SUI #20
  694. STA NREG
  695. JMP E003
  696. E105 LDA MREG
  697. MOV B,A
  698. LDA NREG
  699. CMP B
  700. JNZ E107 N^=M JUMP
  701. INR A
  702. MVI B,#60
  703. CMP B
  704. JNZ E106
  705. XRA A
  706. E106 STA NREG
  707. STA MREG
  708. LDA EREG
  709. ANI #BF
  710. STA EREG
  711. JMP E109
  712. E107 INR A
  713. MVI C,#60
  714. CMP C
  715. JNZ E108
  716. XRA A
  717. E108 STA NREG
  718. LDA EREG
  719. ORI #40
  720. STA EREG
  721. E109 LDA E.CNTR
  722. DCR A
  723. JZ E110
  724. STA E.CNTR
  725. LDA EREG
  726. RLC
  727. RLC
  728. RET
  729. E110 MOV B,C
  730. MVI A,#14
  731. STA E.CNTR
  732. MVI C,#06 ACK
  733. E111 CALL XMIT.1
  734. JC E111
  735. LDA MREG
  736. ADI #20
  737. MOV C,A
  738. E113 CALL XMIT.1
  739. JC E113
  740. MOV C,B
  741. LDA EREG
  742. RLC
  743. RLC
  744. RET
  745. E200 MOV A,C
  746. ORA A
  747. JPO E202
  748. LDA EREG
  749. RLC
  750. JC E002
  751. E201 STC
  752. RET
  753. E202 LDA EREG
  754. ANI #0F
  755. JMP E201
  756. *
  757. P.XMIT EQU $
  758. MOV E,L SAVE DATA BITS IN E
  759. MOV D,H SAVE NON-SHIFTED H IN D
  760. DAD H FOR TEST OF DATA TYPE
  761. MVI A,#07
  762. ANA H
  763. JNZ PX007 NOT KBDATA JP PX007
  764. CALL KBCON
  765. MVI A,#17
  766. CMP C
  767. JNZ PX002
  768. MVI A,#01
  769. STA SH.SUP
  770. PX001 CALL XMIT.1
  771. JC PX001
  772. RET
  773. PX002 LDA SH.SUP
  774. ORA A
  775. JNZ PX004 SH.SUP SET JUMP
  776. PX003 CALL XMIT.1
  777. JC PX003
  778. RET
  779. PX004 MVI A,#11
  780. CMP C
  781. JNZ PX005
  782. XRA A
  783. STA SH.SUP
  784. CALL ASCII
  785. RET
  786. PX005 XRA A
  787. STA SH.SUP
  788. PX006 CALL XMIT.1
  789. JC PX006
  790. RET
  791. PX007 EQU $
  792. PUSH D
  793. MVI C,#1B
  794. PX008 CALL XMIT.1
  795. JC PX008
  796. POP D
  797. MVI A,#3F
  798. ANA E
  799. ADI #40
  800. MOV C,A
  801. PUSH D
  802. PX010 EQU $
  803. CALL XMIT.1
  804. JC PX010
  805. POP D
  806. MVI A,#C0
  807. ANA E
  808. RLC
  809. RLC
  810. MOV E,A
  811. MVI A,#03
  812. ANA D
  813. RLC
  814. RLC
  815. ORA E
  816. ADI #40
  817. MOV C,A
  818. PX012 CALL XMIT.1
  819. JC PX012
  820. RET
  821. TIMOUT EQU *
  822. LDA CLK.1
  823. ADI #01
  824. STA CLK.1
  825. RNC
  826. LDA CLK.2
  827. INR A
  828. STA CLK.2
  829. SUI #20
  830. RNZ
  831. XRA A
  832. STA CLK.1
  833. STA CLK.2
  834. MVI C,#95
  835. TO01 CALL XMIT.1
  836. JC TO01
  837. LDA MREG
  838. ADI #20
  839. MOV C,A
  840. TO03 CALL XMIT.1
  841. JC TO03
  842. RET
  843. *
  844. * TRANSMIT BUFFER STORE
  845. XMIT EQU $
  846. CALL P.XMIT
  847. RET
  848. *
  849. XMIT.1 EQU $
  850. LXI H,TXBUF TEST FOR
  851. MVI A,07 FULL BUFFER.
  852. CMP M
  853. JC XMIT.3 FULL, ENABLE CREQ
  854. INR M BUFFER NOT FULL,INCR. DIFF
  855. INX H STEP TO INPUT INDEX
  856. ANA M PICK UP INPUT INDEX.
  857. INR M
  858. INX H STEP TO STORE AREA.
  859. INX H
  860. MOV E,A ADD INPUT INDEX.
  861. MVI D,00
  862. DAD D
  863. LDA MODE
  864. ANI #80
  865. MOV A,C
  866. * JZ XMIT.2 IF ASCII OP. SKIP PARITY
  867. ORA A
  868. JPE XMIT.2 PLATO SO EVEN PARITY CHK.
  869. XRI #80
  870. XMIT.2 EQU $
  871. MOV M,A STORE DATA IN TXBUF
  872. XMIT.3 EQU $
  873. LDA SC.OC SET CREQ ENABE
  874. INR A
  875. OUT COMSTAT
  876. RET
  877. TESTMODE EQU $
  878. LDA MODE LOAD MODE.
  879. ANI #0F MASK OFF MODE BITS
  880. RLC
  881. MOV E,A
  882. MVI D,0
  883. LHLD SELECT.M LOAD BASE ADDR. JUMP TABLE
  884. DAD D
  885. MOV E,M
  886. INX H
  887. MOV D,M
  888. XCHG
  889. *
  890. JMPHL EQU $
  891. PCHL
  892. *
  893. SELECT.P EQU $
  894. DW POINT
  895. DW GRAPH
  896. DW MEMORY MODE 2
  897. DW CHARACT
  898. DW ABLOCK
  899. DW MODE5
  900. DW MODE6
  901. DW MODE7
  902. DW TEMP
  903. *
  904. SELECT.A EQU $
  905. DW POINT
  906. DW GRAPH
  907. DW TEMP
  908. DW ALPHMODE
  909. DW ABLOCK
  910. DW TEMP
  911. DW TEMP
  912. DW TEMP
  913. DW GIN
  914. *
  915. COMMODE EQU $
  916. LDA CMODE LOAD COMMAND MODE
  917. ANI #07 MASK OFF UNWANTED BITS
  918. RLC
  919. MOV E,A
  920. MVI D,00
  921. LXI H,SELECT.C LOAD BASE ADDR. JUMP TABLE
  922. DAD D
  923. MOV E,M
  924. INX H
  925. MOV D,M
  926. XCHG
  927. PCHL
  928. *
  929. SELECT.C EQU $
  930. DW LDC
  931. DW SSF
  932. DW ECHO
  933. DW LDA
  934. DW EXT
  935. DW COLOR
  936. *
  937. SPTBL EQU $
  938. DW G.CTL CONTROL
  939. DW G.RESET RESET
  940. DW G.TTY
  941. DW G.BREAK
  942. DW G.PAGE PAGE
  943. DW G.ERASE 'B'S WITH ERASE ALWAYS
  944. DW G.RUBOUT
  945. *
  946. *
  947. * FOLLOWING ARE EXCEPTIONS TO NORMAL ASCII CHAR. SET
  948. *
  949. *
  950. G.CTL EQU $
  951. MVI A,01 SET CONTROL FLAG
  952. STA G.CTLFLG
  953. JMP EXEC
  954. *
  955. *
  956. G.RESET EQU $
  957. LDA MODE IF IN ALPHA, ERASE CURSOR
  958. CPI 03
  959. JNZ G.RES.1
  960. LDA ECURSOR ERASE CURSOR
  961. MOV B,A
  962. CALL DISCURS
  963. G.RES.1 EQU $
  964. CALL SIZE1
  965. CALL AFF.1
  966. JMP EXEC
  967. *
  968. G.PAGE EQU $
  969. CALL AFF SAME AS ESC FF SEQ.
  970. JMP EXEC
  971. *
  972. G.TTY EQU $
  973. LDA G.TTYFLG
  974. XRI 01 CHANGE 'C'A'P'S
  975. STA G.TTYFLG
  976. JMP EXEC
  977. *
  978. G.ERASE EQU $
  979. CALL BS
  980. LDA D.CNTL2
  981. STA D.CNTL2P
  982. LDA M.MODE
  983. STA M.MODEP
  984. MVI L,02
  985. CALL R.MODE
  986. MVI C,#00
  987. CALL CHARGEN
  988. LDA D.CNTL2P
  989. STA D.CNTL2
  990. LDA M.MODEP
  991. STA M.MODE
  992. MVI C,#08
  993. JMP IDLE12
  994. *
  995. G.BREAK EQU *
  996.  
  997. G.RUBOUT EQU *
  998. JMP EXEC
  999. *
  1000. KBCON EQU $
  1001. MVI D,00 DE-KEYBOARD DATA
  1002. LHLD KBAADR HL-KB CONVERSION TABLE
  1003. DAD D BASE ADDR. + KEY CODE
  1004. MOV A,M
  1005. MOV C,A IF VALID, RETURN IN C
  1006. CPI #FF
  1007. RNZ
  1008. POP H OTHERWISE, POP STACK
  1009. JMP EXEC
  1010. *
  1011. ISTASC EQU $
  1012. DB #30,#31,#32,#33
  1013. DB #34,#35,#36,#37
  1014. DB #38,#39,#26,#60
  1015. DB #0A,#5E,#2B,#2D
  1016. DB #13,#04,#07,#08
  1017. DB #7B,#0B,#0D,#1A
  1018. DB #02,#12,#01,#03
  1019. DB #7D,#0C,#FF,#FF
  1020. DB #3C,#3E,#5B,#5D
  1021. DB #24,#25,#5F,#7C
  1022. DB #2A,#28,#40,#27
  1023. DB #1C,#5C,#23,#7E
  1024. DB #17,#05,#14,#19
  1025. DB #7F,#09,#1E,#18
  1026. DB #0E,#1D,#11,#16
  1027. DB #00,#0F,#FF,#FF
  1028. DB #20,#61,#62,#63
  1029. DB #64,#65,#66,#67
  1030. DB #68,#69,#6A,#6B
  1031. DB #6C,#6D,#6E,#6F
  1032. DB #70,#71,#72,#73
  1033. DB #74,#75,#76,#77
  1034. DB #78,#79,#7A,#3D
  1035. DB #3B,#2F,#2E,#2C
  1036. DB #1F,#41,#42,#43
  1037. DB #44,#45,#46,#47
  1038. DB #48,#49,#4A,#4B
  1039. DB #4C,#4D,#4E,#4F
  1040. DB #50,#51,#52,#53
  1041. DB #54,#55,#56,#57
  1042. DB #58,#59,#5A,#29
  1043. DB #3A,#3F,#21,#22
  1044. **********
  1045. * KEYBOARD TO ASCII CONVERSION TABLE
  1046. **********
  1047. IGTASC EQU $
  1048. DB #30,#31,#32,#33
  1049. DB #34,#35,#36,#37
  1050. DB #38,#39,#40,#5C
  1051. DB #09,#5E,#2B,#2D
  1052. DB #7D,#1B,#FF,#85 1X
  1053. DB #82,#FF,#0D,#0A
  1054. DB #08,#86,#83,#80
  1055. DB #84,#FF,#FF,#FF
  1056. DB #3C,#3E,#5B,#5D 2X
  1057. DB #24,#25,#5F,#27
  1058. DB #2A,#28,#60,#7C
  1059. DB #09,#7E,#23,#26
  1060. DB #7B,#1B,#FF,#85 3X
  1061. DB #82,#FF,#0D,#0A
  1062. DB #08,#86,#83,#80
  1063. DB #81,#FF,#FF,#FF
  1064. DB #20,#61,#62,#63
  1065. DB #64,#65,#66,#67
  1066. DB #68,#69,#6A,#6B
  1067. DB #6C,#6D,#6E,#6F
  1068. DB #70,#71,#72,#73
  1069. DB #74,#75,#76,#77
  1070. DB #78,#79,#7A,#3D
  1071. DB #3B,#2F,#2E,#2C
  1072. DB #20,#41,#42,#43
  1073. DB #44,#45,#46,#47
  1074. DB #48,#49,#4A,#4B
  1075. DB #4C,#4D,#4E,#4F
  1076. DB #50,#51,#52,#53
  1077. DB #54,#55,#56,#57
  1078. DB #58,#59,#5A,#29
  1079. DB #3A,#3F,#21,#22
  1080. *
  1081. PPROC EQU $
  1082. MOV A,C
  1083. ANA A
  1084. RZ
  1085. LDA CMODE TEST FOR COMMAND MODES
  1086. ANI #80
  1087. JZ PPROC.1
  1088. CALL COMMODE COMMAND MODE PROCESSOR
  1089. RET
  1090. PPROC.1 EQU $
  1091. LDA MODE
  1092. ANI #40 IF THIS BIT SET,
  1093. JZ PPROC.2 NOT COMMAND OR DATA MODES
  1094. CALL TESTMODE
  1095. RET
  1096. PPROC.2 EQU $
  1097. CALL ESCCTL
  1098. RET
  1099. *
  1100. ESCADR.P EQU $
  1101. DB #03
  1102. DW ASCII
  1103. DB #11
  1104. DW DC1
  1105. DB #12
  1106. DW DC2
  1107. DB #13
  1108. DW DC3
  1109. DB #14
  1110. DW DC4
  1111. DB #1B
  1112. DW ESC
  1113. DB #0C
  1114. DW BULKER
  1115. DB #40
  1116. DW SUPER
  1117. DB #41
  1118. DW SUB
  1119. DB #42
  1120. DW SELECTM0
  1121. DB #43
  1122. DW SELECTM1
  1123. DB #44
  1124. DW SELECTMM
  1125. DB #45
  1126. DW SELECTMM
  1127. DB #46
  1128. DW SELECTMM
  1129. DB #47
  1130. DW SELECTMM
  1131. DB #48
  1132. DW SELECTMM
  1133. DB #49
  1134. DW SELECTMM
  1135. DB #4A
  1136. DW HORZ
  1137. DB #4B
  1138. DW VERTICAL
  1139. DB #4C
  1140. DW FORWARD
  1141. DB #4D
  1142. DW REVERSE
  1143. DB #4E
  1144. DW SIZE.1
  1145. DB #4F
  1146. DW SIZE.2
  1147. DB #32
  1148. DW LCOORD
  1149. DB #51
  1150. DW SSPECF
  1151. DB #52
  1152. DW LEXT
  1153. DB #53
  1154. DW LDM2
  1155. DB #54
  1156. DW MODE567
  1157. DB #55
  1158. DW MODE567
  1159. DB #56
  1160. DW MODE567
  1161. DB #57
  1162. DW LADDR
  1163. DB #59
  1164. DW LECHO
  1165. DB #5A
  1166. DW LMARG
  1167. DB #3D
  1168. DW STCOL
  1169. DB #FF
  1170. *
  1171. CTLADR.P EQU $
  1172. DB #08
  1173. DW BKSPACE
  1174. DB #0D
  1175. DW RETURN
  1176. DB #09
  1177. DW TAB
  1178. DB #0A
  1179. DW LINEFEED
  1180. DB #0B
  1181. DW VERTAB
  1182. DB #0C
  1183. DW FORMFEED
  1184. DB #19
  1185. DW EM.1
  1186. DB #1B
  1187. DW ESC
  1188. DB #1C
  1189. DW FS.1
  1190. DB #1D
  1191. DW GS.1
  1192. DB #1F
  1193. DW US
  1194. DB #FF
  1195. *
  1196. TEMP EQU $
  1197. RET
  1198. *
  1199. ASCII EQU $
  1200. MVI A,#B5 SET INITIAL TERMINAL STAT.
  1201. STA TSTAT
  1202. MVI A,#03 SELECT ASCII MODE 3
  1203. STA MODE
  1204. STA WEFLAG SET W/E FLAG
  1205. LXI H,IGTASC SELECT IGT ASCII KEYBOARD
  1206. SHLD KBAADR
  1207. LXI H,SELECT.A SELECT ASCII MODE TABLE
  1208. SHLD SELECT.M
  1209. LXI H,CTLADR.A SELECT ASCII CTL CODE TBL
  1210. SHLD CTLADR
  1211. LXI H,ESCADR.A SELECT ASCII ESC SEQ TBL
  1212. SHLD ESCADR
  1213. CALL SIZE1
  1214. LXI H,#0070
  1215. SHLD BIAS
  1216. MVI A,4
  1217. STA ECURSOR
  1218. MVI A,6
  1219. STA WCURSOR
  1220. XRA A
  1221. STA SCALEFG
  1222. CALL BULKER ERASE SCREEN
  1223. LXI H,#00 POSITION X TO 00
  1224. CALL R.OUTX
  1225. CALL LF.2 POSITION Y TO 512 - HEIGHT
  1226. RET
  1227. *
  1228. BULKER EQU $
  1229. LDA M.MODE
  1230. RLC
  1231. ORI 01
  1232. MOV L,A
  1233. CALL R.MODE
  1234. RET
  1235. LDM2 EQU $
  1236. MVI A,#C2 SELECT LOAD MEMORY
  1237. STA MODE MODE 2,PLATO OP.
  1238. XRA A CLEAR NUMBER OF INPUTS
  1239. STA NINPUT TO GETXY ROUTINE
  1240. RET
  1241. *
  1242. LCOORD EQU $
  1243. MVI A,#80 SELECT COMMAND LOAD
  1244. STA CMODE COORDINATE
  1245. XRA A
  1246. STA NINPUT
  1247. RET
  1248. *
  1249. LMARG EQU $
  1250. CALL R.INPX
  1251. LDA M.CCR
  1252. ANI 01
  1253. JZ LMARG.1 HORIZONTAL, HL HAS X
  1254. CALL R.INPY
  1255. LMARG.1 EQU $
  1256. SHLD M.MARGIN SET MARGIN
  1257. RET
  1258. *
  1259. SSPECF EQU $
  1260. MVI A,#81
  1261. STA CMODE SPECIAL FUNCTION
  1262. XRA A
  1263. STA NBYTES
  1264. RET
  1265. *
  1266. LECHO EQU $
  1267. MVI A,#82
  1268. STA CMODE ECHO
  1269. XRA A
  1270. STA NBYTES
  1271. RET
  1272. *
  1273. LADDR EQU $
  1274. MVI A,#83
  1275. STA CMODE ADDRESS
  1276. XRA A
  1277. STA NBYTES
  1278. RET
  1279. *
  1280. LEXT EQU $
  1281. MVI A,#84
  1282. STA CMODE EXTERNAL DEVICE
  1283. XRA A
  1284. STA NBYTES
  1285. RET
  1286. *
  1287. STCOL EQU *
  1288. MVI A,#85
  1289. STA CMODE COLOR
  1290. XRA A
  1291. STA NBYTES
  1292. RET
  1293.  
  1294. COLOR EQU *
  1295. LXI H,NBYTES
  1296. INR M
  1297. MVI A,02
  1298. CMP M
  1299. RNZ
  1300. XRA A
  1301. STA CMODE
  1302. RET
  1303. *
  1304. LDC EQU $ LOAD COORDINATE PROCESSOR
  1305. CALL ESCCTL CHECK FOR COMMAND CHANGE
  1306. CALL GETXY GET COORDINATES
  1307. CALL OUTCOORD
  1308. RET
  1309. * * * * * * * * * * * * * * * * * * * * * * * *
  1310. *
  1311. * ECHO COMMAND
  1312. * 70H-TESTS MEMORY CONFIGURATION OF TERMINAL
  1313. * RESPONDS WITH'; 72H- 4K
  1314. * 73H- 20K
  1315. * 76H- 8K
  1316. * 77H- 24K
  1317. * 71H-SUBTYPE (3)
  1318. * 72H-LOADFILE (SWITCH - USUALLY 3)
  1319. * 73H-CONFIG (0)
  1320. * 7BH-SOUND AUDIBLE AUDIBLE ALERT
  1321. * 7CH-ID SERIAL NUMBER
  1322. * 7DH-SEND USER FLAG
  1323. * OTHERS LOOP BACK
  1324. *
  1325. * * * * * * * * * * * * * * * * * * * * * * * *
  1326. ECHO EQU $
  1327. CALL ESCCTL CHECK FOR COMMAND CHANGE
  1328. CALL GET3 GET NEXT 3 BYTES
  1329. MOV A,E
  1330. ANI #7F
  1331. CPI #7C TEST FOR ID CODE RESPONSE
  1332. JNZ LDE1 NOT ID REQUEST
  1333. MVI A,#20 ALWAYS HAVE EXT
  1334. ANI #20 TEST FOR ID SWITCHES
  1335. MVI A,#7C RELOAD ECHO CODE.
  1336. JZ ECHO.ST NO ID SWITCHES, SEND BACK ECHO CODE
  1337. MVI C,00
  1338. IN IDCHAN*32+IDLSBS ADD LOWER 8 BITS IF ID
  1339. CALL LDE3 SET ID CODE IN ECHO RESPONSE
  1340. MVI C,#20
  1341. IN IDCHAN*32+IDMSBS LOAD UPPER BITS OF ID CODE.
  1342. CALL LDE3 SET ID CODE IN ECHO RESPONSE.
  1343. RET
  1344. *
  1345. LDE3 EQU $
  1346. MOV B,A SAVE ID CODE.
  1347. ANI #0F MASK OFF LOWER 4 BITS
  1348. ORA C ADD ID RESPONSE NUMBER
  1349. PUSH B SAVE ID CODE AND RESPONSE
  1350. CALL ECHO.ST STORE CODE FOR TRANSMIT
  1351. POP B RETRIEVE ID CODE
  1352. MOV A,B
  1353. RRC POSITION UPPER
  1354. RRC FOUR BITS
  1355. RRC OF ID CODE FOR
  1356. RRC ECHO RESPONSE.
  1357. ANI #0F MASK OFF UNWANTED BITS.
  1358. ORA C ADD RESPONSE
  1359. ORI #10 NUMBER FOR 'P'L'A'T'O
  1360. JMP ECHO.ST STORE CODE FOR TRANSMIT
  1361. *
  1362. LDE1 EQU $
  1363. CPI #7B TEST FOR AUDIBLE ALERT
  1364. JNZ LDE1.A
  1365. IN TPCHAN*32+TOUCHD SOUND TONE AND RETURN
  1366. RET
  1367. LDE1.A EQU $
  1368. CPI #70 TEST FOR TERMINAL TYPE
  1369. JNZ LDE1.B
  1370. LDA M.TYPE LOAD TERMINAL TYPE
  1371. JMP ECHO.ST
  1372.  
  1373. LDE1.B EQU *
  1374. CPI #71 TEST FOR SUB TYPE
  1375. JNZ LDE1.C
  1376. MVI A,3
  1377. JMP ECHO.ST
  1378.  
  1379. LDE1.C EQU *
  1380. CPI #72 TEST FOR LOADFILE
  1381. JNZ LDE1.D
  1382. IN RSF.PANL*32+PANLSWCH
  1383. ANI #0E0
  1384. RLC
  1385. RLC
  1386. RLC
  1387. JMP ECHO.ST
  1388.  
  1389. LDE1.D EQU *
  1390. CPI #73 TEST FOR CONFIG
  1391. JNZ LDE2
  1392. MVI A,0
  1393. JMP ECHO.ST
  1394.  
  1395. LDE2 EQU $
  1396. CPI #7D TEST FOR SENDING
  1397. JNZ ECHO.ST
  1398. LHLD MEMREG
  1399. MOV A,M
  1400. ANI #7F
  1401. *
  1402. ECHO.ST EQU $
  1403. ORI #80 INCLUDE ECHO CODE
  1404. MOV L,A AND STORE
  1405. MVI H,00 IN TRANSMIT FIFO.
  1406. CALL P.XMIT
  1407. RET
  1408. ************************************************************************
  1409. *
  1410. * LOAD MEMORY ADDRESS THIS INSTRUCTION LOADS THE MEMORY
  1411. * ADDRESS REGISTER WITH BITS 01-15. THIS INSTRUCTION
  1412. * SPECIFIES THE FIRST STORAGE ADDRESS TO BE USED UPON ENTRY
  1413. * INTO A MODE 2 OPERATION.
  1414. *
  1415. ************************************************************************
  1416. LDA EQU $
  1417. CALL ESCCTL CHECK FOR COMMAND CHANGE
  1418. CALL GET3 GET NEXT 3 BYTES
  1419. XRA A CLEAR THE
  1420. STA BC.REG BLOCK CHECK REGISTER.
  1421. MVI A,#82
  1422. STA MODE SELECT LOAD MEM. DATA MODE
  1423. MOV A,L
  1424. ANI #3F
  1425. RLC
  1426. ADD D
  1427. MOV H,A
  1428. MOV L,E
  1429. CALL CHKRG CHECK ADDRESS RANGE
  1430. SHLD MEMREG STORE ADDRESS INTO MEMORY REGISTE
  1431. RET
  1432. *
  1433. CHKRG EQU $ MEMREG RANGE CHK
  1434. MOV A,H
  1435. CPI #22
  1436. JC POPRET
  1437. JNZ CHKRG.1
  1438. MOV A,L
  1439. CPI #EA
  1440. JC POPRET
  1441. CHKRG.1 EQU $
  1442. MOV A,H
  1443. CPI #7F
  1444. JZ CHKRG.2
  1445. JNC POPRET
  1446. RET
  1447. CHKRG.2 EQU *
  1448. MOV A,L
  1449. CPI #FF
  1450. JZ POPRET
  1451. RET
  1452. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1453. *
  1454. * SSF (SELECT SPECIAL FUNCTION)
  1455. *
  1456. * THIS INSTRUCTION ESTABLISHES SPECIAL FUNCTIONS WITHIN THE
  1457. * TERMINAL AND SELECTS THE VARIOUS OUTPUT DEVICES. BITS 11 THRU
  1458. * 15 SPECIFY THE DEVICE OR SPECIAL FUNCTIONS AND BITS 01
  1459. * THRU 10 SPECIFY CONTROL FUNCTIONS.
  1460. *
  1461. * FUNCTION TYPE (BITS 11 THRU 15)
  1462. * 00 SELECT SLIDE PROJECTOR
  1463. * 01 SET INTERRUPT MASK
  1464. * 02 SERIAL CHANNEL DATA
  1465. * 04-1F PARALLEL CHANNEL DATA/CONTROL
  1466. *
  1467. * FUNCTION OPERATIONS (BITS 01 THRU 10)
  1468. *
  1469. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1470. *
  1471. *
  1472. * TEST FOR EXISTENCE OF EXTERNAL INTERFACE.
  1473. *
  1474. SSF EQU $
  1475. CALL ESCCTL CHECK FOR COMMAND CHANGE
  1476. CALL GET3 GET NEXT 3 BYTES
  1477. MVI A,#3F LOAD LOWER
  1478. ANA L 15 BITS INTO
  1479. RLC HL REGISTER
  1480. ORA D FOR PROCESSING.
  1481. MOV H,A
  1482. MOV L,E
  1483. *
  1484. SSF.X EQU $
  1485. MOV A,H LOAD UPPER BITS
  1486. RRC
  1487. RRC
  1488. ANI #1F
  1489. *
  1490. * TEST FUNCTION TYPE
  1491. *
  1492. *
  1493. CPI 02 TEST FOR INTERRUPT MASK
  1494. RZ RETURN IF TRY FOR SERIAL
  1495. CPI 01
  1496. JZ SSF.3 SET INTERRUPT MASK
  1497. *
  1498. MOV E,A SAVE ADDRESS BITS
  1499. XRA A TEST FOR SLIDE PROJECTOR
  1500. ORA E ADDRESS
  1501. JZ SSF.1
  1502. MVI A,02 AND TEST
  1503. ANA H FOR INPUT OR OUTPUT.
  1504. MVI A,#E0 LOAD UPPER ADDRESS BITS
  1505. JNZ SSF.2 GO TO INPUT
  1506. *
  1507. * SELECT EXTERNAL DEVICE
  1508. *
  1509. ORA E LOAD DEVICE ADDRESS
  1510. STA EXT.OUT+4 AND STORE FOR OUTPUT
  1511. MVI A,01 TEST FOR
  1512. ANA H OUTPUT BYPASS
  1513. RNZ
  1514. *
  1515. MOV A,L LOAD SLIDE DATA
  1516. CALL EXT.OUT
  1517. RET
  1518. *
  1519. * SLIDE PROJECTOR
  1520. *
  1521. SSF.1 EQU $
  1522. MOV A,L LOAD DATA
  1523. OUT EXTCH7*32+SLDATA0 OUTPUT SLIDE PROJECTOR DATA.
  1524. MVI A,03 LOAD LAMP AND SHUTTER BITS
  1525. ANA H FOR SLIDE PROJECTOR.
  1526. OUT EXTCH7*32+SLDATA1 OUTPUT SLIDE PROJECTOR DATA.
  1527. RET
  1528. *
  1529. * INPUT FROM EXTERNAL DEVICE.
  1530. *
  1531. *
  1532. SSF.2 EQU $
  1533. ORA E LOAD DEVICE ADDRESS
  1534. STA EXT.IN+1 AND STORE IN INSTRUCTION.
  1535. MVI A,01
  1536. ANA H TEST FOR
  1537. RNZ DATA BYPASS.
  1538. CALL EXT.IN INPUT DEVICE DATA.
  1539. MOV L,A AND LOAD UP FOR
  1540. LDA M.KSW LOAD USER/PLATO FLAG
  1541. CPI 03
  1542. RZ RETURN IF USER SELECTED
  1543. MVI H,#82 FOR TRANSMIT TO PLATO.
  1544. CALL P.XMIT HL - TRANSMIT FOR P.XMIT
  1545. RET
  1546. *
  1547. SSF.3 EQU $
  1548. MOV A,L
  1549. ANI #20
  1550. JZ SSF.5
  1551. IN TPCHAN*32+TOUCHS INPUT T.P.STATUS
  1552. RAR TEST FOR CHAR. READY
  1553. JNC SSF.5 CHAR.NOT RDY,ENABLE
  1554. IN TPCHAN*32+TOUCHD DUMMY INPUT TO CLEAR
  1555. SSF.5 EQU $
  1556. MOV A,L
  1557. JMP ENAB
  1558. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1559. *
  1560. * EXT (LOAD EXTERNAL DEVICE)
  1561. *
  1562. * THIS INSTRUCTION PASSES DATA TO THE DEVICE SELECTED BY THE
  1563. * SSF INSTRUCTION. ALL 19 BITS OF THE INSTRUCTION ARE PASSED
  1564. * IN THE FOLLOWING MANNER.
  1565. *
  1566. * OUTPUT DATA FUNC. 1 BITS 01-08
  1567. * OUTPUT DATA FUNC. 2 BITS 09-16
  1568. *
  1569. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1570. *
  1571. *
  1572. * TEST FOR EXISTANCE OF EXTERNAL INTERFACE.
  1573. *
  1574. EXT EQU $
  1575. *
  1576. CALL ESCCTL
  1577. CALL GET3
  1578. DAD H ROTATE UPPER 9 BITS LEFT.
  1579. MOV A,L LOAD BITS 10 THRU 16
  1580. ORA D ADD BIT 09
  1581. CALL EXT.OUT EXT AND OUTPUT TO DEVICE.
  1582. MOV A,E LOAD MIDDLE BITS OF EXT
  1583. JMP EXT.OUT AND OUTPUT TO DEVICE.
  1584. STATEX PUSH A
  1585. LDA EXT.OUT+4 LOAD DEVICE ADDRESS
  1586. ANI #1E IS SERIAL DATA/CONTROL
  1587. CPI #02 IF YES, LOOP
  1588. JNZ EXT.2 OTHERWISE,CONTINUE
  1589. EXT.1 IN EXTCH7*32+EXTSTAT LOOP UNTIL CHARACTER
  1590. ANI #02 REQUEST IS UP
  1591. JZ EXT.1
  1592. EXT.2 POP PSW
  1593. RET
  1594. ************************************************************************
  1595. *
  1596. * MODE 0 IS THE POINT PLOTTING MODE. EACH MODE 0 DATA WORD
  1597. * SPECIFIES THE ADDRESS OF A POINT ON THE DISPLAY TO BE WRITTEN
  1598. * OR ERASED. BIT 02 OF THE LDM INSTRUCTION DETERMINES WHETHER IT
  1599. * IS A WRITE OR ERASE OPERATION
  1600. *
  1601. ************************************************************************
  1602. STA COMMAND+1
  1603. MVI A,#30
  1604. STA COMMAND+2
  1605. LXI H,COMMAND
  1606. *
  1607. POINT2 CALL OUTCOORD GO OUTPUT COORDINATES TO DISPLAY
  1608. *
  1609. POINT3 EQU $
  1610. LDA M.MODE LOAD MODE WRITE ERASE BITS
  1611. RLC
  1612. ANI #06
  1613. OUT DISCHAN*32+DISCON2 SET WRITE ERASE BITS
  1614. MVI A,#A0
  1615. OUT DISCHAN*32+DISCON1 VECT/Y SHORT/X POS
  1616. XRA A
  1617. OUT DISCHAN*32+DISDATA
  1618. MVI A,#F8
  1619. OUT DISCHAN*32+DISCON1 VECTOR/INHIBIT/Y SHORT/ X NE
  1620. XRA A
  1621. OUT DISCHAN*32+DISDATA DECREMENT X AXIS
  1622. RET
  1623. ************************************************************************
  1624. *
  1625. * MODE 1 IS THE VECTOR DRAWING MODE. EACH MODE 1 DATA WORD
  1626. * SPECIFIES THE TERMINATING COORDINATES OF A LINE,THE ORGIN OF
  1627. * WHICH IS CONTAINED IN THE X AND Y REGISTER. THE TERMINAL POINT
  1628. * OF A GIVEN LINE IS ALSO THE ORIGIN OF THE NEXT LINE. LINE
  1629. * ORIGINS CAN BE RELOCATED BY THE LDC INSTRUCTION WITHOUT
  1630. * EXITING FROM MODE 1
  1631. *
  1632. ************************************************************************
  1633. LINE EQU $
  1634. CALL ASSEMBLE LOAD X AND Y COORDINATES.
  1635. *
  1636. LINE1 EQU $
  1637. MVI B,01 LOAD MASK
  1638. MOV A,H LOAD UPPER BIT OF X
  1639. ANA B AND MASK UNWANTED BITS
  1640. MOV H,A
  1641. MOV A,D LOAD UPPER BIT OD Y
  1642. ANA B AND MASK UNWANTED BITS.
  1643. MOV D,A
  1644. SHLD XEND STORE X END POINT
  1645. XCHG
  1646. SHLD YEND STORE Y END POINT
  1647. ************************************************************************
  1648. *
  1649. * VECTOR GENERATOR SUBROUTINE
  1650. *
  1651. ************************************************************************
  1652. *
  1653. * THE ALGORITHM IMPLEMENTED FOR THE VECTOR GENERATOR IS THE
  1654. * UNIT INCREMENT DIGITAL DIFFERENTIAL ANALYZER. THE DDA
  1655. * GENERATES POINTS THAT ARE SPACED ONE UNIT APART ALONG THE
  1656. * AXIS OF GREATER DELTA. THE SPACING IN THE OTHER DIRECTION
  1657. * IS MERELY THE SLOPE. IN EQUATION FORM THE ABOVE CAN BE STATED A
  1658. *
  1659. * Y(0)=Y(I)+1/2 X(0)=X(I)
  1660. * Y(N)=Y(N-1)+DELTA Y/DELTA X X(N)=X(N-1)+1
  1661. *
  1662. * OR
  1663. *
  1664. * X(0)=X(I)+1/2 Y(0)=Y(I)
  1665. * X(N)=X(N-1)+DELTA X/DELTA Y Y(N)=Y(N-1)+1
  1666. *
  1667. * TO PREVENT THE GENERATED LINE FROM BEING BIASED TO LIE
  1668. * ON ONE SIDE OF THE IDEAL LINE THE POINTS ARE ROUNDED TO THE
  1669. * NEAREST INTEGER. ROUNDING IS EQUIVALENT TO ADDING 1/2 TO THE
  1670. * INITIAL VALUE
  1671. *
  1672. ************************************************************************
  1673. *
  1674. * PARAMETER LOCATIONS UPON ENTRY
  1675. *
  1676. * LOCATION USEAGE
  1677. *
  1678. * XREG X BEGINNING POINT
  1679. * XEND X ENDING POINT
  1680. * YREG Y BEGINNING POINT
  1681. * YEND Y ENDING POINT
  1682. *
  1683. * PARAMETER LOCATIONS UPON EXIT
  1684. *
  1685. * XDELTA XEND-XREG OR XREG-XEND
  1686. * YDELTA YEND-YREG OR YREG-YEND
  1687. * SLOPE XDELTA/YDELTA OR YDELTA/XDELTA
  1688. * VECFLAG FLAG
  1689. *
  1690. * BITS 1-3 UNUSED
  1691. * BIT 4 X SIGN (1 NEG 0 PO
  1692. * BIT 5 Y SIGN (1 NEG 0 PO
  1693. * BIT 6 LARGEST DELTA (1=X
  1694. * BIT 7-8 UNUSED
  1695. *
  1696. ************************************************************************
  1697. *
  1698. * WRITE OR ERASE FIRST POINT OF VECTOR
  1699. *
  1700. MVI C,#80 SET VECTOR MODE.
  1701. *
  1702. LDA M.MODE LOAD MODE WRITE ERASE BITS
  1703. RLC
  1704. ANI #06
  1705. OUT DISCHAN*32+DISCON2 SET WRITE/ERASE BITS
  1706. LHLD XREG LOAD CURRENT X COORDINATE
  1707. CALL CALDELX
  1708. LHLD YREG LOAD CURRENT Y COORDINATE
  1709. CALL CALDELY
  1710. ************************************************************************
  1711. *
  1712. * DETERMINE IF 45 DEGREE ANGLE AND IF DELTA X GREATER DELTA Y
  1713. *
  1714. ************************************************************************
  1715. MOV A,L
  1716. ORA H TEST FOR ZERO
  1717. JZ VECTOR6
  1718. VECTOR4A CALL COMPHL
  1719. XCHG
  1720. LHLD XDELTA LOAD DELTA X
  1721. DAD D DELTA Y MINUS DELTA X
  1722. JC VECTOR5 JUMP IF CARRY
  1723. *
  1724. * DELTA Y GREATER THAN DELTA X
  1725. *
  1726. LHLD YDELTA LOAD DELTA Y
  1727. CALL COMPHL
  1728. XCHG
  1729. LHLD XDELTA LOAD DELTA X
  1730. MOV A,C LOAD OUTPUT FUNCTION FOR VECTOR
  1731. JMP VECTOR7 JUMP TO OUTPUT FUNCTION
  1732. *
  1733. * DELTA Y IS EQUAL TO OR LESS THAN DELTA X
  1734. *
  1735. VECTOR5 MOV A,L
  1736. ORA H TEST FOR ZERO
  1737. JZ VECTOR8 JUMP IF ANGLE IS 45 DEGREES
  1738. *
  1739. VECTOR6 LHLD XDELTA LOAD DELTA X
  1740. CALL COMPHL
  1741. XCHG PLACE DIVISOR INTO REGISTER PAIR
  1742. LHLD YDELTA LOAD DELTA Y
  1743. MOV A,C LOAD FLAG
  1744. ADI #20 SET BIT TO INDICATE Y SHORT AXIS
  1745. *
  1746. VECTOR7 OUT DISCHAN*32+DISCON1 OUTPUT CONTROL 1 FUNCTION
  1747. STA VECFLAG
  1748. ************************************************************************
  1749. *
  1750. * FRACTIONAL DIVIDE ROUTINE
  1751. *
  1752. ************************************************************************
  1753. *
  1754. * DIVIDEND REGISTER PAIR HL
  1755. * DIVISOR REGISTER PAIR DE
  1756. * QUOTIENT REGISTER PAIR BC
  1757. *
  1758. ************************************************************************
  1759. DIV0 LXI B,#0040 SET COUNTER TO TEM PLACE ACCURACY
  1760. DIV1 DAD H SHIFT DIVIDEND LEFT ONE PLACE
  1761. SHLD SAVE SAVE DIVIDEND VALUE
  1762. DAD D SUBTRACT DIVISOR FROM DIVIDEND
  1763. JC DIV2 JUMP IF CARRY SET
  1764. *
  1765. LHLD SAVE RESTORE DIDIDEND TO ORIGINAL VALUE
  1766. *
  1767. * THIS CODE SHIFTS QUOTIENT INTO REISTER PAIR BC
  1768. *
  1769. DIV2 EQU $
  1770. MOV A,C
  1771. RAL
  1772. MOV C,A
  1773. MOV A,B
  1774. RAL
  1775. MOV B,A
  1776. *
  1777. JNC DIV1 REPEAT IF NOT COMPLETE.
  1778. *
  1779. * LEFT JUSTIFY FRACTIONAL QUOTIENT
  1780. *
  1781. MOV L,C TRANSFER REG PAIR BC TO REG PAIR HL
  1782. MOV H,B
  1783. *
  1784. DAD H SHIFT REG PAIR HL LEFT SIX PLACES
  1785. DAD H
  1786. DAD H
  1787. DAD H
  1788. DAD H
  1789. DAD H
  1790. *
  1791. XCHG SAVE FRACTIONAL ANSWER
  1792. JMP CALPT1 GO TO CALCULATE POINTS
  1793. ************************************************************************
  1794. *
  1795. * INITIALIZE FOR A 45 DEGREE ANGLE
  1796. *
  1797. ************************************************************************
  1798. VECTOR8 MOV A,C LOAD FUNCTION CODE
  1799. OUT DISCHAN*32+DISCON1 OUTPUT
  1800. STA VECFLAG
  1801. LXI D,#FFFF SET SLOPE TO ALL ONES.
  1802. ************************************************************************
  1803. *
  1804. * THIS ROUTINE CALCULATES INCREMENTAL MOVEMENTS AND
  1805. * OUTPUTS THEM TO THE DISPLAY
  1806. *
  1807. ************************************************************************
  1808. *
  1809. * REGISTER PAIR HL FRACTIONAL PARTIAL SUM
  1810. * REGISTER PAIR DE SLOPE
  1811. * REGISTER PAIR BC LOOP COUNT
  1812. *
  1813. ************************************************************************
  1814. *
  1815. * INITIALIZE LOOP COUNT INTO REGISTER PAIR BC
  1816. *
  1817. CALPT1 LDA VECFLAG
  1818. LHLD XDELTA
  1819. ANI #20 TEST FOR LARGEST DELTA.
  1820. JNZ CALPT2 DELTA X IS LONG AXIS.
  1821. *
  1822. LHLD YDELTA
  1823. CALPT2 EQU $
  1824. MOV C,L
  1825. MOV B,H
  1826. LXI H,#8000 LOAD ROUNDING FACTOR INTO PARTIAL
  1827. MOV A,C TEST FOR LOWER 8 BITS LENGTH EQUA
  1828. ANA A
  1829. JZ CALPT5A
  1830. ************************************************************************
  1831. *
  1832. * INCREMENTAL CALCULATION LOOP
  1833. *
  1834. ************************************************************************
  1835. *
  1836. CALPT5 DAD D SHORT AXIS PLUS SLOPE
  1837. RAR SHIFT CARRY INTO A REGISTER
  1838. OUT DISCHAN*32+DISDATA
  1839. DCR C DECREMENT LOOP COUNT (LOWER 8 BIT
  1840. JNZ CALPT5 JUMP IF NOT COMPLETE
  1841. *
  1842. CALPT5A EQU $
  1843. DCR B DECREMENT UPPER BITS
  1844. JP CALPT5 RETUN IF NOT COMPLETE.
  1845. *
  1846. * PLACE X AND Y END COORDINATES INTO X AND Y REGISTERS
  1847. * WHICH BECOMES THE BEGGINNING POINT OF THE NEXT VECTOR
  1848. *
  1849. CALPT6 EQU $
  1850. LHLD YEND
  1851. XCHG
  1852. LHLD XEND
  1853. *
  1854. JMP POINT2 DISPLAY LAST POINT
  1855. ************************************************************************
  1856. *
  1857. * MODE 2 IS THE LOAD TERMINAL MEMORY MODE. EACH MODE 2 DATA
  1858. * WORD CONTAINS A 16 BIT WORD TO BE STORED IN THE MEMORY
  1859. * LOCATION SPECIFIED BY THE CONTENTS OF THE MEMORY ADDRESS
  1860. * REGISTER. AFTER THE DATA HAS BEEN STORED, THE MEMORY ADDRESS
  1861. * REGISTER IS INCREMENTED BY ONE, THUS DATA CAN BE STORED
  1862. * SEQUENTIALLY IN MEMORY BY TRANSMITTING ONLY MODE 2 DATA WORDS.
  1863. * THE CONTENTS OF THE MEMORY ADDRESS REGISTER CAN BE CHANGED AT
  1864. * ANY TIME WITH THE LDA INSTRUCTION
  1865. * WHEN DISPLAYED ON THE DISPLAY THE DATA APPEARS AS A VERTICAL
  1866. * COLUMN WITH BIT 01 AT THE BOTTOM AND BIT 16 AT THE TOP.
  1867. *
  1868. ************************************************************************
  1869. *
  1870. * ASSEMBLE 16 BIT MODE 2 DATA WORD AND STORE IN CHAR MEMORY
  1871. *
  1872. MEMORY EQU $
  1873. CALL ESCCTL CHECK FOR COMMAND CHANGE
  1874. CALL GET3 GET NEXT 3 BYTES
  1875. DAD H ROTATE LEFT
  1876. MOV A,L FROM
  1877. ORA D SAVE IN
  1878. MOV D,A DE REGISTER PAIR.
  1879. MOV B,H SAVE BLOCK CHECK BITS.
  1880. *
  1881. * STORE DATA WORD INTO CHARACTER MEMORY
  1882. *
  1883. MEMORY1 LHLD MEMREG LOAD CHARACTER MEMORY ADDRESS REG
  1884. CALL CHKRG
  1885. *
  1886. *
  1887. MOV M,E STORE LOWER BYTE INTO MEMORY
  1888. INX H INCREMENT MEMORY ADDRESS REGISTER
  1889. MOV M,D STORE UPPER BYTE INTO MEMORY
  1890. INX H INCREMENT MEMORY ADDRESS REGISTER
  1891. SHLD MEMREG STORE MEMORY ADDRESS
  1892. RET
  1893. *
  1894. MEMORY2 EQU $
  1895. LXI H,BC.REG LOAD ADDRESS OF BLOCK CHECK REGISTER
  1896. MOV A,E LOAD LOWER BYTE OF DATA
  1897. CALL BLK.CHK DO BLOCK CHECK ROUTINE.
  1898. *
  1899. MOV A,D LOAD UPPER BYTE OF DATA
  1900. * THIS ROUTINE CALCULATES THE BLOCK CHECK AND TEST RESULTS.
  1901. * IF RESULTS ARE INCORRECT, A UNSOLICITED STATUS IS TRANSMITTED,
  1902. * TELLING THE PLATO SYSTEM TO RETRANSMIT THE BLOCK OF DATA.
  1903. BLK.CHK EQU $
  1904. XRA M DO EXCLUSIVE OR
  1905. RLC AND ROTATE RESULTS.
  1906. MOV M,A STORE RESULTS AS NEW CHECK VALUE.
  1907. ORA M TEST BLOCK CHECK RESULT
  1908. MOV A,B LOAD BLOCK CHECK BITS
  1909. RAR AND TEST FOR BLOCK CHECK THIS BYTE.
  1910. MOV B,A SAVE BLOCK CHECK BITS.
  1911. RNC NO CHECK, GET NEXT BYTE.
  1912. RZ BLOCK CHECK CORRECT.
  1913. MOV M,00
  1914. LXI H,#0385 LOAD UNSOLICITED STATUS
  1915. CALL P.XMIT
  1916. RET
  1917. ************************************************************************
  1918. *
  1919. * MODE 3 - CHARACTER MODE ONLINE ENTRY
  1920. * IF NOT ESC OR CTL CODE BUILD
  1921. * COMMAND - CODE/ESC/#30
  1922. *
  1923. CHARACT EQU $
  1924. CALL ESCCTL
  1925. MOV A,C
  1926. STA COMMAND
  1927. MVI A,#1B
  1928. STA COMMAND+1
  1929. MVI A,#30
  1930. STA COMMAND+2
  1931. LXI H,COMMAND
  1932. CALL R.CHARS
  1933. RET
  1934. ************************************************************************
  1935. *
  1936. * MODE 4 IS BLOCK ERASE EACH PAIR OF DATA WORDS SPECIFIES
  1937. * THE CORNERS OF AN AREA TO BE ERASED. THE AREA ERASED IS THAT
  1938. * ENCLOSED BY THE ABSOLUTE VALUE OF X2-X1 AND Y2-Y1.
  1939. *
  1940. *
  1941. * X1,Y1
  1942. *
  1943. * ****************************************
  1944. * * *
  1945. * * *
  1946. * * *
  1947. * * *
  1948. * * AREA ERASED
  1949. * * *
  1950. * * *
  1951. * * *
  1952. * * *
  1953. * ****************************************
  1954. *
  1955. * X2,Y2
  1956. *
  1957. ************************************************************************
  1958. BLOCK EQU $
  1959. MVI C,04 LOAD TRANSFER COUNT.
  1960. LXI D,BLOCKX LOAD DESTINATION ADDRESS.
  1961. *
  1962. BLOC1 EQU $
  1963. MOV A,M LOAD X/Y DATA
  1964. STAX D AND STORE FOR PROCESSING,
  1965. INX H INCREMENT SOURCE ADDRESS
  1966. INX D INCREMENT DESTINATION ADDRESS.
  1967. MOV A,M LOAD UPPER BITS
  1968. ANI 01 MASK FOR BIT 9 OF COORDINATE.
  1969. STAX D AND STORE.
  1970. INX H INCREMENT TO
  1971. INX D NEXT ADDRESS.
  1972. DCR C DECREMENT COUNT
  1973. JZ MODE4A PROCESS DTAT IF COUNT ZERO
  1974. JMP BLOC1 ELSE GET NEXT BYTE.
  1975. ************************************************************************
  1976. *
  1977. * CALCULATE ABSOLUTE DELTA X AND Y
  1978. *
  1979. ************************************************************************
  1980. *
  1981. * PARAMETER LOCATIONS UPON ENTRY
  1982. *
  1983. * BLOCKX X1 COORDINATE
  1984. * BLOCKY Y1 COORDINATE
  1985. * XEND X2 COORDINATE
  1986. * YEND Y2 COORDINATE
  1987. *
  1988. ************************************************************************
  1989. MODE4A MVI C,#00 CLEAR DIRECTION FLAGS
  1990. LHLD BLOCKX
  1991. CALL CALDELX CALCULATE DELTA X
  1992. LHLD BLOCKY
  1993. CALL CALDELY CALCULATE DELTA Y
  1994. MOV A,C
  1995. STA BLOCKF SAVE DIRECTION FLAGS
  1996. *
  1997. * TEST FOR POSITIVE DELTA Y
  1998. *
  1999. ANI #10 MASK OFF X DIRECTION BIT
  2000. LHLD BLOCKY LOAD Y1 COORDINATE
  2001. JNZ YSTART
  2002. *
  2003. NEGY LHLD YEND LOAD Y2 COORDINATE
  2004. *
  2005. * SET Y STARTING ADDRESS
  2006. *
  2007. YSTART MOV A,L
  2008. OUT DISCHAN*32+YCOORD OUTPUT Y START ADDRESS
  2009. IN DISCHAN*32+XYREAD GET X REGISTER BIT 9
  2010. ANI #01
  2011. MOV L,A SAVE X REGISTER BIT 9
  2012. MOV A,H
  2013. RLC
  2014. ORA L ADD X REGISTER BIT 9
  2015. ADI #04 ADD ENABLE LOAD COORDINATE BIT
  2016. OUT DISCHAN*32+DISCON1
  2017. *
  2018. * SET WRITE/ERASE BITS
  2019. *
  2020. LDA M.MODE LOAD MODE WRITE ERASE BITS
  2021. RLC
  2022. ANI #06
  2023. OUT DISCHAN*32+DISCON2
  2024. *
  2025. LHLD YDELTA LOAD NUMBER OF LINES
  2026. INX H
  2027. XCHG
  2028. LHLD XDELTA
  2029. INX H
  2030. SHLD XSAVE SAVE COORDIMATE.
  2031. *
  2032. * TEST FOR POSITIVE DELTA X
  2033. *
  2034. LDA BLOCKF
  2035. ANI #08 MASK OFF Y DIRECTION BIT
  2036. LHLD BLOCKX LOAD X1 COORDINATE
  2037. JZ NEGX1
  2038. *
  2039. NEGX LHLD XEND LOAD X2 COORDINATE
  2040. NEGX1 MOV A,H
  2041. ANI #01 MASK IF WRAP AROUND
  2042. MOV B,A
  2043. MOV C,L
  2044. ************************************************************************
  2045. *
  2046. * BLOCK WRITE/ERASE INCREMENTAL LOOP
  2047. *
  2048. ************************************************************************
  2049. *
  2050. * REGISTER PAIR BC BASELINE ADDRESS FOR X
  2051. * REGISTER PAIR HL NUMBER OF POINTS PER LINE
  2052. * REGISTER PAIR DE NUMBER OF LINES PER BLOCK
  2053. *
  2054. ************************************************************************
  2055. *
  2056. * RESET X BASELINE ADDRESS FOR NEXT LINE
  2057. *
  2058. XSTART MOV A,C
  2059. OUT DISCHAN*32+XCOORD OUTPUT BASELINE ADDRESS LOWER 8
  2060. IN DISCHAN*32+XYREAD GET Y REGISTER BIT 9
  2061. ANI #02 SAVE Y REGISTER BIT 9
  2062. ADD B
  2063. ADI #A4 VEC/XPOS/YPOS/YSHORT/ENABLE
  2064. OUT DISCHAN*32+DISCON1
  2065. LHLD XSAVE LOAD NUMBER OF POINTS PER LINE
  2066. *
  2067. *
  2068. PUSH B SAVE BC ON STACK
  2069. LXI B,#FFF8 AND LOAD -8
  2070. *
  2071. BLKER.1 EQU $
  2072. MOV A,C TEST FOR GREATER THAN
  2073. ANA L EIGHT FOR FAST ERASE.
  2074. JZ BLKER.3 LESS THAN, TEST UPPER BIT.
  2075. XRA A CLEAR A REGISTER
  2076. *
  2077. BLKER.2 EQU $
  2078. OUT DISCHAN*32+DISDATA
  2079. OUT DISCHAN*32+DISDATA BLOCK ERASE/WRITE
  2080. OUT DISCHAN*32+DISDATA
  2081. OUT DISCHAN*32+DISDATA
  2082. OUT DISCHAN*32+DISDATA
  2083. OUT DISCHAN*32+DISDATA
  2084. OUT DISCHAN*32+DISDATA
  2085. OUT DISCHAN*32+DISDATA
  2086. DAD B SUBTRACT EIGHT FROM COUNT.
  2087. CMP L AND TEST FOR ZERO
  2088. JNZ BLKER.1 NOT ZERO, DO AGAIN.
  2089. *
  2090. BLKER.3 EQU $
  2091. CMP H AND TEST UPPER BIT OF COUNT.
  2092. JNZ BLKER.2 NOT ZERO, OUTPUT ANOTHER EIGHT.
  2093. *
  2094. POP B RESTORE BC REGISTERS
  2095. CMP L AND TEST FOR ZERO COUNT.
  2096. JZ BLOCK2 COMPLETED, TEST Y AXIS.
  2097. BLOCK1 OUT DISCHAN*32+DISDATA
  2098. DCR L
  2099. JNZ BLOCK1 JUMP IF LINE NOT COMPLETE
  2100. *
  2101. *
  2102. * TEST FOR COMPLETION OF BLOCK
  2103. *
  2104. BLOCK2 EQU $
  2105. DCX D DECREMENT THE LINE COUNT
  2106. MOV A,E AND TEST FOR
  2107. ORA D LAST LINE COMPLETED.
  2108. JZ BLOCK4 COMPLETED, END BLOCK WRITE/EREASE.
  2109. *
  2110. * INCREMENT Y AXIS BY ONE
  2111. *
  2112. BLOCK3 EQU $
  2113. MVI A,#D0 VEC/INHIBIT/XSHORT/YNEG
  2114. OUT DISCHAN*32+DISCON1
  2115. XRA A CLEAR A REGISTER
  2116. OUT DISCHAN*32+DISDATA INCREMENT Y AXIS
  2117. JMP XSTART
  2118. *
  2119. BLOCK4 EQU $
  2120. LHLD BLOCKY LOAD Y1 COORDINATE
  2121. LXI D,#FFF1 SET TO MINUS 15
  2122. DAD D Y1 MINUS 15
  2123. CALL OUTY OUTPUT Y COORDINATE.
  2124. LHLD BLOCKX LOAD X COORDINATE
  2125. JMP OUTX OUTPUT X COORDINATE.
  2126. * * * * * * * * * * * * * * * * * * * * * * * *
  2127. *
  2128. * THESE MODES ARE RESERVED FOR USE BY THE USER. USING 7ODE 2,
  2129. * THE USER MAY LOAD A ROUTINE INTO THAT AREA OF MEMORY ALLOCATED
  2130. * FOR HIS USE.THE ADDRESS OF THAT ROUTINE IS LOADED UNDER
  2131. * MODE 5 ,6, OR 7 TAG.
  2132. * BY USING THE LDM INSTRUCTION, THE USER CAN CALL THAT ROUTINE.
  2133. * THE USER MUST EXIT THE ROUTINE WITH A RETURN INSTRUCTION
  2134. * TO INSURE THAT CONTROL IS PASSED CORRECTLY TO THE
  2135. * RESIDENT FIRMWARE.
  2136. *
  2137. * * * * * * * * * * * * * * * * * * * * * * * *
  2138. *
  2139. MODE5 EQU *
  2140. CALL ESCCTL
  2141. LHLD MODE5A
  2142. JMP MODESEL SELECT MODE WITH HL JUMP.
  2143. *
  2144. MODE6 EQU *
  2145. CALL ESCCTL
  2146. LHLD MODE6A
  2147. JMP MODESEL SELECT MODE WITH HL JUMP.
  2148. *
  2149. MODE7 EQU *
  2150. CALL ESCCTL
  2151. LHLD MODE7A
  2152. *
  2153. MODESEL EQU $
  2154. SHLD MODEADR SAVE ABSOLUTE MODE ADDRESS
  2155. CALL GET3 GET NEXT 3 BYTES
  2156. DAD H AND SHOFT
  2157. MOV C,H IT INTO
  2158. MOV A,L REGISTERS
  2159. ORA D C, D, AND E.
  2160. MOV D,A
  2161. LHLD MODEADR RETURN ABSOLUTE MODE ADDRESS
  2162. PCHL
  2163. MODE567 EQU *
  2164. MOV A,C
  2165. SBI #4F
  2166. MOV C,A
  2167. LDA MODE UPDATE MODE
  2168. ANI #C0
  2169. ORA C
  2170. STA MODE
  2171. MOV A,C
  2172. ADD A
  2173. ADD A
  2174. MOV C,A
  2175. LDA M.MODE UPDATE M.MODE
  2176. ANI #E3
  2177. ORA C
  2178. STA M.MODE
  2179. XRA A
  2180. STA NBYTES
  2181. RET
  2182. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2183. *
  2184. * S U B R O U T I N E S
  2185. *
  2186. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2187. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2188. *
  2189. * SIZE ONE CHARACTER GENERATOR
  2190. *
  2191. * THIS ROUTINE OUTPUTS TWO BYTES OF A 8 X 16 CHARACTER
  2192. * TO THE DISPLAY.
  2193. *
  2194. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2195. TWICE XRA A SET ZERO FLAG
  2196. CHAR.S1 EQU $
  2197. LDAX D LOAD BYTE OF CHARACTER DATA
  2198. INX D INCREMENT CHARACTER ADDRESS
  2199. OUT DISCHAN*32+DISDATA OUTPUT BYTE
  2200. RAR
  2201. OUT DISCHAN*32+DISDATA OUTPUT
  2202. RAR
  2203. OUT DISCHAN*32+DISDATA CHARACTER
  2204. RAR
  2205. OUT DISCHAN*32+DISDATA DATA
  2206. RAR
  2207. OUT DISCHAN*32+DISDATA
  2208. RAR
  2209. OUT DISCHAN*32+DISDATA
  2210. RAR
  2211. OUT DISCHAN*32+DISDATA
  2212. RAR
  2213. OUT DISCHAN*32+DISDATA
  2214. RZ RETURN AFTER SECOND PASS
  2215. JMP TWICE
  2216. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2217. *
  2218. * SIZE TWO CHARACTER GENERATOR
  2219. *
  2220. * THIS ROUTINE OUTPUTS TWO BYTES OF A 16 X 32 CHARACTER
  2221. * TO THE DISPLAY.
  2222. *
  2223. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2224. TWICE1 XRA A SET ZERO FLAG
  2225. CHAR.S2 EQU $
  2226. LDAX D LOAD CHARACTER DATA BYTE
  2227. INX D INCREMENT DATA ADDRESS
  2228. OUT DISCHAN*32+DISDATA
  2229. OUT DISCHAN*32+DISDATA
  2230. RAR
  2231. OUT DISCHAN*32+DISDATA
  2232. OUT DISCHAN*32+DISDATA
  2233. RAR
  2234. OUT DISCHAN*32+DISDATA
  2235. OUT DISCHAN*32+DISDATA
  2236. RAR
  2237. OUT DISCHAN*32+DISDATA
  2238. OUT DISCHAN*32+DISDATA
  2239. RAR
  2240. OUT DISCHAN*32+DISDATA
  2241. OUT DISCHAN*32+DISDATA
  2242. RAR
  2243. OUT DISCHAN*32+DISDATA
  2244. OUT DISCHAN*32+DISDATA
  2245. RAR
  2246. OUT DISCHAN*32+DISDATA
  2247. OUT DISCHAN*32+DISDATA
  2248. RAR
  2249. OUT DISCHAN*32+DISDATA
  2250. OUT DISCHAN*32+DISDATA
  2251. JNZ TWICE1 CHECK FOR SECOND PASS
  2252. MOV A,B LOAD COLUMN COUNT
  2253. RAR AND TEST FOR
  2254. RC
  2255. DCX D DECREMENT THE DATA
  2256. DCX D POINTER
  2257. RET
  2258. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2259. *
  2260. * DISPLAY TAB ROUTINE.
  2261. *
  2262. * THIS ROUTINE SET THE X AND Y REGISTERS TO TAB FOR
  2263. * THE NEXT CHARACTER POSITION.
  2264. *
  2265. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2266. DISP.TAB EQU $
  2267. LHLD XREG LOAD CURRENT X
  2268. XCHG AND SAVE IN DE
  2269. LHLD X.PLOT LOAD X CHARACTER PLOT
  2270. DAD D ADD TO CURRENT X
  2271. CALL OUTX OUTPUT X COORDINATE.
  2272. LHLD YREG LOAD CURREMT Y
  2273. XCHG AND SAVE IN DE
  2274. LHLD Y.PLOT LOAD Y CHARACTER PLOT
  2275. DAD D ADD TO CURRENT Y
  2276. JMP OUTY OUTPUT Y COORDINATE.
  2277. * * * * * * * * * * * * * * * * * * * * * * * *
  2278. *
  2279. * INPUT X COORDINATE TO HL REGISTER PAIR.
  2280. *
  2281. * * * * * * * * * * * * * * * * * * * * * * * *
  2282. INPX EQU $
  2283. IN DISCHAN*32+XREAD INPUT LOWER BITS OF X
  2284. MOV L,A AND SAVE IN L REGISTER.
  2285. IN DISCHAN*32+XYREAD NPUT UPPER BIT
  2286. ANI 01 MASK
  2287. MOV H,A AND SAVE IN H REGISTER.
  2288. RET RETURN TO CALLER.
  2289. * * * * * * * * * * * * * * * * * * * * * * * *
  2290. *
  2291. * INPUT Y COORDINATE TO HL REGISTER PAIR.
  2292. *
  2293. * * * * * * * * * * * * * * * * * * * * * * * *
  2294. INPY EQU $
  2295. IN DISCHAN*32+YREAD INPUT LOWER BITS OF Y
  2296. MOV L,A AND SAVE IN L REGISTER.
  2297. IN DISCHAN*32+XYREAD NPUT UPPER BIT
  2298. ANI 02 MASK
  2299. RRC
  2300. MOV H,A AND SAVE IN H REGISTER.
  2301. RET RETURN TO CALLER.
  2302. * * * * * * * * * * * * * * * * * * * * * * * *
  2303. *
  2304. * SUBROUTINE TO STEP Y AXIS.
  2305. *
  2306. * * * * * * * * * * * * * * * * * * * * * * * *
  2307. STEPY EQU $
  2308. CALL INPY INPUT CURRENT Y COORDINATE.
  2309. *
  2310. LDA M.DIR LOAD STEP DIRECTION BIT
  2311. ANI 01 AND MASK
  2312. INX H INCREMENT COORDINATE
  2313. JZ OUTY AND OUTPUT.
  2314. *
  2315. DCX H ELSE DECREMENT
  2316. DCX H COORDINATE
  2317. JMP OUTY AND OUTPUT
  2318. * * * * * * * * * * * * * * * * * * * * * * * *
  2319. *
  2320. * SUBROUTINE TO STEP X AXIS
  2321. *
  2322. * * * * * * * * * * * * * * * * * * * * * * * *
  2323. STEPX EQU $
  2324. CALL INPX INPUT CURRENT X COORDINATE.
  2325. *
  2326. LDA M.DIR LOAD STEP DIRECTION BIT
  2327. ANI 02 AND MASK
  2328. INX H INCREMENT COORDINATE
  2329. JZ OUTX AND OUTPUT.
  2330. *
  2331. DCX H ELSE DECREMENT
  2332. DCX H COORDINATE
  2333. JMP OUTX AND OUTPUT
  2334. * * * * * * * * * * * * * * * * * * * * * * * *
  2335. *
  2336. * SUBROUTINE TO OUTPUT X COORDINATE TO THE DISPLAY.
  2337. *
  2338. * * * * * * * * * * * * * * * * * * * * * * * *
  2339. OUTX EQU $
  2340. MVI A,01 CHOP OFF UNWANTED
  2341. ANA H BITS THAT WILL
  2342. MOV H,A SCREW THINGS UP.
  2343. SHLD XREG STORE NEW X COORDINATE.
  2344. MOV A,L LOAD LOWER 8 BITS
  2345. OUT DISCHAN*32+XCOORD ND OUTPUT TO DISPLAY.
  2346. IN DISCHAN*32+XYREAD PUT UPPER BITS OF X AND Y
  2347. ANI 02 MASK Y
  2348. ORA H INCLUDE NEW X BIT
  2349. ORI 04 SET LOAD ENABLE
  2350. OUT DISCHAN*32+DISCON1 OUTPUT UPPER BITS OF X AND Y.
  2351. RET RETURN TO CALLER
  2352. * * * * * * * * * * * * * * * * * * * * * * * *
  2353. *
  2354. * SUBROUTINE TO OUTPUT Y COORDINATE TO THE DISPLAY.
  2355. *
  2356. * * * * * * * * * * * * * * * * * * * * * * * *
  2357. OUTY EQU $
  2358. MVI A,01 CHOP OFF UNWANTED
  2359. ANA H BITS THAT WILL
  2360. MOV H,A SCREW THINGS UP.
  2361. SHLD YREG STORE NEW Y COORDINATE.
  2362. MOV A,L LOAD LOWER 8 BITS
  2363. OUT DISCHAN*32+YCOORD ND OUTPUT TO DISPLAY.
  2364. IN DISCHAN*32+XYREAD NPUT CURRENT UPPER BITS
  2365. ANI 01 MASK X COORDINATE BIT
  2366. RRC SHIFT IN
  2367. ORA H NEW Y BIT
  2368. RLC
  2369. ORI 04 SET LOAD ENABLE BIT
  2370. OUT DISCHAN*32+DISCON1 OUTPUT NEW UPPER BITS
  2371. RET RETURN TO CALLER.
  2372. * * * * * * * * * * * * * * * * * * * * * * * *
  2373. *
  2374. * OUTPUT X AND Y COORDINATES .
  2375. * Y COORDINATE DE REGISTER PAIR
  2376. * X COORDINATE HL REGISTER PAIR
  2377. *
  2378. * * * * * * * * * * * * * * * * * * * * * * * *
  2379. OUTCOORD EQU $
  2380. CALL OUTX SET X COORDINATE.
  2381. XCHG
  2382. JMP OUTY SET Y COORDINATE.
  2383. * * * * * * * * * * * * * * * * * * * * * * * *
  2384. *
  2385. * USED TO CALL A ROUTINE WITH CONTENTS OF HL REGISTERS.
  2386. *
  2387. * * * * * * * * * * * * * * * * * * * * * * * *
  2388. INDIRECT EQU $
  2389. PCHL
  2390. *
  2391. NOOP EQU $
  2392. RET
  2393. * * * * * * * * * * * * * * * * * * * * * * * *
  2394. *
  2395. * STORE DIRECTION BITS FOR COORDINATE STEP ROUTINES.
  2396. *
  2397. * * * * * * * * * * * * * * * * * * * * * * * *
  2398. DIR EQU $
  2399. SHLD M.DIR STORE STEP DIRECTION BITS
  2400. RET
  2401. * * * * * * * * * * * * * * * * * * * * * * * *
  2402. *
  2403. * INPUT DATA TO USER INSTEAD OF TRANSMITING.
  2404. *
  2405. * * * * * * * * * * * * * * * * * * * * * * * *
  2406. INPUT EQU $
  2407. LXI H,US.FIFO LOAD USER FIFO ADDRESS
  2408. JMP FIFO.RD AND GET DATA.
  2409. INDATA EQU $
  2410. LXI H,IN.BUF LOAD KB/TP INPUT BUFFER
  2411. JMP FIFO.RD
  2412. * * * * * * * * * * * * * * * * * * * * * * * *
  2413. * * * * * * * * * * * * * * * * * * * * * * * *
  2414. ENAB EQU $
  2415. STA M.ENAB STORE INTERRUPT MASK
  2416. RLC
  2417. RLC
  2418. RLC TO OUTPUT
  2419. OUT TPCHAN*32+TPCONT TOUCH PANEL.
  2420. *
  2421. RLC AND ROTATE TO
  2422. RLC EXTERNAL BIT.
  2423. ANI 01
  2424. ORI 01 ALWAYS ENABLE EXT CHANNEL
  2425. OUT EXTCH5*32+EXTCNTL ABLE EXTERNAL DEVICE.
  2426. RET
  2427. *
  2428. GET3 EQU $
  2429. MVI A,#3F
  2430. ANA C
  2431. MOV C,A
  2432. LDA NBYTES
  2433. CPI #02
  2434. JNZ GET3.1
  2435. MOV A,C
  2436. STA COMMAND STORE HIGH 6 BITS
  2437. XRA A
  2438. STA NBYTES
  2439. STA CMODE
  2440. CALL ASSEMBLE
  2441. RET
  2442. GET3.1 EQU $
  2443. CPI #01
  2444. JNZ GET3.2
  2445. MOV A,C
  2446. STA COMMAND+1 STORE MIDDLE 6 BITS
  2447. JMP GET3.R
  2448. GET3.2 EQU $
  2449. MOV A,C
  2450. STA COMMAND+2 STORE LOWER 6 BITS
  2451. GET3.R EQU $
  2452. LXI H,NBYTES
  2453. INR M
  2454. POP H
  2455. RET
  2456. ASSEMBLE EQU $
  2457. LDA COMMAND+2 LOAD LOWER 6 BITS OF INPUT
  2458. MOV E,A
  2459. LDA COMMAND+1
  2460. RRC
  2461. RRC
  2462. MOV C,A
  2463. ANI #C0 MASK ALL BITS BUT Y COORDINATE
  2464. ADD E
  2465. MOV E,A STORE LOWER 8 BITS Y COORDINATE
  2466. MOV A,C
  2467. ANI #01
  2468. MOV D,A STORE BIT 9 OF Y COORDINATE
  2469. MOV A,C
  2470. RRC
  2471. ANI #07
  2472. MOV L,A STORE LOWER 3 BITS OF X COORDINAT
  2473. LDA COMMAND LOAD UPPER BITS OF INPUT.
  2474. RLC
  2475. RLC
  2476. RLC
  2477. MOV C,A
  2478. ANI #F8
  2479. ADD L
  2480. MOV L,A STORE LOWER 8 BITS X COORD
  2481. MOV A,C
  2482. ANI #01
  2483. MOV H,A STORE BIT 9 OF X COORD
  2484. RET
  2485. * * * * * * * * * * * * * * * * * * * * * * * *
  2486. *
  2487. * THIS ROUTINE LOADS THE FIRST-IN-FIRST OUT BUFFER.
  2488. * * * * * * * * * * * * * * * * * * * * * * * *
  2489. FIFO.ST EQU $
  2490. MVI A,#C0 MASK CATAGORY BITS
  2491. ANA H FOR DATA
  2492. XCHG SAVE DATA INDE REGISTERS.
  2493. *
  2494. RLC ROTATE CATAGORY BITS
  2495. RLC
  2496. MOV B,A AND SAVE IN B REGISTER.
  2497. *
  2498. MVI A,03 MASK OFF
  2499. ANA D FLAG
  2500. MOV D,A BITS.
  2501. LDA M.KSW LOAD USER/PLATO FLAG.
  2502. ANA B TEST TO DETERMINE USER OR TRANSMIT B
  2503. LXI H,IN.BUF LOAD ADDRESS OF KB/TP INB
  2504. JZ FIFOS.1 AND STORE FOR TRANSMIT.
  2505. *
  2506. LXI H,US.FIFO LOAD ADDRESS OF USER BUFFER, BIT SET.
  2507. *
  2508. FIFOS.1 EQU $
  2509. MVI A,07 AND TEST FOR
  2510. CMP M FULL BUFFRR.
  2511. RZ BUFFER FULL, RETURN TO CALLER.
  2512. *
  2513. INR M NOT FULL, ADD ONE TO DIFF. COUNTER.
  2514. INX H INCREMENT TO INPUT POINTER.
  2515. ANA M MASK LOWER BITS,
  2516. RLC AND SET FOR TWO BYTE ADDRESSING.
  2517. INR M ADD ONE TO INPOINTER.
  2518. MVI B,00 LOAD BC REGISTERS
  2519. MOV C,A WITH INPUT INDEX.
  2520. INX H INCREMENT TO START OF
  2521. INX H BUFFER STORE AREA.
  2522. DAD B ADD INDEX TO BASE ADDRESS.
  2523. MOV M,E STORE LOWER BITS.
  2524. INX H
  2525. MOV M,D STORE UPPER BITS.
  2526. RET RETURN TO CALLER.
  2527. *
  2528. *
  2529. * READ DATA FROM TRANSMIT BUFFER.
  2530. *
  2531. FIFO.RD EQU $
  2532. XRA A CLEAR A, AND
  2533. CMP M TEST FOR DATA IN FIFO.
  2534. LXI D,#8000 LOAD NO DATA CODE
  2535. XCHG
  2536. RZ RETURN IF NO DATA.
  2537. XCHG
  2538. DCR M SUBTRACT ONE FOOM DIFF.COUNT
  2539. INX H INCREMENT TO
  2540. INX H OUTPUT POINTER.
  2541. MVI A,07 MASK POINTER
  2542. ANA M TO LOWER BITS
  2543. RLC AND SET FOR TWO BYTE ADDRESSING.
  2544. INR M INCREMENT POINTER
  2545. MVI D,00 LOAD DE WITH
  2546. MOV E,A INDEX TO BUFFER.
  2547. INX H INCREMENT TO START OF STORE AREA.
  2548. DAD D ADD INDEX TO START OF BUFFER
  2549. MOV E,M LOAD LOWER BITS
  2550. INX H INCREMENT ADDRESS
  2551. MOV D,M LOAD UPPER BITS.
  2552. XCHG PLACE IN HL FOR TRANSFER.
  2553. RET RETURN TO CALLER.
  2554. * * * * * * * * * * * * * * * * * * * * * * * *
  2555. *
  2556. * CALCULATE START AND END POINT DIFFERANCE
  2557. *
  2558. * * * * * * * * * * * * * * * * * * * * * * * *
  2559. CALDELX EQU $
  2560. XCHG
  2561. LHLD XEND LOAD END POINT
  2562. MVI B,#08 LOAD PLOTTING BIT
  2563. CALL CALDEL DO CALCULATION.
  2564. SHLD XDELTA STORE START AND END DIFFERANCE.
  2565. RET
  2566. *
  2567. *
  2568. CALDELY EQU $
  2569. XCHG
  2570. LHLD YEND LOAD END POINT
  2571. MVI B,#10 LOAD PLOTTING BIT
  2572. CALL CALDEL DO CALCULATION.
  2573. SHLD YDELTA STORE START AND END DIFFERANCE.
  2574. RET
  2575. *
  2576. SAVESTUF EQU $
  2577. CALL R.INPX SAVE SCREEN POSITIONING
  2578. SHLD G.XPOS
  2579. CALL R.INPY
  2580. SHLD G.YPOS
  2581. RET
  2582. *
  2583. RESTORES EQU $
  2584. LHLD G.XPOS RESTORE SCREEN POSITIONING
  2585. CALL R.OUTX
  2586. LHLD G.YPOS
  2587. CALL R.OUTY
  2588. RET
  2589. *
  2590. XHAIR EQU $
  2591. CALL SAVESTUF
  2592. LDA WIDTH
  2593. RRC
  2594. MOV L,A
  2595. MVI H,00
  2596. CALL COMPHL
  2597. XCHG
  2598. CALL R.INPX
  2599. DAD D
  2600. CALL R.OUTX
  2601. LDA HEIGHT
  2602. RRC
  2603. MOV L,A
  2604. MVI H,00
  2605. CALL COMPHL
  2606. XCHG
  2607. CALL R.INPY
  2608. DAD D
  2609. CALL R.OUTY
  2610. MVI C,#61
  2611. CALL DISCURSX
  2612. CALL RESTORES
  2613. RET
  2614. *
  2615. GIN EQU $ COMM LINE ENTRY TO GIN MODE
  2616. CALL ESCCTL
  2617. RET
  2618. *
  2619. GIN.A EQU $ KEYBOARD ENTRY TO GIN MODE
  2620. CALL ESCCTL IS ESC SEQ. OR CTL CODE
  2621. MOV A,C
  2622. STA GIN.KEY SAVE GIN CHAR. KEY
  2623. ANI #20 2 TO THE FIFTH SET'/
  2624. JNZ GIN.1
  2625. MVI B,4 COURSE GRID
  2626. JMP GIN.2
  2627. GIN.1 EQU $
  2628. MVI B,1 FINE GRID
  2629. GIN.2 EQU $
  2630. MOV A,B
  2631. STA DOTS STORE GRID MOVEMENT VALUE
  2632. MOV A,C CHARACTER CODE IN C
  2633. ANI #DF CODE MASKED OUT 2 TO 5TH
  2634. MOV B,A IN REGISTER B.
  2635. LXI H,MOVTAB BASE OF CURSOR MOVE TABLE
  2636. GIN.3 EQU $
  2637. MOV A,M
  2638. CPI #FF
  2639. JZ GIN.XMT NOT A CURSOR MOVE KEY
  2640. CMP B CHECK FOR CURSOR MOVE KEY
  2641. JZ MOVCURS
  2642. INX H
  2643. INX H
  2644. INX H
  2645. JMP GIN.3
  2646. MOVCURS EQU $
  2647. INX H MATCH FOUND SO JUMP TO
  2648. MOV E,M CURSOR MOVE ROUTINE.
  2649. INX H
  2650. MOV D,M
  2651. PUSH D SAVE DE ON STACK
  2652. LDA ECURSOR ERASE CURSOR
  2653. MOV B,A
  2654. CALL DISCURS
  2655. POP H
  2656. CALL JMPHL
  2657. RET
  2658. *
  2659. GIN.XMT EQU $
  2660. LDA LOC.RMT TEST FOR ONLINE
  2661. ORA A
  2662. RNZ RETURN, NOT ONLINE
  2663. LDA GIN.KEY SEND LAST KEY STORED
  2664. MOV C,A
  2665. CALL XMIT.1
  2666. CALL ENQ.1 TRANSMIT CURSOR POSITION
  2667. RET
  2668. *
  2669. *
  2670. MOVTAB EQU $
  2671. DB #41
  2672. DW WEST
  2673. DB #43
  2674. DW SEAST
  2675. DB #44
  2676. DW EAST
  2677. DB #45
  2678. DW NEAST
  2679. DB #51
  2680. DW NWEST
  2681. DB #57
  2682. DW NORTH
  2683. DB #58
  2684. DW SOUTH
  2685. DB #5A
  2686. DW SWEST
  2687. DB #FF
  2688. *
  2689. WEST EQU $
  2690. CALL MINUSX
  2691. RET
  2692. *
  2693. SEAST EQU $
  2694. CALL PLUSX
  2695. CALL MINUSY
  2696. RET
  2697. *
  2698. EAST EQU $
  2699. CALL PLUSX
  2700. RET
  2701. *
  2702. NEAST EQU $
  2703. CALL PLUSX
  2704. CALL PLUSY
  2705. RET
  2706. *
  2707. NWEST EQU $
  2708. CALL MINUSX
  2709. CALL PLUSY
  2710. RET
  2711. *
  2712. NORTH EQU $
  2713. CALL PLUSY
  2714. RET
  2715. *
  2716. SOUTH EQU $
  2717. CALL MINUSY
  2718. RET
  2719. *
  2720. SWEST EQU $
  2721. CALL MINUSX
  2722. CALL MINUSY
  2723. RET
  2724. *
  2725. MINUSX EQU $
  2726. LDA DOTS
  2727. MOV L,A
  2728. MVI H,00
  2729. CALL COMPHL
  2730. PUSH H
  2731. CALL R.INPX
  2732. POP D
  2733. DAD D
  2734. CALL R.OUTX
  2735. RET
  2736. *
  2737. MINUSY EQU $
  2738. LDA DOTS
  2739. MOV L,A
  2740. MVI H,00
  2741. CALL COMPHL
  2742. PUSH H
  2743. CALL R.INPY
  2744. POP D
  2745. DAD D
  2746. CALL R.OUTY
  2747. RET
  2748. *
  2749. PLUSX EQU $
  2750. LDA DOTS
  2751. MOV L,A
  2752. MVI H,00
  2753. PUSH H
  2754. CALL R.INPX
  2755. POP D
  2756. DAD D
  2757. CALL R.OUTX
  2758. RET
  2759. *
  2760. PLUSY EQU $
  2761. LDA DOTS
  2762. MOV L,A
  2763. MVI H,00
  2764. PUSH H
  2765. CALL R.INPY
  2766. POP D
  2767. DAD D
  2768. CALL R.OUTY
  2769. RET
  2770. *
  2771. *
  2772. GIN.TP EQU $
  2773. PUSH D SAVE DATA ON STACK
  2774. LDA ECURSOR ERASE CURSOR
  2775. MOV B,A
  2776. CALL DISCURS
  2777. POP D RESTORE DATA
  2778. PUSH D SAVE DATA AGAIN
  2779. CALL GIN.TP1 GET Y COORD.
  2780. CALL R.OUTY
  2781. POP D DE _ DATA
  2782. MOV A,E
  2783. RRC
  2784. RRC
  2785. RRC
  2786. RRC
  2787. MOV E,A L HAS X TOUCH PANEL VAL.
  2788. CALL GIN.TP1 GET X COORD
  2789. CALL R.OUTX
  2790. JMP IDLE14
  2791. *
  2792. GIN.TP1 EQU $
  2793. MVI A,#0F MASK WITH LOWER 4 BITS
  2794. ANA E
  2795. MOV L,A
  2796. MVI H,00 HL _ TOUCH PANEL VALUE
  2797. DAD H MULTIPLY BY 32
  2798. DAD H
  2799. DAD H
  2800. DAD H
  2801. DAD H
  2802. LXI D,#0010 ADD 16
  2803. DAD D
  2804. RET
  2805. **********
  2806. * POINT PLOT MODE- GET X AND Y COORDINATES
  2807. * AND CALL R.DOT TO OUTPUT POINT
  2808. **********
  2809. *
  2810. POINT EQU $
  2811. CALL ESCCTL
  2812. CALL GETXY
  2813. CALL R.DOT
  2814. RET
  2815. *
  2816. **********
  2817. * BLOCK W/E MODE
  2818. **********
  2819. *
  2820. ABLOCK EQU $
  2821. CALL ESCCTL CHECK FOR ESC/CTL CODES
  2822. CALL GETXY GET AN X AND Y COORD.
  2823. LDA BTWICE SECOND SET COORDS
  2824. ORA A
  2825. JNZ XY2
  2826. SHLD X1 NO FIRST SET
  2827. XCHG
  2828. SHLD Y1
  2829. INR A
  2830. STA BTWICE SET BTWICE TO TRUE*D
  2831. RET
  2832. *
  2833. XY2 EQU $
  2834. SHLD X2 SECOND SET
  2835. XCHG
  2836. SHLD Y2
  2837. XRA A
  2838. STA BTWICE TURN BTWICE OFF
  2839. LXI H,X1 HL HAS ADDR. OF XY BUFF.
  2840. CALL R.BLOCK
  2841. RET
  2842. *
  2843. *
  2844. GETXY EQU $
  2845. MOV A,C RESTORE DATA
  2846. LXI H,NINPUT INCR. NUMBER OF INPUTS
  2847. INR M OF CURRENT NO. INPUTS
  2848. ANI #60 IF CHAR AND 60H=20H,HI Y
  2849. CPI #20
  2850. JNZ LOYCHK OTHERWISE, CHECK FOR LO Y
  2851. MVI A,#1F HIGH=(CHAR-32)*32.
  2852. ANA C
  2853. MOV L,A
  2854. MVI H,0
  2855. DAD H
  2856. DAD H
  2857. DAD H
  2858. DAD H
  2859. DAD H HL=HIGH
  2860. LDA NINPUT IF THIS INPUT IS FIRST
  2861. CPI 1 IN SEQ. IT IS HIGH Y BYTE.
  2862. JZ HIYBYTE
  2863. SHLD HIX OTHERWISE, IT IS HIGH X
  2864. POP PSW POP AND RET TO IDLE
  2865. RET
  2866. *
  2867. HIYBYTE SHLD HIY
  2868. POP PSW POP AND RET TO IDLE
  2869. RET
  2870. LOYCHK EQU $
  2871. CPI #60 IF CHAR AND 60H=60H, LO Y
  2872. JNZ LOXCHK OTHERWISE,CHECK FOR LOW X
  2873. MOV A,C
  2874. ANI #1F LOY=(CHAR-32)
  2875. STA LOY
  2876. POP PSW POP AND RET TO IDLE
  2877. RET
  2878. *
  2879. LOXCHK CPI #40 IF CHAR AND 60H=40H,LO X
  2880. JNZ ERR ERR RETURN TO IDLE DEFAULT
  2881. MOV A,C
  2882. ANI #1F LOX=(CHAR-32)
  2883. STA LOX
  2884. LHLD HIX
  2885. ORA L
  2886. MOV L,A
  2887. XCHG DE HAS X COORDINATE
  2888. LXI H,NINPUT SET INPUTS BACK TO 0
  2889. MVI M,0
  2890. LDA LOY
  2891. LHLD HIY
  2892. ORA L
  2893. MOV L,A
  2894. XCHG DE HAS Y COORDINATE
  2895. * HL HAS X COORDINATE
  2896. XRA A CLEAR COMMAND MODE FLAG
  2897. STA CMODE
  2898. LDA SCALEFG LOAD SCALE/NO SCALE FLAG
  2899. RAR
  2900. RC IF SET, COORDS. AS IS..RET
  2901. CALL DIVIDE OTHERWISE SCALE
  2902. XCHG BY FACTOR OF 2
  2903. CALL DIVIDE TO MAP INTO 511X511
  2904. XCHG
  2905. PUSH H SAVE X COORD.
  2906. LHLD BIAS BIAS Y COORD.
  2907. DAD D
  2908. XCHG DE HAS BIASED Y COORD.
  2909. POP H
  2910. RET
  2911. *
  2912. ERR EQU $
  2913. POP PSW
  2914. RET
  2915. *
  2916. G.LINE1 EQU $
  2917. SHLD XEND STORE X END POINT
  2918. XCHG
  2919. SHLD YEND STORE Y END POINT
  2920. *
  2921. **********
  2922. * VECTOR GENERATOR SUBROUTINE
  2923. **********
  2924. *
  2925. * 'THE ALGORITHM IMPLEMENTED FOR THE VECT. GEN. IS THE
  2926. * UNIT INCREMENT DIGITAL DIFFERENTIAL ANALYZER. 'THE 'D'D'A
  2927. * GENERATES POINTS THAT ARE SPACED ONE UNIT APART ALONG THE
  2928. * AXIS OF GREATER DELTA. THE SPACING IN THE OTHER DIRECTION
  2929. * IS MERELY THE SLOPE. 'I EQUA. FORM THE ABOVE CAN BE STATED
  2930. *
  2931. * Y(0)=Y(I)+1/2 X(0)=X(I)
  2932. * Y(N)=Y(N-1)+DY/DX X(N)=X(N-1)+1
  2933. * OR *
  2934. * X(0)=X(I)+1/2 Y(0)=Y(I)
  2935. * X(N)=X(N-1)+DX/DY Y(N)=Y(N-1)+1
  2936. *
  2937. * TO PREVENT THE GENERATED LINE FROM BEING BIASED TO LIE
  2938. * ON ONE SIDE OF THE IDEAL LINE THE PTS. ARE ROUNDED TO THE
  2939. * NEAREST INTEGER. 'ROUNDING IS SAME AS ADDING 1/2 TO THE
  2940. * INITIAL VALUE.
  2941. *
  2942. *
  2943. * PARAMETER LOCATIONS UPON ENTRY
  2944. *
  2945. * LOCATION USEAGE
  2946. *
  2947. * XREG X BEGINNING POINT
  2948. * XEND X ENDING POINT
  2949. * YREG Y BEGINNING POINT
  2950. * YEND Y ENDING POINT
  2951. *
  2952. * PARAMETER LOCATIONS UPON EXIT
  2953. *
  2954. * XDELTA XEND-XREG / XREG-XEND
  2955. * YDELTA YEND-YREG / YREG-YEND
  2956. * SLOPE DX/DY OR DY/DX
  2957. * VECFLAG FLAG
  2958. *
  2959. *
  2960. * BITS 1-3 UNUSED
  2961. * BIT 4 X SIGN
  2962. * BIT 5 Y SIGN
  2963. * BIT 6 BIG 'D
  2964. * BIT 7-8 UNUSED
  2965. *
  2966. **********
  2967. *
  2968. * WRITE OR ERASE FIRST POINT OF VECTOR
  2969. *
  2970. MVI C,#80 SET VECTOR MODE.
  2971. *
  2972. LDA M.MODE LOAD MODE WRITE ERASE BITS
  2973. RLC
  2974. ANI #06
  2975. OUT DISCHAN*32+DISCON2 SET WRITE/ERASE BITS
  2976. LHLD XREG LOAD CURRENT X COORDINATE
  2977. *
  2978. * CALCULATE DELTA X
  2979. *
  2980. XCHG
  2981. LHLD XEND LOAD END POINT
  2982. MVI B,#08 LOAD PLOTTING BIT
  2983. CALL CALDEL DO CALCULATION
  2984. SHLD XDELTA STORE DIFFERANCE
  2985. LHLD YREG LOAD CURRENT Y COORDINATE
  2986. *
  2987. * CALCULATE DELTA Y
  2988. *
  2989. XCHG
  2990. LHLD YEND LOAD END POINT
  2991. MVI B,#10 LOAD PLOTTING BIT
  2992. CALL CALDEL DO CALCULATION
  2993. SHLD YDELTA STORE DIFFERANCE
  2994. *
  2995. *****************************************
  2996. *
  2997. * DETERMINE IF 45 DEGREE ANGLE AND IF DELTA X GREATER DELTA Y
  2998. *
  2999. **********************************************
  3000. MOV A,L
  3001. ORA H TEST FOR ZERO
  3002. JZ VECT6
  3003. VECT4A CALL COMPHL
  3004. XCHG
  3005. LHLD XDELTA LOAD DELTA X
  3006. DAD D DELTA Y MINUS DELTA X
  3007. JC VECT5 JUMP IF CARRY
  3008. *
  3009. * DELTA Y GREATER THAN DELTA X
  3010. *
  3011. LHLD YDELTA LOAD DELTA Y
  3012. CALL COMPHL
  3013. XCHG
  3014. LHLD XDELTA LOAD DELTA X
  3015. MOV A,C LOAD OUTPUT FUNCTION
  3016. JMP VECT7 JUMP TO OUT FUNCTION
  3017. *
  3018. * DELTA Y IS EQUAL TO OR LESS THAN DELTA X
  3019. *
  3020. VECT5 MOV A,L
  3021. ORA H TEST FOR ZERO
  3022. JZ VECT8 JUMP IF ANGLE IS 45
  3023. *
  3024. VECT6 LHLD XDELTA LOAD DELTA X
  3025. CALL COMPHL
  3026. XCHG PLACE DIVISOR
  3027. LHLD YDELTA LOAD DELTA Y
  3028. MOV A,C LOAD FLAG
  3029. ADI #20 SET BIT TO INDICATE Y SHORT AXIS
  3030. *
  3031. VECT7 OUT DISCHAN*32+DISCON1 OUTPUT CONTROL 1
  3032. STA VECFLAG
  3033. *
  3034. ******************************************
  3035. *
  3036. * FRACTIONAL DIVIDE ROUTINE
  3037. *
  3038. **************************************
  3039. *
  3040. * DIVIDEND REGISTER PAIR HL
  3041. * DIVIDEND REGISTER PAIR HL
  3042. *
  3043. * DIVISOR REGISTER PAIR DE
  3044. * QUOTIENT REGISTER PAIR BC
  3045. *
  3046. *************************************
  3047. ADIV0 LXI B,#0040 SET COUNT TO 10 DIGIT ACC.
  3048. ADIV1 DAD H SHIFT DIVIDEND LEFT ONCE
  3049. SHLD SAVE SAVE DIVIDEND VALUE
  3050. DAD D DIVIDEND-DIVISOR
  3051. JC ADIV2 JUMP IF CARRY SET
  3052. *
  3053. LHLD SAVE RESTORE DIVIDEND
  3054. *
  3055. * THIS CODE SHIFTS QUOTIENT INTO REISTER PAIR BC
  3056. *
  3057. ADIV2 EQU $
  3058. MOV A,C
  3059. RAL
  3060. MOV C,A
  3061. MOV A,B
  3062. RAL
  3063. MOV B,A
  3064. *
  3065. JNC ADIV1 REPEAT IF NOT COMPLETE
  3066. *
  3067. * LEFT JUSTIFY FRACTIONAL QUOTIENT
  3068. *
  3069. MOV L,C TRANSFER BC TO HL
  3070. MOV H,B
  3071. *
  3072. DAD H SHIFT HL LEFT SIX PLACES
  3073. DAD H
  3074. DAD H
  3075. DAD H
  3076. DAD H
  3077. DAD H
  3078. *
  3079. XCHG SAVE FRACTIONAL ANSWER
  3080. JMP ACALPT1 GO TO CALCULATE POINTS
  3081. *
  3082. * DIVIDE 16 BIT VALUE IN HL BY 2
  3083. DIVIDE EQU $
  3084. MOV A,H
  3085. ORA L
  3086. RZ
  3087. MOV A,H
  3088. ANI #7F
  3089. RAR
  3090. MOV H,A
  3091. MOV A,L
  3092. RAR
  3093. MOV L,A
  3094. RET
  3095. *
  3096. ********************
  3097. *
  3098. * INITIALIZE FOR A 45 DEGREE ANGLE
  3099. *
  3100. *********************
  3101. VECT8 MOV A,C LOAD FUNCTION CODE
  3102. OUT DISCHAN*32+DISCON1 OUTPUT
  3103. STA VECFLAG
  3104. LXI D,#FFFF SET SLOPE TO ALL ONES.
  3105. *
  3106. ********************
  3107. *
  3108. * THIS ROUTINE CALCULATES INCREMENTAL MOVEMENTS AND
  3109. * OUTPUTS THEM TO THE DISPLAY
  3110. *
  3111. *********************
  3112. *
  3113. * REGISTER PAIR HL FRACTIONAL PARTIAL SUM
  3114. * REGISTER PAIR DE SLOPE
  3115. * REGISTER PAIR BC LOOP COUNT
  3116. *
  3117. *********************
  3118. *
  3119. * INITIALIZE LOOP COUNT INTO REGISTER PAIR BC
  3120. *
  3121. ACALPT1 LDA VECFLAG
  3122. LHLD XDELTA
  3123. ANI #20 TEST FOR LARGEST DELTA
  3124. JNZ ACALPT2 DELTA X IS LONG AXIS
  3125. *
  3126. LHLD YDELTA
  3127. ACALPT2 EQU $
  3128. MOV C,L
  3129. MOV B,H
  3130. LXI H,#8000 PARTIAL SUM RNDG FACT
  3131. WRITSEG EQU $
  3132. PUSH PSW STORE ON STACK FOR LOOP
  3133. W.SEG1 EQU $
  3134. POP PSW POP VALUE FROM STACK
  3135. LDA VECFLAG OUTPUT TO DISPLAY
  3136. OUT DISCHAN*32+DISCON1
  3137. LDA WSEGLEN LOAD UP WRITE SEG. LENGTH
  3138. PUSH PSW STORE UNTO STACK
  3139. MOV A,C CHECK FOR VECTOR END
  3140. CPI 0
  3141. JZ W.ENDCK
  3142. *
  3143. *
  3144. W.SEG2 EQU $
  3145. POP PSW LOOP ON WRITING A SEGMENT
  3146. DCR A
  3147. PUSH PSW
  3148. JZ ERASEG WRITE SEGMENT DONE,ERASE
  3149. DAD D SEGMENT NOT COMPLETE,
  3150. RAR OUTPUT A POINT
  3151. OUT DISCHAN*32+DISDATA
  3152. DCR C CHECK FOR VECTOR END
  3153. JNZ W.SEG2 NOT COMPLETE, CONT. WRITE
  3154. W.ENDCK EQU $
  3155. DCR C SET C REGISTER TO FF COUNT
  3156. DCR B
  3157. JP W.SEG2
  3158. POP PSW
  3159. JMP LASTPT VECTOR DONE,OUTPUT LAST PT
  3160. *
  3161. ERASEG EQU $
  3162. POP PSW POP OFF WSEGLEN
  3163. LDA VECFLAG OUTPUT TO DISPLAY
  3164. ORI #40 WITH INHIBIT BIT SET
  3165. OUT DISCHAN*32+DISCON1
  3166. LDA ESEGLEN ERASE SEGMENT LENGTH COUNT
  3167. PUSH PSW STORE UNTO STACK
  3168. MOV A,C CHECK FOR VECTOR END
  3169. CPI 0
  3170. JZ E.ENDCK
  3171. E.SEG EQU $
  3172. POP PSW LOOP ON ERASING A SEGMENT
  3173. DCR A
  3174. PUSH PSW
  3175. JZ W.SEG1 ERASE SEGMENT LENGTH DONE
  3176. DAD D SEGMENT NOT COMPLETE
  3177. RAR OUTPUT A POINT
  3178. OUT DISCHAN*32+DISDATA
  3179. DCR C CHECK FOR VECTOR END
  3180. JNZ E.SEG NOT COMPLETE, CONT. WRITE
  3181. E.ENDCK EQU $
  3182. DCR C SET C REGISTER TO FF COUNT
  3183. DCR B
  3184. JP E.SEG
  3185. POP PSW
  3186. *
  3187. * PLACE X AND Y END COORDINATES INTO X AND Y REGS.
  3188. * WHICH BECOME THE BEGINNING PT. OF NEXT VECTOR
  3189. *
  3190. LASTPT EQU $ VECTOR COMPLETE, LAST PT.
  3191. LHLD YEND
  3192. XCHG
  3193. LHLD XEND
  3194. *
  3195. CALL R.DOT DISPLAY LAST POINT
  3196. LDA VECFLAG TURN OFF INHIBIT BIT
  3197. XRI #40
  3198. STA VECFLAG
  3199. RET
  3200. VECTAB EQU $
  3201. DB #3,#3 DOTTED VECTOR COUNTS
  3202. DB #8,#3 SHORT DASHED VECTOR COUNTS
  3203. DB #10,#4 LONG DASHED VECTOR COUNTS
  3204. *
  3205. ********************
  3206. *
  3207. * SUBROUTINE GRAPH
  3208. *
  3209. * THIS SUBROUTINE IS CALLED UPON WHEN IN GRAPH MODE.
  3210. * X AND Y COORDS. ARE SET UP IN HERE PRIOR TO
  3211. * CALLING LINE1 OR OUTCOORD. IF IN DARK MODE,
  3212. * OUTCOORD IS CALLED UPON TO DO BASE POSITION.
  3213. * OTHERWISE, LINE1 IS CALLED TO DISPLAY A VECTOR.
  3214. * FOUR INPUTS ARE NOT NECESSARY TO DRAW A VECTOR.
  3215. * THE USER MAY CHANGE FROM 1 TO 4 BYTES OF THE
  3216. * COORDINATES. IF A HIGH BYTE IS RECEIVED FIRST
  3217. * IN A GIVEN SEQUENCE, IT MUST BE A HIGH Y BYTE.A HI
  3218. * RECEIVED OTHER THAN FIRST IN SEQUENCE IS A HIGH
  3219. * X BYTE. LOY AND LOX ARE DISTINGUISHABLE EACH
  3220. * FROM THE OTHER. INPUT OF A LOW X BYTE TRIGGERS
  3221. * BASE POSITION OR DRAWS A VECTOR.
  3222. ********************
  3223. GRAPH EQU $
  3224. CALL ESCCTL CHECK ESC SEQ./CTL CODES
  3225. CALL GETXY
  3226. *
  3227. LDA DARK
  3228. ANA A IF DARK VECTOR,
  3229. JZ ALINE BASE POSITION
  3230. PUSH D SAVE Y COORDINATE
  3231. CALL R.OUTX AND OUTPUT X COORDINATE
  3232. POP H RELOAD Y COORDINATE
  3233. CALL R.OUTY AND OUTPUT
  3234. XRA A TURN DARK VECTOR OFF
  3235. STA DARK
  3236. STA BYPASS CLEAR BYPASS CONDITION
  3237. RET
  3238. ALINE EQU $
  3239. LDA DASH LOAD FLAG FOR DASHED/SOLID
  3240. RAR
  3241. JC G.LINE1 IF SET, USE DASHED VECTOR
  3242. CALL R.LINE OTHERWISE, USE R.LINE
  3243. RET
  3244. * RETURN TO CALLER
  3245. *************************
  3246. *
  3247. * SUBROUTINE ALPHMODE
  3248. *
  3249. * TESTS DATA FOR CTL CODE, ESCAPE, AND DISPLAY CODE
  3250. *
  3251. *************************
  3252. *
  3253. CHARGEN EQU $
  3254. PUSH B SAVE CHARACTER CODE ON STK
  3255. LDA ECURSOR ERASE CURSOR
  3256. MOV B,A
  3257. CALL DISCURS
  3258. POP B RESTORE CHAR. CODE TO C
  3259. LHLD CHBASE
  3260. CALL JMPHL
  3261. CALL LINENDCK
  3262. RET
  3263. *
  3264. CHGEN.S1 EQU $
  3265. MOV L,C CHARACTER CODE IN HL
  3266. MVI H,00
  3267. MOV D,H CHARACTER CODE-20H IN DE
  3268. MOV E,L
  3269. DAD H 'MULTIPLY' CODE BY 8.
  3270. DAD H
  3271. DAD H
  3272. XCHG STORE IN DE
  3273. DAD H 'MULTIPLY' CODE BY 4
  3274. DAD H
  3275. DAD D INDEX=4(CODE)+8(CODE).
  3276. JMP OUTCHAR
  3277. *
  3278. CHGEN.S2 EQU $
  3279. MVI A,#A1 TEST CHARACTER
  3280. ADD C CODE FOR RUBOUT /CURSOR
  3281. JC OUTCH.2
  3282. MVI H,00
  3283. MOV L,C
  3284. DAD H
  3285. DAD H
  3286. DAD H
  3287. DAD H INDEX=16(CODE)
  3288. *
  3289. OUTCHAR EQU $
  3290. XCHG
  3291. LHLD G.MEMSEL ADD INDEX TO BASE ADDRESS
  3292. DAD D OF CHARACTER CODES.
  3293. *
  3294. OUTCH.0 EQU $
  3295. XCHG SAVE CHARACTER ADDR. IN DE
  3296. LDA D.CNTL2 LOAD CTL 2 FOR CHAR.
  3297. OUT DISCHAN*32+DISCON2 AND OUT ORIENT./WE
  3298. LHLD XREG LOAD CURRENT X/Y
  3299. SHLD XSAVE FOR CHARACTER PLOT
  3300. LHLD YREG
  3301. SHLD YSAVE
  3302. LDA WIDTH
  3303. MOV B,A LOAD B WITH CHAR. WIDTH
  3304. *
  3305. OUTCH.1 EQU $
  3306. CALL CHGEN.2 OUTPUT 1ST COLUMN OF CODES
  3307. LHLD XREG INCREMENT X COORDINATE
  3308. INX H AND OUTPUT.
  3309. CALL R.OUTX
  3310. LHLD YSAVE
  3311. CALL R.OUTY AND OUTPUT.
  3312. DCR B DECREMENT CHARACTER WIDTH
  3313. JNZ OUTCH.1
  3314. RET
  3315. *
  3316. *
  3317. OUTCH.2 EQU $
  3318. LXI H,M0CODE5F LOAD ADDRESS OF RUBOUT
  3319. ORA A TEST FOR RUB-OUT
  3320. JZ OUTCH.0 RUBOUT, DISPLAY IT
  3321. LXI H,M0CODE60 LOAD ADDRESS OF CURSOR
  3322. DCR A TEST FOR RUB-OUT OR XHAIR
  3323. ORA A
  3324. JZ OUTCH.0 CURSOR, DISPLAY IT
  3325. LXI H,M0CODE61 ELSE, ADDR. OF XHAIR
  3326. JMP OUTCH.0 AND DISPLAY IT
  3327. *
  3328. DISCURS EQU $
  3329. LDA MODE
  3330. CPI 08
  3331. JZ DISCURS1 GIN MODE, ALWAYS DISPLAY
  3332. LDA G.SUPCUR IF SUPPRESS SET, RET
  3333. ORA A
  3334. RNZ
  3335. DISCURS1 EQU $
  3336. LDA D.CNTL2 SAVE DISPLAY CONTROL WORD
  3337. STA D.CNTL2D
  3338. MOV A,B
  3339. STA D.CNTL2
  3340. LDA MODE TEST FOR GIN MODE
  3341. CPI 08
  3342. JNZ DISCURS2
  3343. CALL XHAIR
  3344. JMP DISCURS3
  3345. DISCURS2 EQU $
  3346. MVI C,#60 DISPLAY CURSOR
  3347. DISCURSX EQU $
  3348. LHLD CHBASE
  3349. CALL JMPHL
  3350. CALL R.INPX
  3351. LDA WIDTH
  3352. CMA
  3353. INR A
  3354. MOV E,A
  3355. MVI D,#FF
  3356. DAD D
  3357. CALL R.OUTX
  3358. DISCURS3 EQU $
  3359. LDA D.CNTL2D
  3360. STA D.CNTL2
  3361. RET
  3362. *
  3363. CHGEN.2 EQU $
  3364. LDAX D
  3365. INX D
  3366. OUT DISCHAN*32+DISDATA
  3367. RAR
  3368. OUT DISCHAN*32+DISDATA
  3369. RAR
  3370. OUT DISCHAN*32+DISDATA
  3371. RAR
  3372. OUT DISCHAN*32+DISDATA
  3373. RAR
  3374. OUT DISCHAN*32+DISDATA
  3375. RAR
  3376. OUT DISCHAN*32+DISDATA
  3377. RAR
  3378. OUT DISCHAN*32+DISDATA
  3379. RAR
  3380. OUT DISCHAN*32+DISDATA
  3381. LDAX D
  3382. INX D
  3383. OUT DISCHAN*32+DISDATA
  3384. RAR
  3385. OUT DISCHAN*32+DISDATA
  3386. RAR
  3387. OUT DISCHAN*32+DISDATA
  3388. RAR
  3389. OUT DISCHAN*32+DISDATA
  3390. RAR
  3391. OUT DISCHAN*32+DISDATA
  3392. RAR
  3393. OUT DISCHAN*32+DISDATA
  3394. MOV C,A IF SIZE 1 RETURN
  3395. LDA G.SIZE
  3396. ORA A
  3397. RZ
  3398. MOV A,C
  3399. RAR
  3400. OUT DISCHAN*32+DISDATA
  3401. RAR
  3402. OUT DISCHAN*32+DISDATA
  3403. RET
  3404. *
  3405. *
  3406. ESCCTL EQU $
  3407. LDA G.ESC IS ESCAPE FLAG, G.ESC, SET&
  3408. ANA A
  3409. JZ VALCK NO, CHECK FOR CTL CODE
  3410. XRA A
  3411. STA G.ESC YES, CLEAR ESCAPE FG.
  3412. LHLD ESCADR
  3413. CALL SEARCH
  3414. JMP POPRET
  3415. *
  3416. VALCK EQU $
  3417. MOV A,C IS CURRENT CODE A CTL'/
  3418. CPI #20
  3419. RNC NO, RETURN TO MODE
  3420. CALL ACONTROL
  3421. *
  3422. POPRET EQU $
  3423. POP H POP OFF ADDR. FROM STK
  3424. RET AND RETURN TO IDLE.
  3425. *
  3426. ALPHMODE EQU $
  3427. CALL ESCCTL CHECK FOR ESC SEQ./CTL COD
  3428. CPI #7F
  3429. RZ RETURN IF RUBOUT DEL CHAR
  3430. SUI #20
  3431. MOV C,A CHARACTER CODE IN C.
  3432. CALL SCROLLCL CLEAR SCROLL FGS
  3433. CALL CHARGEN INDEX INTO CHARACTER CODE
  3434. RET VIA CHARGEN.
  3435. *
  3436. ACONTROL EQU $
  3437. LHLD CTLADR BEGIN SEARCH FOR MATCH
  3438. SEARCH MOV A,M IF CODE IN JUMP TABLE FF
  3439. CPI #FF END OF TABLE REACHED
  3440. JNZ SEARCH.1
  3441. CALL SCROLLCL CLEAR SCROLL FGS.
  3442. RET
  3443. SEARCH.1 EQU $
  3444. CMP C ELSE, COMPARE HEX ENTRY W/
  3445. JZ MATCH CONTROL CODE FOR MATCH
  3446. INX H NO MATCH,GET NEXT ENTRY
  3447. INX H AND CONTINUE SEARCHING.
  3448. INX H
  3449. JMP SEARCH
  3450. MATCH EQU $
  3451. CPI #0D TEST FOR 'C'R
  3452. JNZ MATCH.1 NOT A 'C'R
  3453. STA CRLFFG 'C'R, SO SET CRLF FLAG
  3454. JMP MATCH.2
  3455. MATCH.1 EQU $
  3456. CPI #0A TEST IF 'L'F
  3457. JZ MATCH.2
  3458. CALL SCROLLCL
  3459. MATCH.2 EQU $
  3460. INX H MATCH FOUND. GET ADDR. CTL
  3461. MOV E,M CODE ROUTINE AND DO IT.
  3462. INX H
  3463. MOV D,M
  3464. XCHG
  3465. LXI D,HOR HOR FLAG FOR PLATO CHAR.
  3466. CALL JMPHL
  3467. RET
  3468. *
  3469. *
  3470. * ESCAPE SEQUENCES
  3471. *
  3472. * THE FOLLOWING IS A LIST OF ESCAPE SEQUENCES WHICH
  3473. * WHEN ENTERED FROM KEYBOARD OR RECEIVED FROM HOST,
  3474. * ILLICIT THE ACTIVITIES DESCRIBED AFTER EACH SEQ.
  3475. *
  3476. * CODE SEQUENCE DESCRIPTION
  3477. *
  3478. * 1B 07 ESC BEL- CLEAR BYPASS,RING
  3479. * BELL
  3480. * 1B 08 ESC BS- BACK SPACE
  3481. * 1B 0D ESC CR- SET ESCAPE FLAG
  3482. * 1B 02 ESC STX SELECTS PLATO OP.
  3483. * 1B 18 ESC CAN- SELECTS BYPASS
  3484. * *VECTOR ESCAPE SEQUENCES*
  3485. * 1B 60 ESC REVERSE SLASH SEQUENCE
  3486. * SETS NORMAL VECTORS
  3487. * 1B 61 ESC SMALL A SEQUENCE
  3488. * SETS DOTTED VECTORS
  3489. * 1B 63 ESC SMALL C SEQUENCE
  3490. * SETS SHORT DASHED VECT.
  3491. * 1B 64 ESC SMALL D SEQUENCE
  3492. * SETS LONG DASHED VECTOR
  3493. * 1B 11 ESC DC1 SEQUENCE SELECTS
  3494. * INVERSE VIDEO
  3495. * 1B 12 ESC DC2 SEQUENCE SELECTS
  3496. * OVERSTRIKE WRITE.
  3497. * 1B 13 ESC DC3 SEQUENCE SELECTS
  3498. * OVERSTRIKE ERASE.
  3499. * 1B 14 ESC DC4 SEQUENCE SELECTS
  3500. * CLEAR WRITE
  3501. * 1B 05 ESC ENQ SEQUENCE-
  3502. * SELECTS BYPASS, SENDS
  3503. * TERMINAL STATUS AND 4
  3504. * BYTES OF CURRENT X/Y
  3505. * 1B 0C ESC FF SEQUENCE-
  3506. * ERASES SCREEN, SELECTS
  3507. * ALPHA,HOMES,CLEARS BYP.
  3508. * 1B 1D ESC GS- SET GRAPH MODE,
  3509. * DARK VECTOR
  3510. * 1B 09 ESC HTAB- HORIZONTAL TAB
  3511. * AUTO CRLF IF NEEDED
  3512. * 1B 0A ESC LF- SET ESCAPE FLAG
  3513. * 1B 3B ESC ; SEQUENCE -SIZE1
  3514. * 1B 3A ESC '; SEQUENCE -SIZE1
  3515. * 1B 39 ESC 9 SEQUENCE -SIZE1
  3516. * 1B 38 ESC 8 SEQUENCE -SIZE1
  3517. * 6 X 14
  3518. * SETS APPROPRIATE LINEND
  3519. * PAGEND,HEIGHT, WIDTH
  3520. * 1B 37 ESC 7 SEQUENCE -SIZE2
  3521. * 8 X 16
  3522. * SETS APPROPRIATE LINEND
  3523. * PAGEND,HEIGHT, WIDTH
  3524. * 1B 1A ESC SUB SEQUENCE -SELECTS
  3525. * GIN MODE,BYPASS,CROSS
  3526. * HAIR CURSOR
  3527. * 1B 1F ESC US- RESETS TO ALPHA
  3528. * FROM ALL MODES BUT
  3529. * GIN,CLEAR BYPASS
  3530. * 1B 0B ESC VT- VERTICAL TAB
  3531. ********************
  3532. ********************
  3533. * ESCAPE SEQUENCE LIST
  3534. *********************
  3535. *
  3536. ESCADR.A EQU $
  3537. DB #07
  3538. DW BEL
  3539. DB #08
  3540. DW BS
  3541. DB #0D
  3542. DW ESC
  3543. DB #02
  3544. DW PLATO
  3545. DB #18
  3546. DW CAN
  3547. DB #60
  3548. DW VECTNORM
  3549. DB #61
  3550. DW VECTDOT
  3551. DB #63
  3552. DW VECTSDSH
  3553. DB #64
  3554. DW VECTLDSH
  3555. DB #11
  3556. DW DC1
  3557. DB #12
  3558. DW DC2
  3559. DB #13
  3560. DW DC3
  3561. DB #14
  3562. DW DC4
  3563. DB #05
  3564. DW ENQ
  3565. DB #0C
  3566. DW AFF
  3567. DB #1D
  3568. DW GS
  3569. DB #09
  3570. DW HTAB
  3571. DB #0A
  3572. DW ESC
  3573. DB #3B
  3574. DW SIZE1
  3575. DB #3A
  3576. DW SIZE1
  3577. DB #39
  3578. DW SIZE1
  3579. DB #38
  3580. DW SIZE1
  3581. DB #37
  3582. DW SIZE2
  3583. DB #1A
  3584. DW ASUB
  3585. DB #1F
  3586. DW US
  3587. DB #0B
  3588. DW VT
  3589. DB #1B
  3590. DW ESC
  3591. DB #00
  3592. DW ESC
  3593. DB #FF
  3594. ********************
  3595. * CONTROL CODE SUBROUTINE
  3596. *
  3597. * THIS SUBROUTINE EXECUTES CONTROL CODE FUNCTIONS
  3598. * (I.E.'C'R,'B'S,ETC.) IT WILL BE ENTERED FROM THE KB
  3599. * AFTER THE CONTROL KEY IS RECEIVED OR FROM THE HOST
  3600. * WHEN A CTL CODE IS RECEIVED. HEX VALUE RANGE 00-1F
  3601. *
  3602. * CODE DESCRIPTION
  3603. *
  3604. * 07 BEL-CLEARS BYPASS
  3605. * 08 BS-BACK SPACE
  3606. * 0D CR-CARRIAGE RETURN
  3607. * RESET FROM GRAPH
  3608. * TO ALPHA MODE,
  3609. * CLEAR BYPASS
  3610. * 1B ESC-SET G.ESC, ESCAPE FLAG
  3611. * 1C FS-CTL FS SELECT
  3612. * POINT PLOT MODE
  3613. * 1D GS-SETS GRAPH MODE,
  3614. * DARK VECTOR
  3615. * 09 HTAB-HORIZONTAL TAB
  3616. * AUTO. CR/LF IF NEEDED
  3617. * 0A LF-LINE FEED; WRAP TO
  3618. * DISPLAY TOP IF NEEDED,
  3619. * CLEAR BYPASS
  3620. * 19 EM-SELECT BLOCK W/E MODE
  3621. * 1F US-RESETS TERM GRAPH TO
  3622. * ALPHA; CLEARS BYPASS
  3623. * 0B VT-VERTICAL TAB
  3624. *
  3625. **********************
  3626. **********************
  3627. * CONTROL CODE JUMP TABLE
  3628. *
  3629. ********************
  3630. *
  3631. CTLADR.A EQU $
  3632. DB #07
  3633. DW BEL
  3634. DB #08
  3635. DW BS
  3636. DB #0D
  3637. DW CR
  3638. DB #1B
  3639. DW ESC
  3640. DB #1C
  3641. DW FS
  3642. DB #1D
  3643. DW GS
  3644. DB #09
  3645. DW HTAB
  3646. DB #0A
  3647. DW LF
  3648. DB #19
  3649. DW EM
  3650. DB #1F
  3651. DW US
  3652. DB #0B
  3653. DW VT
  3654. DB #FF
  3655. *
  3656. *
  3657. BEL EQU $
  3658. IN TPCHAN*32+TOUCHD SOUND ALERT
  3659. MVI A,00
  3660. STA BYPASS CLEAR BYPASS
  3661. RET
  3662. *
  3663. BS EQU $
  3664. LDA ECURSOR ERASE CURSOR
  3665. MOV B,A
  3666. CALL DISCURS
  3667. XRA A CLEAR BYPASS
  3668. STA BYPASS
  3669. BS.1 EQU $
  3670. CALL R.INPX
  3671. LDA WIDTH
  3672. CMA MOVE X BACK A CHAR. WIDTH
  3673. INR A
  3674. MOV E,A
  3675. MVI D,#FF
  3676. DAD D
  3677. MOV A,H
  3678. ANI #80
  3679. JNZ BS.SCK X COORD. NEGATIVE
  3680. * GO CHECK CHAR. SIZE
  3681. BS.END EQU $ X COORD. DID NOT BACK OFF
  3682. CALL R.OUTX SET CURRENT X COORD.
  3683. RET
  3684. *
  3685. BS.SCK EQU $
  3686. LDA G.SIZE
  3687. ORA A
  3688. JNZ BS.VT X COORD NEG AND SIZE 2
  3689. * CHECK IF FFF8
  3690. DCX H SUBTRACT 2 FROM X AS SIZE
  3691. DCX H 1 USES ONLY 510 DOTS.
  3692. *
  3693. BS.VT EQU $
  3694. MOV A,L LOWER 8 BITS OF X MUST
  3695. CPI #F8 BE F8 IF SIZE 2,X NEG
  3696. JNZ BS.END BEFORE 'V'T IS REQUIRED.
  3697. CALL R.OUTX
  3698. CALL VT.1
  3699. RET
  3700. *
  3701. CAN EQU $
  3702. LXI H,BYPASS SELECTS BYPASS
  3703. MVI M,1
  3704. RET
  3705. *
  3706. CR EQU $
  3707. LDA ECURSOR
  3708. MOV B,A
  3709. CALL DISCURS
  3710. XRA A
  3711. STA BYPASS CLEARS BYPASS.
  3712. LDA MODE
  3713. CPI 08
  3714. JNZ CR.A
  3715. LDA GIN.KEY GIN MODE, SEND LAST CHAR.
  3716. MOV C,A AND RETURN TO GIN XMIT
  3717. CALL GIN.XMT
  3718. CALL CR.1 DO CARRIAGE RETURN
  3719. RET
  3720. CR.A EQU $
  3721. CALL CR.1 DO CARRIAGE RETURN
  3722. MVI A,03
  3723. STA MODE SET ALPHA MODE.
  3724. LHLD STRAP TEST FOR AUTO. CR/LF
  3725. MOV A,L
  3726. ANI #08
  3727. RZ RETURN IF NOT SET
  3728. LDA KBDATA
  3729. ORA A
  3730. RZ
  3731. STA CRLFFG SET SCROLL FLAG
  3732. CALL LF.1A OTHERWISE, 'L'F
  3733. CALL SCROLLCK
  3734. CALL SCROLLCL CLEAR SCROLL FLAG
  3735. RET
  3736. *
  3737. CR.1 EQU $
  3738. LXI H,00 SET TO LEFT MARGIN.
  3739. CALL R.OUTX
  3740. RET
  3741. *
  3742. *
  3743. DC1 EQU $
  3744. MVI L,00 SELECT INVERSE VIDEO
  3745. CALL R.MODE
  3746. MVI A,6 CURSOR NEEDS OPPOS. W/E
  3747. STA ECURSOR BITS OF ALL OTHER WRITE
  3748. MVI A,4 MODES.
  3749. STA WCURSOR
  3750. RET
  3751. *
  3752. DC2 EQU $
  3753. MVI L,6 SELECT OVERSTRIKE WRITE
  3754. CALL R.MODE
  3755. DC2.1 EQU $
  3756. MVI A,4 RESET W/E MODES SO CURSOR
  3757. STA ECURSOR OVERSTRIKE WRITE AND
  3758. MVI A,6 OVERSTRIKE ERASE
  3759. STA WCURSOR
  3760. RET
  3761. *
  3762. DC3 EQU $
  3763. MVI L,4 SELECT OVERSTRIKE ERASE
  3764. CALL R.MODE
  3765. CALL DC2.1 SELECT W/E CURSOR WORDS
  3766. RET
  3767. *
  3768. DC4 EQU $
  3769. MVI L,02
  3770. CALL R.MODE SELECT CLEAR WRITE
  3771. CALL DC2.1 SELECT W/E CURSOR WORDS
  3772. RET
  3773. *
  3774. ENQ EQU $
  3775. LDA MODE
  3776. CPI #08
  3777. JZ ENQ.1 IF GIN, DON'7T SEND TSTAT
  3778. LDA TSTAT LOAD TERMINAL STATUS
  3779. MOV C,A
  3780. CALL XMIT.1
  3781. ENQ.1 EQU $
  3782. CALL R.INPX
  3783. CALL HILO SEND X IN 2 BYTES
  3784. LHLD BIAS
  3785. CALL COMPHL
  3786. PUSH H SAVE -BIAS ON STACK
  3787. CALL R.INPY
  3788. POP D
  3789. DAD D HL _ Y - BIAS
  3790. CALL HILO SEND Y IN 2 BYTES
  3791. LDA MODE IF GIN, DO AUTOMATIC
  3792. CPI #08 TRANSMISSION CHECKS
  3793. JNZ ENQ.2
  3794. LHLD STRAP TEST 'G'I'N TRANSMISSION
  3795. MOV A,L
  3796. ANI 06
  3797. CPI 04
  3798. MOV L,A
  3799. JZ ENQ.2 SEND NOTHING AUTO.
  3800. PUSH H SAVE STRAP
  3801. MVI C,#0D SEND CR
  3802. CALL XMIT.1
  3803. POP H RESTORE STRAP
  3804. MOV A,L
  3805. CPI 02
  3806. JZ ENQ.2 SEND 'C'R ONLY.
  3807. MVI C,#04 SEND EOT
  3808. CALL XMIT.1
  3809. *
  3810. ENQ.2 EQU $
  3811. LDA ECURSOR ERASE CURSOR
  3812. MOV B,A
  3813. CALL DISCURS
  3814. MVI A,03 SELECT ALPHA MODE
  3815. STA MODE
  3816. STA BYPASS SET BYPASS
  3817. MVI H,04 LOAD INTERRUPT
  3818. LDA M.ENAB
  3819. ANI #D8
  3820. MOV L,A DISABLE TOUCH PANEL
  3821. CALL R.SSF MASK AND OUTPUT.
  3822. RET
  3823. *
  3824. *
  3825. HILO EQU $
  3826. LDA SCALEFG TEST SCALE FLAG
  3827. ORA A
  3828. JNZ HILO.1 NOT SCALING, SEND AS IS
  3829. DAD H OTHERWISE, MULT. BY 2
  3830. HILO.1 EQU $
  3831. MVI A,#1F
  3832. ANA L MASK LOWER FIVE BITS
  3833. PUSH A
  3834. DAD H SHIFT UPPER
  3835. DAD H FIVE BITS INTO
  3836. DAD H H REGISTER.
  3837. MOV A,H
  3838. ANI #1F MASK FOR FIVE BITS
  3839. ORI #20
  3840. MOV C,A
  3841. CALL XMIT.1 TRANSMIT UPPER 5 BITS
  3842. POP A
  3843. ORI #20
  3844. MOV C,A
  3845. CALL XMIT.1
  3846. RET
  3847. *
  3848. ESC EQU $
  3849. LXI H,G.ESC
  3850. MVI M,01
  3851. RET
  3852. *
  3853. AFF EQU $ PAGE GETS YOU HERE
  3854. LDA M.MODE
  3855. RLC
  3856. ORI 01
  3857. MOV L,A
  3858. CALL R.MODE
  3859. *
  3860. AFF.1 EQU $ RESET KEY GETS YOU HERE
  3861. MVI A,03 SELECT ALPHA MODE
  3862. STA MODE SELECTS ALPHA.
  3863. XRA A
  3864. STA BYPASS CLEARS BYPASS.
  3865. LXI H,00
  3866. CALL R.OUTX
  3867. MVI H,#FF
  3868. LDA HEIGHT
  3869. CMA
  3870. INR A A HAS -(HEIGHT)
  3871. MOV L,A
  3872. LXI D,#200
  3873. DAD D
  3874. CALL R.OUTY
  3875. RET
  3876. *
  3877. FS EQU $
  3878. LDA MODE
  3879. CPI 03
  3880. JNZ FS.1
  3881. LDA ECURSOR ERASE CURSOR
  3882. MOV B,A
  3883. CALL DISCURS
  3884. FS.1 EQU $
  3885. LDA MODE
  3886. ANI #80
  3887. JZ FS.2
  3888. ORI #40 SET PLATO DATA MODE
  3889. FS.2 EQU $
  3890. STA MODE SELECT POINT PLOT MODE
  3891. XRA A CLEAR NUMBER INPUTS
  3892. STA NINPUT TO GET COORDINATE
  3893. RET
  3894. *
  3895. GS EQU $
  3896. LDA MODE
  3897. CPI 03
  3898. JNZ GS.1
  3899. LDA ECURSOR ERASE CURSOR
  3900. MOV B,A
  3901. CALL DISCURS
  3902. *
  3903. *
  3904. GS.1 EQU $
  3905. LDA MODE
  3906. ANI #80
  3907. JZ GS.2
  3908. ORI #40 SELECT PLATO DATA MODE
  3909. GS.2 EQU $
  3910. ORI #01 SELECT GRAPH MODE
  3911. STA MODE
  3912. STA DARK SETS DARK VECTOR.
  3913. XRA A CLEAR NUMBER OF INPUTS TO
  3914. STA NINPUT GET COORDINATE ROUTINE
  3915. LDA TSTAT UPDATE TERMINAL STATUS
  3916. ANI #B1
  3917. STA TSTAT
  3918. RET
  3919. *
  3920. HTAB EQU $
  3921. LDA D.CNTL2
  3922. STA D.CNTL2P SAVE DISPLAY CONTROL WORD
  3923. LDA ECURSOR
  3924. MOV B,A
  3925. STA D.CNTL2
  3926. MVI C,#60 ERASE CURSOR
  3927. LHLD CHBASE
  3928. CALL JMPHL
  3929. CALL LINENDCK
  3930. LDA D.CNTL2P RESTORE DISPLAY CONTROL
  3931. STA D.CNTL2
  3932. XRA A CLEAR BYPASS
  3933. STA BYPASS
  3934. RET
  3935. *
  3936. LF EQU $
  3937. LDA ECURSOR
  3938. MOV B,A
  3939. CALL DISCURS
  3940. LXI H,BYPASS CLEAR BYPASS.
  3941. MVI M,00
  3942. CALL LF.1A DO A LINE FEED.
  3943. LDA KBDATA
  3944. ORA A
  3945. JZ LFSCROL
  3946. LHLD STRAP TEST FOR AUTO. LF/CR
  3947. MOV A,L
  3948. ANI #10
  3949. CNZ CR.1 AUTO. SO DO 'C'R
  3950. LFSCROL EQU *
  3951. CALL SCROLLCK
  3952. CALL SCROLLCL
  3953. RET
  3954. LF.1A EQU $
  3955. CALL R.INPY GET CURRENT Y
  3956. XCHG STORE Y IN DE.
  3957. LHLD PAGEND CHECK FOR PAGEND
  3958. MOV A,D
  3959. ORA A
  3960. JNZ CHANGEY NOT PG BOTTOM,
  3961. MOV A,E CHANGE Y ONLY.
  3962. CMP L
  3963. JC LF.2 PAGE BOTTOM REACHED,
  3964. *
  3965. CHANGEY EQU $
  3966. XCHG JUST CHANGE Y COORD
  3967. JMP LF.3
  3968. RET
  3969. *
  3970. LF.2 EQU $
  3971. LXI H,#200 SET Y TO PAGE TOP- HEIGHT
  3972. *
  3973. LF.3 EQU $
  3974. LDA HEIGHT
  3975. CMA
  3976. INR A A HAS -(HEIGHT).
  3977. MOV E,A
  3978. MVI D,#FF
  3979. DAD D
  3980. CALL R.OUTY
  3981. RET
  3982. *
  3983. LINENDCK EQU $
  3984. CALL R.INPX
  3985. XCHG CURRENT X IN DE
  3986. LDA G.SIZE CHECK CHARACTER SIZE
  3987. ORA A
  3988. JZ LEND.S1
  3989. MOV A,E SIZE 2 SO CHECK X COORD.
  3990. ORA D IF ZERO, IT HAS WRAPPED
  3991. JZ PGCHK SO DO CR LF.
  3992. RET
  3993. *
  3994. *
  3995. LEND.S1 EQU $ SIZE 1, X AT LINEND
  3996. LHLD LINEND DE HAS CURRENT X
  3997. MOV A,D
  3998. CMP H
  3999. RC
  4000. JNZ PGCHK IF LINEND DO 'C'R/'L'F
  4001. MOV A,E RETURN, LINE FEED.
  4002. CMP L OTHERWISE SIMPLY RETURN.
  4003. RC
  4004. RZ
  4005. LXI H,00
  4006. CALL R.OUTX
  4007. PGCHK EQU $
  4008. CALL CR.1
  4009. CALL LF.1A
  4010. LDA G.SUPCUR TEST IF CURSOR ON
  4011. ORA A
  4012. CZ SCROLL ON, SO SCROLL
  4013. CALL SCROLLCL
  4014. RET
  4015. *
  4016. EM EQU $
  4017. LDA MODE
  4018. CPI 03
  4019. JNZ EM.1
  4020. LDA ECURSOR ERASE CURSOR
  4021. MOV B,A
  4022. CALL DISCURS
  4023. EM.1 EQU $
  4024. LDA MODE
  4025. ANI #80
  4026. JZ EM.2
  4027. ORI #40 SELECT PLATO DATA MODE
  4028. EM.2 EQU $
  4029. ORI #04 SELECT BLOCK MODE
  4030. STA MODE
  4031. XRA A CLEAR TWICE FLAG
  4032. STA BTWICE
  4033. STA NINPUT CLEAR NINPUT TO GET COORDS
  4034. RET
  4035. *
  4036. PLATO EQU $
  4037. CALL BULKER ERASE SCREEN
  4038. PLATO0 EQU *
  4039. MVI A,0
  4040. STA M.JOBS
  4041. MVI A,12
  4042. STA M.TYPE
  4043. MVI A,03
  4044. STA M.SBTYPE
  4045. MVI A,#83 SELECT PLATO COMMAND MODE3
  4046. STA MODE
  4047. LXI H,ISTASC SELECT IST ASCII KEYBOARD
  4048. SHLD KBAADR
  4049. LXI H,SELECT.P SELECT PLATO DATAMODE TBL
  4050. SHLD SELECT.M
  4051. LXI H,CTLADR.P SELECT PLATO CTL CODE TBL
  4052. SHLD CTLADR
  4053. LXI H,ESCADR.P SELECT PLATO ESC SEQ TBL
  4054. SHLD ESCADR
  4055. LXI H,#0000 NO GRAPH MODE SCREEN BIAS
  4056. SHLD BIAS
  4057. MVI A,01 DO NOT SCALE
  4058. STA SCALEFG
  4059. LXI D,00
  4060. LXI H,184
  4061. CALL OUTCOORD
  4062. MVI L,#1A
  4063. CALL R.MODE
  4064. MVI L,00
  4065. CALL R.CCR
  4066. LXI H,MSG
  4067. CALL R.CHARS
  4068. MVI A,#01
  4069. STA EREG
  4070. MVI A,#14
  4071. STA E.CNTR
  4072. MVI A,01
  4073. OUT KEYCHAN*32+KYBDCON
  4074. XRI #09
  4075. CALL ENAB
  4076. *
  4077. LDA PMC.FLG TEST FOR PLATO
  4078. ORA A MODE MASTER CLEAR.
  4079. JNZ PI.3 JUMP IF M.C.
  4080. MVI C,#06
  4081. PI.1 CALL XMIT.1
  4082. JC PI.1
  4083. MVI C,#20
  4084. PI.2 CALL XMIT.1
  4085. JC PI.2
  4086. LXI H,#0382 SEND MASTER CLEAR
  4087. CALL P.XMIT STATUS TO PLATO.
  4088. RET
  4089. PI.3 XRA A
  4090. STA PMC.FLG CLEAR MC FLAG
  4091. MVI C,#95
  4092. PI.4 CALL XMIT.1 SEND NAK
  4093. JC PI.4 NOT SENT, TRY AGAIN
  4094. LDA MREG
  4095. ADI #20 ADJUST FOR ASCII
  4096. MOV C,A
  4097. PI.5 CALL XMIT.1 SEND M
  4098. JC PI.5 NOT SENT.
  4099. LXI H,#0382 SEND MASTER CLEAR
  4100. CALL P.XMIT STATUS TO PLATO.
  4101. RET
  4102. MSG DB #50,#4C,#41,#54
  4103. DB #4F,#1B,#30
  4104. *
  4105. SCROLLCK EQU $
  4106. LDA G.SUPCUR TEST SUPPRESS CURSOR
  4107. ORA A
  4108. RNZ
  4109. LDA CRLFFG TEST CR/LF SEQUENCE
  4110. ORA A
  4111. CNZ SCROLL
  4112. *
  4113. SCROLLCL EQU $
  4114. XRA A CLEAR SCROLL FLAGS
  4115. STA CRLFFG
  4116. RET
  4117. *
  4118. SCROLL EQU *
  4119. LXI H,0000 SET UP X1,Y1,X2,Y2
  4120. SHLD X1 FOR ERASING A LINE
  4121. LHLD LINEND
  4122. SHLD X2
  4123. CALL R.INPY
  4124. SHLD Y2
  4125. XCHG
  4126. LHLD HEIGHT
  4127. DCX H
  4128. DAD D
  4129. SHLD Y1
  4130. LDA D.CNTL2
  4131. STA D.CNTL2P
  4132. LDA M.MODE
  4133. STA M.MODEP
  4134. MVI L,00 SET ERASE BITS
  4135. CALL R.MODE
  4136. LXI H,X1
  4137. CALL R.BLOCK
  4138. LDA D.CNTL2P
  4139. STA D.CNTL2
  4140. LDA M.MODEP
  4141. STA M.MODE
  4142. LDA G.SIZE
  4143. ORA A
  4144. RNZ RET IF SIZE 2
  4145. CALL R.INPY GET Y COORD.
  4146. INX H ADD 2 AND OUT
  4147. INX H NEW Y.
  4148. CALL R.OUTY
  4149. RET
  4150. *
  4151. *
  4152. SIZE1 EQU $
  4153. LXI H,S1CODE00 SELECT SIZE 1
  4154. SHLD G.MEMSEL
  4155. LXI H,CHGEN.S1
  4156. SHLD CHBASE
  4157. LXI H,LINEND 85 CHARACTERS PER LINE
  4158. MVI M,#FD
  4159. INX H
  4160. MVI M,1 36 LINES PER PAGE
  4161. LXI H,PAGEND SET LINEND,PAGEND,HEIGHT
  4162. MVI M,#16 ACCORDINGLY.
  4163. LXI H,HEIGHT
  4164. MVI M,#0E
  4165. LXI H,WIDTH
  4166. MVI M,06
  4167. XRA A SIZE SET TO ZERO
  4168. STA G.SIZE INDICATES SIZE1.
  4169. RET
  4170. *
  4171. SIZE2 EQU $
  4172. LHLD M0ADR LOAD IST CHAR. SET ADDRESS
  4173. SHLD G.MEMSEL
  4174. LXI H,CHGEN.S2
  4175. SHLD CHBASE
  4176. LXI H,LINEND 64 CHARACTERS PER LINE
  4177. MVI M,#FF
  4178. INX H
  4179. MVI M,1 32 LINES PER PAGE
  4180. LXI H,PAGEND SET LINEND, PAGEND, HEIGHT
  4181. MVI M,0 ACCORDINGLY.
  4182. LXI H,HEIGHT
  4183. MVI M,#10
  4184. LXI H,WIDTH
  4185. MVI M,08
  4186. MVI A,1 BIT 1 SET IN SIZE
  4187. STA G.SIZE INDICATES SIZE2.
  4188. RET
  4189. *
  4190. ASUB EQU $
  4191. MVI H,04 LOAD INTERRUPT
  4192. LDA M.ENAB
  4193. ORI #20 ENABLE
  4194. MOV L,A TOUCH PANEL
  4195. CALL R.SSF
  4196. LDA MODE
  4197. CPI 03
  4198. JNZ ASUB.1
  4199. LDA ECURSOR
  4200. MOV B,A
  4201. CALL DISCURS
  4202. ASUB.1 EQU $
  4203. MVI A,08 SELECT GIN MODE
  4204. STA MODE
  4205. STA BYPASS SET BYPASS CONDITION
  4206. RET
  4207. *
  4208. US EQU $
  4209. MVI A,0
  4210. STA BYPASS CLEAR BYPASS.
  4211. MVI A,#BD
  4212. STA TSTAT
  4213. LDA MODE
  4214. CPI #08
  4215. RZ
  4216. ANI #80
  4217. JZ US.1
  4218. ORI #40 SELECT PLATO DATA MODE
  4219. US.1 EQU $
  4220. ORI #03 SELECT ALPHA MODE
  4221. STA MODE
  4222. RET
  4223. *
  4224. VECTNORM EQU $
  4225. LXI H,DASH
  4226. MVI M,00
  4227. RET
  4228. *
  4229. *
  4230. VECTDOT EQU $
  4231. LXI H,DASH
  4232. MVI M,1
  4233. LXI H,VECTAB
  4234. MOV A,M
  4235. STA WSEGLEN
  4236. INX H
  4237. MOV A,M
  4238. STA ESEGLEN
  4239. RET
  4240. *
  4241. VECTSDSH EQU $
  4242. LXI H,DASH
  4243. MVI M,1
  4244. LXI H,VECTAB+2
  4245. MOV A,M
  4246. STA WSEGLEN
  4247. INX H
  4248. MOV A,M
  4249. STA ESEGLEN
  4250. RET
  4251. *
  4252. VECTLDSH EQU $
  4253. LXI H,DASH
  4254. MVI M,1
  4255. LXI H,VECTAB+4
  4256. MOV A,M
  4257. STA WSEGLEN
  4258. INX H
  4259. MOV A,M
  4260. STA ESEGLEN
  4261. RET
  4262. *
  4263. VT EQU $
  4264. LDA ECURSOR
  4265. MOV B,A
  4266. CALL DISCURS OVERSTRIKE ERASE CURSOR
  4267. XRA A CLEAR BYPASS
  4268. STA BYPASS
  4269. VT.1 EQU $
  4270. CALL R.INPY
  4271. LDA HEIGHT
  4272. MOV E,A
  4273. MVI D,0
  4274. DAD D
  4275. LDA G.SIZE IF SIZE 2, WRAPS AUTO.
  4276. ORA A
  4277. JNZ VT.2
  4278. MOV A,H SIZE 1, CHECK FOR PAGE TOP
  4279. CPI 2 IF Y DOES NOT EXCEED 512
  4280. JC VT.2 DO A SIMPLE 'V'T
  4281. LHLD PAGEND OTHERWISE,WRAP TO PG END
  4282. LDA HEIGHT PAGEND MINUS HEIGHT
  4283. CMA
  4284. INR A
  4285. MOV E,A
  4286. MVI D,#FF
  4287. DAD D
  4288. *
  4289. VT.2 EQU $
  4290. CALL R.OUTY
  4291. LDA WCURSOR
  4292. MOV B,A
  4293. CALL DISCURS
  4294. RET
  4295. *
  4296. * COMPLIMENT HL REGISTERS FOR 2'7S COMP. ARITH.
  4297. *
  4298. COMPHL EQU $
  4299. MOV A,L
  4300. CMA
  4301. MOV L,A
  4302. MOV A,H
  4303. CMA
  4304. MOV H,A
  4305. INX H
  4306. RET
  4307. *
  4308. CALDEL EQU $
  4309. MOV A,E TEST STARTING
  4310. ORA D POINT FOR ZERO.
  4311. RZ RETURN IF ZERO
  4312. *
  4313. XCHG SUBTRACT
  4314. CALL COMPHL STARTING POINT
  4315. DAD D FROM END POINT.
  4316. RC RETURN IF END GREATER
  4317. *
  4318. CALL COMPHL SET DELTA POSITIVE
  4319. MOV A,C LOAD PLOTTING
  4320. ORA B BIT FOR NEGATIVE
  4321. MOV C,A DIRECTION.
  4322. RET EXIT
  4323. *
  4324. ********************
  4325. *
  4326. * SIZE 1 CHARACTER CODE SET
  4327. *
  4328. ********************
  4329. S1CODE00 DB #00,#00,#00,#00
  4330. DB #00,#00,#00,#00
  4331. DB #00,#00,#00,#00
  4332. EXCLAMATION MARK
  4333. S1CODE01 DB #00,#00,#00,#00
  4334. DB #20,#3F,#00,#00
  4335. DB #00,#00,#00,#00
  4336. DOUBLE QUOTATION MARK
  4337. S1CODE02 DB #00,#00,#00,#38
  4338. DB #00,#00,#00,#38
  4339. DB #00,#00,#00,#00
  4340. NUMBER SIGN
  4341. S1CODE03 DB #00,#0A,#80,#3F
  4342. DB #00,#0A,#80,#3F
  4343. DB #00,#0A,#00,#00
  4344. DOLLAR SIGN
  4345. S1CODE04 DB #80,#0C,#40,#12
  4346. DB #E0,#3F,#40,#12
  4347. DB #80,#09,#00,#00
  4348. PERCENT SIGN
  4349. S1CODE05 DB #40,#0C,#80,#0C
  4350. DB #00,#01,#60,#02
  4351. DB #60,#04,#00,#00
  4352. AMPER SIGN
  4353. S1CODE06 DB #C0,#01,#20,#1A
  4354. DB #20,#26,#C0,#19
  4355. DB #20,#02,#00,#00
  4356. SINGLE QUOTATION
  4357. S1CODE07 DB #00,#00,#00,#00
  4358. DB #00,#38,#00,#00
  4359. DB #00,#00,#00,#00
  4360. LEFT PARENTHESIS (
  4361. S1CODE08 DB #00,#00,#00,#00
  4362. DB #C0,#0F,#20,#10
  4363. DB #10,#20,#00,#00
  4364. RIGHT PARENTHESIS )
  4365. S1CODE09 DB #10,#20,#20,#10
  4366. DB #C0,#0F,#00,#00
  4367. DB #00,#00,#00,#00
  4368. ASTERISK
  4369. S1CODE0A DB #80,#04,#00,#03
  4370. DB #C0,#0C,#00,#03
  4371. DB #80,#04,#00,#00
  4372. PLUS
  4373. S1CODE0B DB #00,#01,#00,#01
  4374. DB #C0,#07,#00,#01
  4375. DB #00,#01,#00,#00
  4376. COMMA
  4377. S1CODE0C DB #00,#00,#68,#00
  4378. DB #70,#00,#00,#00
  4379. DB #00,#00,#00,#00
  4380. MINUS
  4381. S1CODE0D DB #00,#01,#00,#01
  4382. DB #00,#01,#00,#01
  4383. DB #00,#01,#00,#00
  4384. PERIOD
  4385. S1CODE0E DB #00,#00,#60,#00
  4386. DB #60,#00,#00,#00
  4387. DB #00,#00,#00,#00
  4388. SLASH
  4389. S1CODE0F DB #20,#00,#40,#00
  4390. DB #80,#00,#00,#01
  4391. DB #00,#02,#00,#00
  4392. NUMERAL ZERO
  4393. S1CODE10 DB #C0,#0F,#A0,#10
  4394. DB #20,#11,#20,#12
  4395. DB #C0,#0F,#00,#00
  4396. NUMERAL ONE
  4397. S1CODE11 DB #00,#00,#20,#08
  4398. DB #E0,#1F,#20,#00
  4399. DB #00,#00,#00,#00
  4400. NUMERAL TWO
  4401. S1CODE12 DB #60,#08,#A0,#10
  4402. DB #20,#11,#20,#12
  4403. DB #20,#0C,#00,#00
  4404. NUMERAL THREE
  4405. S1CODE13 DB #40,#08,#20,#10
  4406. DB #20,#12,#20,#12
  4407. DB #C0,#0D,#00,#00
  4408. NUMERAL FOUR
  4409. S1CODE14 DB #00,#01,#00,#03
  4410. DB #00,#05,#00,#09
  4411. DB #E0,#1F,#00,#00
  4412. NUMERAL FIVE
  4413. S1CODE15 DB #20,#1E,#20,#12
  4414. DB #20,#12,#20,#12
  4415. DB #C0,#11,#00,#00
  4416. NUMERAL SIX
  4417. S1CODE16 DB #C0,#07,#20,#0A
  4418. DB #20,#12,#20,#12
  4419. DB #C0,#01,#00,#00
  4420. NUMERAL SEVEN
  4421. S1CODE17 DB #00,#10,#60,#10
  4422. DB #80,#11,#00,#16
  4423. DB #00,#18,#00,#00
  4424. NUMERAL EIGHT
  4425. S1CODE18 DB #C0,#0D,#20,#12
  4426. DB #20,#12,#20,#12
  4427. DB #C0,#0D,#00,#00
  4428. NUMERAL NINE
  4429. S1CODE19 DB #00,#0E,#20,#11
  4430. DB #20,#11,#40,#11
  4431. DB #80,#0F,#00,#00
  4432. COLON
  4433. S1CODE1A DB #00,#00,#60,#06
  4434. DB #60,#06,#00,#00
  4435. DB #00,#00,#00,#00
  4436. SEMICOLON
  4437. S1CODE1B DB #08,#00,#70,#06
  4438. DB #60,#06,#00,#00
  4439. DB #00,#00,#00,#00
  4440. LESS THAN
  4441. S1CODE1C DB #00,#01,#80,#02
  4442. DB #40,#04,#20,#08
  4443. DB #00,#00,#00,#00
  4444. EQUAL
  4445. S1CODE1D DB #80,#02,#80,#02
  4446. DB #80,#02,#80,#02
  4447. DB #80,#02,#00,#00
  4448. GREATER THAN
  4449. S1CODE1E DB #00,#00,#20,#08
  4450. DB #40,#04,#80,#02
  4451. DB #00,#01,#00,#00
  4452. QUESTION MARK
  4453. S1CODE1F DB #00,#18,#00,#20
  4454. DB #A0,#23,#00,#24
  4455. DB #00,#18,#00,#00
  4456. COMMERICAL AT
  4457. S1CODE20 DB #C0,#03,#20,#04
  4458. DB #90,#05,#D0,#05
  4459. DB #90,#03,#00,#00
  4460. CAPITAL A
  4461. S1CODE21 DB #E0,#0F,#00,#12
  4462. DB #00,#22,#00,#12
  4463. DB #E0,#0F,#00,#00
  4464. CAPITAL B
  4465. S1CODE22 DB #E0,#3F,#20,#24
  4466. DB #20,#24,#20,#24
  4467. DB #C0,#1B,#00,#00
  4468. CAPITAL C
  4469. S1CODE23 DB #C0,#1F,#20,#20
  4470. DB #20,#20,#20,#20
  4471. DB #40,#10,#00,#00
  4472. CAPITAL D
  4473. S1CODE24 DB #E0,#3F,#20,#20
  4474. DB #20,#20,#40,#10
  4475. DB #80,#0F,#00,#00
  4476. CAPITAL E
  4477. S1CODE25 DB #E0,#3F,#20,#22
  4478. DB #20,#22,#20,#22
  4479. DB #20,#20,#00,#00
  4480. CAPITAL F
  4481. S1CODE26 DB #E0,#3F,#00,#22
  4482. DB #00,#22,#00,#22
  4483. DB #00,#20,#00,#00
  4484. CAPITAL G
  4485. S1CODE27 DB #C0,#1F,#20,#20
  4486. DB #20,#21,#20,#21
  4487. DB #C0,#19,#00,#00
  4488. CAPITAL H
  4489. S1CODE28 DB #E0,#3F,#00,#02
  4490. DB #00,#02,#00,#02
  4491. DB #E0,#3F,#00,#00
  4492. CAPITAL I
  4493. S1CODE29 DB #20,#20,#20,#20
  4494. DB #E0,#3F,#20,#20
  4495. DB #20,#20,#00,#00
  4496. CAPITAL J
  4497. S1CODE2A DB #40,#00,#20,#00
  4498. DB #20,#20,#C0,#3F
  4499. DB #00,#20,#00,#00
  4500. CAPITAL K
  4501. S1CODE2B DB #E0,#3F,#00,#03
  4502. DB #80,#04,#40,#08
  4503. DB #20,#30,#00,#00
  4504. CAPITAL L
  4505. S1CODE2C DB #E0,#3F,#20,#00
  4506. DB #20,#00,#20,#00
  4507. DB #20,#00,#00,#00
  4508. CAPITAL M
  4509. S1CODE2D DB #E0,#3F,#00,#10
  4510. DB #00,#08,#00,#10
  4511. DB #E0,#3F,#00,#00
  4512. CAPITAL N
  4513. S1CODE2E DB #E0,#3F,#00,#18
  4514. DB #00,#06,#C0,#01
  4515. DB #E0,#3F,#00,#00
  4516. CAPITAL O
  4517. S1CODE2F DB #C0,#1F,#20,#20
  4518. DB #20,#20,#20,#20
  4519. DB #C0,#1F,#00,#00
  4520. CAPITAL P
  4521. S1CODE30 DB #E0,#3F,#00,#22
  4522. DB #00,#22,#00,#22
  4523. DB #00,#1C,#00,#00
  4524. CAPITAL Q
  4525. S1CODE31 DB #C0,#1F,#20,#20
  4526. DB #20,#20,#30,#20
  4527. DB #C8,#1F,#00,#00
  4528. CAPITAL R
  4529. S1CODE32 DB #E0,#3F,#00,#23
  4530. DB #80,#22,#40,#22
  4531. DB #20,#1C,#00,#00
  4532. CAPITAL S
  4533. S1CODE33 DB #40,#1C,#20,#22
  4534. DB #20,#22,#20,#22
  4535. DB #C0,#11,#00,#00
  4536. CAPITAL T
  4537. S1CODE34 DB #00,#20,#00,#20
  4538. DB #E0,#3F,#00,#20
  4539. DB #00,#20,#00,#00
  4540. CAPITAL U
  4541. S1CODE35 DB #C0,#3F,#20,#00
  4542. DB #20,#00,#20,#00
  4543. DB #C0,#3F,#00,#00
  4544. CAPITAL V
  4545. S1CODE36 DB #00,#3C,#80,#03
  4546. DB #60,#00,#80,#03
  4547. DB #00,#3C,#00,#00
  4548. CAPITAL W
  4549. S1CODE37 DB #E0,#3F,#40,#00
  4550. DB #80,#00,#40,#00
  4551. DB #E0,#3F,#00,#00
  4552. CAPITAL X
  4553. S1CODE38 DB #60,#30,#80,#09
  4554. DB #00,#06,#80,#09
  4555. DB #60,#30,#00,#00
  4556. CAPITAL Y
  4557. S1CODE39 DB #00,#38,#00,#04
  4558. DB #E0,#07,#00,#04
  4559. DB #00,#38,#00,#00
  4560. CAPITAL Z
  4561. S1CODE3A DB #E0,#30,#20,#21
  4562. DB #20,#22,#20,#24
  4563. DB #60,#38,#00,#00
  4564. LEFT CLOSURE [
  4565. S1CODE3B DB #00,#00,#00,#00
  4566. DB #F0,#3F,#10,#20
  4567. DB #10,#20,#00,#00
  4568. REVERSE SLASH
  4569. S1CODE3C DB #00,#04,#00,#02
  4570. DB #00,#01,#80,#00
  4571. DB #40,#00,#00,#00
  4572. RIGHT CLOSURE
  4573. S1CODE3D DB #10,#20,#10,#20
  4574. DB #F0,#3F,#00,#00
  4575. DB #00,#00,#00,#00
  4576. 'HAT
  4577. S1CODE3E DB #00,#04,#00,#08
  4578. DB #00,#10,#00,#08
  4579. DB #00,#04,#00,#00
  4580. UNDERLINE
  4581. S1CODE3F DB #08,#00,#08,#00
  4582. DB #08,#00,#08,#00
  4583. DB #08,#00,#00,#00
  4584. SMALL REVERSE SLASH
  4585. S1CODE40 DB #00,#00,#00,#00
  4586. DB #00,#20,#00,#10
  4587. DB #00,#00,#00,#00
  4588. SMALL LETTER A
  4589. S1CODE41 DB #C0,#00,#20,#05
  4590. DB #20,#05,#20,#05
  4591. DB #E0,#03,#00,#00
  4592. SMALL LETTER B
  4593. S1CODE42 DB #E0,#3F,#40,#02
  4594. DB #20,#04,#20,#04
  4595. DB #C0,#03,#00,#00
  4596. SMALL LETTER C
  4597. S1CODE43 DB #C0,#03,#20,#04
  4598. DB #20,#04,#20,#04
  4599. DB #40,#02,#00,#00
  4600. SMALL LETTER D
  4601. S1CODE44 DB #C0,#03,#20,#04
  4602. DB #20,#04,#20,#04
  4603. DB #E0,#3F,#00,#00
  4604. SMALL LETTER E
  4605. S1CODE45 DB #C0,#03,#20,#05
  4606. DB #20,#05,#20,#05
  4607. DB #20,#03,#00,#00
  4608. SMALL LETTER F
  4609. S1CODE46 DB #20,#04,#E0,#1F
  4610. DB #20,#24,#00,#20
  4611. DB #00,#10,#00,#00
  4612. SMALL LETTER G
  4613. S1CODE47 DB #50,#03,#A8,#04
  4614. DB #A8,#04,#A8,#04
  4615. DB #10,#0B,#00,#00
  4616. SMALL LETTER H
  4617. S1CODE48 DB #E0,#3F,#00,#02
  4618. DB #00,#04,#00,#04
  4619. DB #E0,#03,#00,#00
  4620. SMALL LETTER I
  4621. S1CODE49 DB #20,#04,#E0,#27
  4622. DB #20,#00,#00,#00
  4623. DB #00,#00,#00,#00
  4624. SMALL LETTER J
  4625. S1CODE4A DB #00,#00,#04,#00
  4626. DB #04,#04,#F8,#27
  4627. DB #00,#00,#00,#00
  4628. SMALL LETTER K
  4629. S1CODE4B DB #E0,#3F,#00,#01
  4630. DB #80,#01,#40,#02
  4631. DB #20,#04,#00,#00
  4632. SMALL LETTER L
  4633. S1CODE4C DB #00,#00,#00,#00
  4634. DB #20,#20,#E0,#3F
  4635. DB #20,#00,#00,#00
  4636. SMALL LETTER M
  4637. S1CODE4D DB #E0,#07,#00,#04
  4638. DB #E0,#03,#00,#04
  4639. DB #E0,#07,#00,#00
  4640. SMALL LETTER N
  4641. S1CODE4E DB #E0,#07,#00,#02
  4642. DB #00,#04,#00,#04
  4643. DB #E0,#03,#00,#00
  4644. SMALL LETTER O
  4645. S1CODE4F DB #C0,#03,#20,#04
  4646. DB #20,#04,#20,#04
  4647. DB #C0,#03,#00,#00
  4648. SMALL LETTER P
  4649. S1CODE50 DB #FC,#07,#20,#04
  4650. DB #20,#04,#20,#04
  4651. DB #C0,#03,#00,#00
  4652. SMALL LETTER Q
  4653. S1CODE51 DB #C0,#03,#20,#04
  4654. DB #20,#04,#20,#04
  4655. DB #FC,#07,#00,#00
  4656. SMALL LETTER R
  4657. S1CODE52 DB #E0,#07,#00,#02
  4658. DB #00,#04,#00,#04
  4659. DB #00,#02,#00,#00
  4660. SMALL LETTER S
  4661. S1CODE53 DB #40,#02,#20,#05
  4662. DB #20,#05,#20,#05
  4663. DB #C0,#04,#00,#00
  4664. SMALL LETTER T
  4665. S1CODE54 DB #00,#04,#00,#04
  4666. DB #C0,#3F,#20,#04
  4667. DB #20,#04,#00,#00
  4668. SMALL LETTER U
  4669. S1CODE55 DB #C0,#07,#20,#00
  4670. DB #20,#00,#20,#00
  4671. DB #C0,#07,#00,#00
  4672. SMALL LETTER V
  4673. S1CODE56 DB #00,#06,#80,#01
  4674. DB #60,#00,#80,#01
  4675. DB #00,#06,#00,#00
  4676. SMALL LETTER W
  4677. S1CODE57 DB #C0,#07,#20,#00
  4678. DB #C0,#00,#20,#00
  4679. DB #C0,#07,#00,#00
  4680. SMALL LETTER X
  4681. S1CODE58 DB #20,#04,#40,#02
  4682. DB #80,#01,#40,#02
  4683. DB #20,#04,#00,#00
  4684. SMALL LETTER Y
  4685. S1CODE59 DB #04,#07,#88,#00
  4686. DB #50,#00,#60,#00
  4687. DB #80,#07,#00,#00
  4688. SMALL LETTER Z
  4689. S1CODE5A DB #20,#06,#60,#04
  4690. DB #A0,#04,#20,#05
  4691. DB #60,#06,#00,#00
  4692. LEFT BRACKET [
  4693. S1CODE5B DB #00,#00,#00,#01
  4694. DB #F0,#1E,#08,#20
  4695. DB #08,#20,#00,#00
  4696. ELONGATED COLON
  4697. S1CODE5C DB #00,#00,#E0,#3D
  4698. DB #E0,#3D,#00,#00
  4699. DB #00,#00,#00,#00
  4700. RIGHT BRACKET ]
  4701. S1CODE5D DB #08,#20,#08,#20
  4702. DB #F0,#1E,#00,#01
  4703. DB #00,#00,#00,#00
  4704. APPROXIMATE
  4705. S1CODE5E DB #00,#10,#00,#20
  4706. DB #00,#10,#00,#10
  4707. DB #00,#20,#00,#00
  4708. RUB OUT
  4709. S1CODE5F DB #C0,#1F,#C0,#1F
  4710. DB #C0,#1F,#C0,#1F
  4711. DB #C0,#1F,#00,#00
  4712. CURSOR
  4713. S1CODE60 DB #01,#00,#01,#00
  4714. DB #01,#00,#01,#00
  4715. DB #01,#00,#01,#00
  4716. CHCURSOR
  4717. S1CODE61 DB #00,#00,#00,#00
  4718. DB #80,#00,#C0,#01
  4719. DB #80,#00,#00,#00
  4720. M0CODE5F DB #F0,#1F,#F0,#1F RUBOUT
  4721. DB #F0,#1F,#F0,#1F
  4722. DB #F0,#1F,#F0,#1F
  4723. DB #F0,#1F,#F0,#1F
  4724. M0CODE60 DB #01,#00,#01,#00 CURSOR
  4725. DB #01,#00,#01,#00
  4726. DB #01,#00,#01,#00
  4727. DB #01,#00,#01,#00
  4728. M0CODE61 DB #00,#00,#00,#00 CHCURSOR
  4729. DB #00,#00,#00,#01
  4730. DB #80,#03,#00,#01
  4731. DB #00,#00,#00,#00
  4732. LWA EQU *
  4733. EJECT
  4734. IST.STK EQU LWA+45 PROCESSOR STACK
  4735. G.BEGIN EQU LWA+45
  4736. ********************
  4737. *
  4738. * TERMINAL VARIABLES AND SCRATCH AREA
  4739. *
  4740. ********************
  4741. KBAADR EQU LWA+45 KB TO ASCII CONVERT
  4742. BIAS EQU KBAADR+2 BIAS OF Y COORDINATE
  4743. BYPASS EQU BIAS+2 BY PASS CONDITION FLAG
  4744. CHBASE EQU BYPASS+1
  4745. CLK.1 EQU CHBASE+2
  4746. CLK.2 EQU CLK.1+1
  4747. CLOCK EQU CLK.2+1 BLINK CURSOR CLOCK
  4748. CMODE EQU CLOCK+2 COMMAND MODE
  4749. CRLFFG EQU CMODE+1 CR/LF FLAG
  4750. CTLADR EQU CRLFFG+1 CONTROL CODES BASE ADR.
  4751. DASH EQU CTLADR+2 DASH/SOLID VECTOR FLAG
  4752. DARK EQU DASH+1 DARK VECTOR FLAG
  4753. D.CNTL2P EQU DARK+1 TEMP DISPLAY CONTROL WORD
  4754. D.CNTL2D EQU D.CNTL2P+1 TEMP DISPLAY CONTROL WORD
  4755. DOTS EQU D.CNTL2D+1 DOT MOVEMENT FOR GIN MODE
  4756. ECURSOR EQU DOTS+1 ERASE BITS FOR CURSOR
  4757. ESCADR EQU ECURSOR+1 ESCAPE SEQUENCE BASE ADR.
  4758. E.CNTR EQU ESCADR+2
  4759. EREG EQU E.CNTR+1
  4760. ESEGLEN EQU EREG+1 ERASE SEGMENT LENGTH
  4761. G.CNTL2 EQU ESEGLEN+1
  4762. G.CTLFLG EQU G.CNTL2+1 CTL MODE FLAG
  4763. G.DDIR EQU G.CTLFLG+1
  4764. G.ESC EQU G.DDIR+1
  4765. G.MEMSEL EQU G.ESC+1
  4766. G.MODE EQU G.MEMSEL+2
  4767. G.SIZE EQU G.MODE+1
  4768. G.SUPCUR EQU G.SIZE+1
  4769. G.TTYFLG EQU G.SUPCUR+1
  4770. G.XPOS EQU G.TTYFLG+1
  4771. G.YPOS EQU G.XPOS+2
  4772. GIN.KEY EQU G.YPOS+2
  4773. HEIGHT EQU GIN.KEY+1
  4774. HIX EQU HEIGHT+1
  4775. HIY EQU HIX+2
  4776. KBDATA EQU HIY+2
  4777. LINEND EQU KBDATA+1
  4778. LOC.RMT EQU LINEND+2
  4779. LOX EQU LOC.RMT+1
  4780. LOY EQU LOX+1
  4781. MREG EQU LOY+1
  4782. NBYTES EQU MREG+1
  4783. NREG EQU NBYTES+1
  4784. M.MODEP EQU NREG+1
  4785. NINPUT EQU M.MODEP+1
  4786. PAGEND EQU NINPUT+1
  4787. PAGEFULL EQU PAGEND+2
  4788. PMC.FLG EQU PAGEFULL+1
  4789. SAVE EQU PMC.FLG+1
  4790. SCALEFG EQU SAVE+2
  4791. SELECT.M EQU SCALEFG+1
  4792. SH.SUP EQU SELECT.M+2
  4793. TSTAT EQU SH.SUP+1
  4794. BTWICE EQU TSTAT+1
  4795. VECFLAG EQU BTWICE+1
  4796. WCURSOR EQU VECFLAG+1 WRITE BITS FOR CURSOR
  4797. WEFLAG EQU WCURSOR+1
  4798. WIDTH EQU WEFLAG+1
  4799. WSEGLEN EQU WIDTH+1 WRITE SEGMENT LENGTH
  4800. X1 EQU WSEGLEN+1
  4801. Y1 EQU X1+2
  4802. X2 EQU Y1+2
  4803. Y2 EQU X2+2
  4804. *
  4805. * TRANSMIT BUFFER
  4806. *
  4807. TXBUF EQU Y2+2
  4808. *
  4809. * RECEIVE BUFFER
  4810. *
  4811. RXBUF EQU TXBUF+11
  4812. BC.REG EQU RXBUF+258
  4813. * PLATO OPERATIONS CHARACTER FLAGS NOTE ORDER
  4814. BLOCKX EQU BC.REG+1
  4815. BLOCKY EQU BLOCKX+2
  4816. XEND EQU BLOCKY+2
  4817. YEND EQU XEND+2
  4818. XDELTA EQU YEND+2
  4819. YDELTA EQU XDELTA+2
  4820. BLOCKF EQU YDELTA+2
  4821. MEMREG EQU BLOCKF+1
  4822. *
  4823. IN.BUF EQU MEMREG+2 KB/TP INPUT BUFFER
  4824. *
  4825. US.FIFO EQU IN.BUF+19
  4826. COMMAND EQU US.FIFO+19
  4827. * EXTERNAL DEVICE OUTPUT INSTRUCTION
  4828. EXT.OUT EQU COMMAND+5
  4829. * EXTERNAL DEVICE INPUT INSTRUCTION
  4830. EXT.IN EQU EXT.OUT+6
  4831. MODEADR EQU EXT.IN+3
  4832. G.END EQU MODEADR+2
  4833. END START
plato/source/plaopl/asc1ram.txt ยท Last modified: 2023/08/05 18:54 by Site Administrator