home *** CD-ROM | disk | FTP | other *** search
/ Outlet 81 / outlet-81.mgt / TOR-ED4SO < prev    next >
Text File  |  2021-04-18  |  28KB  |  1,741 lines

  1.      ** TORNADO  Z-80 assembler **
  2.  
  3. ; TORNADO-EDITOR-source ---- 106
  4.  
  5. ;let op:   linbuf en chartable op a * 256 !
  6. ;          symbtop op             a * 16
  7.  
  8.  
  9. filstrt á32768 ;start of textfile
  10. Vfilmax á65260 ;default end of text
  11. symbtop á65520 ;top of symboltable
  12.  
  13. linbuf á32512 ;start of linebuffer
  14. linlast álinbuf +63 ;end of linebuffer
  15. xpos álinbuf +68 ;hor. printpos (pixels)
  16. ypos áXPOS +1 ;vert. printpos (pixels)
  17. linpoint áXPOS +2 ;pointer in linebuffer
  18. altflg áXPOS +4 ;zero if no changes in line
  19. hulp áXPOS +5 
  20. scrtop áXPOS +6 ;addr. of first line on screen
  21. curslin áXPOS +8 ;addr. of line with cursor
  22. filend áXPOS +10 ;actual end of text
  23. filmax áXPOS +12 ;last useable addr. for text
  24. findadd áXPOS +14 ;addr. of item last found
  25. asspoint áXPOS +16 ;assemble address
  26. dumpa áXPOS +18 ;addr. to store ass.code
  27. dumpf áXPOS +20 ;start of ass.code in mem.
  28. pass áXPOS +22 ;pass counter
  29. errcnt áXPOS +23 ;error counter
  30. sympo áXPOS +24 ;bottom of symboltable
  31. storevar áxpos +26 ;temp store
  32. findtable áXPOS +40 ;start of find$, poked by
  33.  ;                      BASIC
  34.  
  35.  
  36. ;          ORG  26000
  37. ;          DUMP 60000    ;this file might be too long now!
  38.  
  39.  
  40. begin ┤Ç,(altflg); 0 = warmstart, to menu
  41. î2 ; 1 = coldstart, default line
  42. ▒σ,warm ; 2 = coming from 'find', to
  43. àÇ;                        text
  44. è╛,koud 
  45. èprmenu 
  46. wait ┌8 
  47. û#1B;test key pressed
  48. à223 ;use CAPS
  49. î"B" 
  50. ▒σ,7406 ;basic
  51. î"A" 
  52. ▒σ,assemble ;assemble
  53. î"C" 
  54. ▒σ,movblok ;copy block
  55. î"D" 
  56. ▒σ,dellblok ;delete block
  57. î"M" 
  58. ▒σ,movblok ;move block
  59. î"N" 
  60. ▓╛,w1 
  61. èkoud ;prepare for new text
  62. ▒warm 
  63.  
  64. w1 î"O" 
  65. ▒σ,warm ;to existing text
  66. î"P" 
  67. ▓╛,w5 ;cont. if not PRINT TEXT
  68. ;PRINT TEXTFILE
  69. ┤Ç,3 ;open #3
  70.  è5633
  71. ègetblmark ;test for 2 blockmarkers
  72. ▓σ,w2 ;jp if found
  73. ┤Ñ,filstrt ;else print complete text
  74. ┤ö,(filend)
  75. ▓w3 
  76. w2 íö,Ñ;make DE point to end of
  77. òö;                 last line
  78.  ┤Ç,(ö)
  79.  î13
  80. ▓╛,w2 +1 
  81. èvolger ;make HL point to start of
  82. ▒σ,begin ;                first line
  83. w3 ╩ö
  84. ┤(curslin),Ñ
  85. èexpandlin ;expand line into linebuffer
  86. ┤ö,linbuf ;print 64 characters
  87. w4 ┤Ç,(ö)
  88.  ╩ö
  89.  ┌16
  90.  ╔ö
  91.  ⌐¥
  92.  ┤Ç,¥
  93. à191 ;test 64
  94. ▓╛,w4 
  95. ┤Ç,13 ;finish with ENTER
  96.  ┌16
  97. ╔ö;retrieve 'last line'
  98. èVOLGENDE ;next line
  99. ▒σ,begin ;jp if end of text
  100.  ╩Ñ
  101.  àÇ
  102. █Ñ,ö;test for end of block
  103.  ╔Ñ
  104. ▓ë,w3 ;cont. if not
  105. ┤ç,begin ;set RETaddr.
  106. ▒mb4 ;delete blockmarkers
  107. ;TEST MORE KEYS
  108. w5 î"T" 
  109. ▒σ,SYMT ;print symbols
  110. î"V" 
  111. ▒σ,SYMV ;view symbols
  112.  
  113. ┤ç,500 ;save code = 500
  114. î"R" 
  115. ▓σ,w6 
  116. ┤ç,1000 ;find = 1000
  117. î"F" 
  118. ▓σ,w6 
  119. ┤ç,2000 ;load = 2000
  120. î"L" 
  121. ▓σ,w6 
  122. ┤ç,4000 ;save = 4000
  123. î"S" 
  124. ▓σ,w6 
  125. ┤ç,6000 ;merge = 6000
  126. î"Q" 
  127.  ▒╛,WAIT
  128. w6 ═;GOTO BC
  129.  
  130. movblok ┤(storevar +1),Ç;save command temp
  131. ègetblmark ;find blockmarkers
  132. ▒╛,BLMERR ;error if not found
  133. ╩Ñ;store marker positions
  134.  ╩ö
  135. ┤ç,(CURSLIN);test cursorposition
  136.  ΣÇ
  137. █Ñ,ç;against endmarker
  138. ▓ë,mb0 ;jp if cursor past block
  139. íö,Ñ;get startmarker
  140. òÑ
  141. òÑ
  142.  █Ñ,ç
  143. ▒ë,blmerr -2 ;error if inside block
  144. mb0 üÇ,0 ;save cursorpos. flag
  145. ┤(storevar),Ç
  146. ╔ö;retrieve markers
  147.  ╔Ñ
  148. mb1 òÑ;adjust HL
  149.  ┤Ç,(Ñ)
  150.  î13
  151.  ▓╛,MB1
  152. mb2 ┤Ç,(ö);adjust DE
  153.  ⌐ö
  154.  î13
  155.  ▓╛,MB2
  156.  àÇ
  157.  █Ñ,ö
  158. ┤å,ú;BC = length of block
  159.  ┤ë,│
  160.  ⌐ç
  161.  ╩ç
  162.  ╩ö
  163. èMKROOM ;make room for block
  164.  ╔ö
  165.  ╔ç
  166. ▓ë,BLMERR ;error if no room
  167.  íö,Ñ
  168. ┤Ç,(storevar);retrieve cursorpos. flag
  169.  àÇ
  170.  ▓╛,MB3
  171. éÑ,ç;add 'room' if necessary
  172. mb3 ╕;move block
  173. ┤Ç,(storevar +1);retrieve command
  174. î"M" 
  175. ▓σ,DELLBLOK ;delete old block
  176.  
  177. ┤ç,WARM ;RETaddr.
  178. mb4 ╩ç
  179. ègetblmark ;find blockmarkers
  180. ═╛;exit if not found
  181. ╩ö;save first marker addr.
  182. èmb5 ;delete second marker at HL
  183. ╔Ñ;first marker
  184. mb5 èVORIGE +3 ;find start of line
  185.  ┤Æ,ú
  186.  ┤¥,│
  187. èVOLGER ;find end of line
  188.  ;delete line now
  189. DELLSUB ╩Ñ;save addr. of nextlin
  190. ┤å,ú;DE = curslin
  191. ┤ë,│;BC = nextlin
  192.  ┤Ñ,(FILEND)
  193.  àÇ
  194. █Ñ,ç;calc length of 'tail'
  195.  í(▀),Ñ
  196. ╔ç;HL = addr. of nextlin
  197. ⌐ç;BC = length
  198. ╕;move 'tail' from nextlin
  199. òö;to curslin
  200. ┤(FILEND),ö;adjust pointer
  201.  ═
  202.  
  203. dellblok ègetblmark ;find blockmarkers
  204. ▓╛,BLMERR ;error if not found
  205. ╩Ñ;store 2nd marker
  206. íö,Ñ;use 1th marker
  207. èVORIGE +3 ;find start of block
  208.  íö,Ñ
  209.  ╔Ñ
  210. èVOLGER ;find end of block
  211. èDELLSUB ;delete block
  212.  ▒WARM
  213.  
  214. mkroom ╩ç;store length
  215. èVOLGENDE ;find start of next line
  216. í(▀),Ñ;HL = length
  217. ╔ç;BC = next line
  218.  ╩ç
  219. èBIGLINE ;make room
  220.  ╔Ñ
  221.  ═
  222.  
  223. getblmark ┤ö,filstrt 
  224. ┤Ñ,(filend)
  225.  àÇ
  226.  █Ñ,ö
  227.  íö,Ñ
  228. ┤å,Æ;BC = length of file
  229.  ┤ë,¥
  230. ┤Ç,126 ; blockmarker = chr$ 126
  231. É;find
  232. ═╛;exit if not found
  233. ╩Ñ;store addr. found
  234. É;cont. search
  235. ╔ö;DE = first marker
  236.  ═
  237.  
  238. ╔Ñ;error exit
  239.  ╔Ñ
  240. BLMERR ┤ç,BERM ;point to block-error-msge
  241.  
  242. PRINTERR ┤Ñ,POSM ;point to position controllers
  243. èprintmsge 
  244. ┤ú,å;point to msge in BC
  245.  ┤│,ë
  246. èprintmsge 
  247.  ▒WAIT
  248.  
  249. prmenu ┤Ç,7 ;cls screen
  250. ┤(23693),Ç;ATTR-P
  251. ┤(23624),Ç;BORDERCOL
  252.  ΣÇ
  253. ┤(23694),Ç;MASK-P
  254. ┤(23697),Ç;Pflag
  255.  ├(254),Ç
  256. è3435 ;do cls
  257. ┤Ç,2 ;open #2
  258.  è5633
  259. ┤Ñ,menutable ;print menu part 1
  260. èprintmsge 
  261.  ╩Ñ
  262. ┤Ñ,filstrt ;find end of text
  263.  ┤ç,32512
  264. ┤Ç,255 
  265.  É
  266. ┤ç,ferm ;point to file-error-msge
  267. ▒╛,printerr ;jp if no endmarker found
  268.  òÑ
  269. ┤(filend),Ñ;store end of text
  270. ┤Ç,ú
  271. Γ128 ;BC = end-32768 = length
  272.  ┤å,Ç
  273. ┤ë,│
  274.  ⌐ç
  275. è11563 ;print length of text
  276.  è11747
  277.  ╔Ñ
  278. èprintmsge ;print 'file + merge' msge
  279. ┤ç,(filend);BC = merge addr.
  280.  è11563
  281.  è11747
  282.  
  283. ┤Ñ,127 ;find$ is default chr$ 127
  284. ┤(findtable),Ñ;           chr$ 0 = endmarker
  285.  
  286. ---------------------------------------------------------------
  287.  
  288. menutable ù"  * TORNADO Z-80 assembler *" 
  289. û13,13,13 
  290. ù"O= To editor   P= Print text" :û13 
  291. ù"N= New text    T= Print symbols" :û13 
  292. ù"A= Assemble    V= View  symbols" :û13 
  293. û13 
  294. ù"D= Del. block  L= Load  text" :û13 
  295. ù"M= Move block  Q= Merge text" :û13 
  296. ù"C= Copy block  S= Save  text" :û13 
  297. ù"F= Find text   R= SAVE  code" :û13 
  298. û13 
  299. ù"B= TO BASIC" 
  300. û13,13,13 
  301. ù" File: 32768," 
  302. û255,13 
  303. ù" Merge-addr:" 
  304. û255
  305.  
  306. POSM û22,21,3,20,1,255 
  307. BERM ù"INVALID BLOCK COMMAND" 
  308.  û255
  309. FERM ù"INCORRECT FILE" 
  310.  û255
  311. SERM ù"SYMBOLTABLE: " 
  312.  û255
  313. ù" - 65520" 
  314. û255 
  315. ASSM ù"ASSEMBLY " 
  316.  û255
  317. OKSM ù"O.K., " 
  318.  û255
  319. ASER ù"ABORTED, " 
  320.  û255
  321. ERRM ù" ERRORS" 
  322.  û255
  323. CODM û22,20,3,20,1 
  324. ù"CODE AT: " 
  325.  û255
  326.  
  327. ASSEXIT ┤Ñ,POSM ;print AT
  328. èprintmsge 
  329. ┤Ñ,ASSM ;"assembly"
  330. èprintmsge 
  331. ┤Ñ,OKSM ;point to "O.K."
  332. ┤Ç,(errcnt);test for errors
  333.  àÇ
  334.  ┤å,0
  335.  ┤ë,Ç
  336. ▓σ,AXI ;jp if no errors
  337. ┤Ñ,aser ;point to "aborted"msge
  338. AXI èprintmsge ;print msge
  339. è11563 ;print number of errors
  340.  è11747
  341. ┤Ñ,ERRM ;"errors"
  342. èprintmsge 
  343. ┤Ç,(errcnt)
  344.  àÇ
  345. ▒╛,WAIT ;exit if errors
  346. ┤Ñ,CODM ;"code"
  347. èprintmsge 
  348. ┤ç,(DUMPF);store-address
  349.  è11563
  350.  è11747
  351. ┤Ç,44 ;comma
  352.  ┌16
  353. ┤Ñ,(DUMPA);calc. length
  354. ┤ö,(DUMPF)
  355.  àÇ
  356.  █Ñ,ö
  357. ┤å,ú;print length
  358.  ┤ë,│
  359.  è11563
  360.  è11747
  361. ▒WAIT ;to wait-key
  362.  
  363. KOUD ΣÇ;reset pointers
  364.  ┤(ALTFLG),Ç
  365.  ┤Ñ,SYMBTOP
  366.  ┤(SYMPO),Ñ
  367.  ┤Ñ,VFILMAX
  368.  ┤(FILMAX),Ñ
  369. ┤Ñ,filstrt ;insert default line
  370.  íö,Ñ
  371.  ┤Ñ,CMESG
  372. ┤ç,21 
  373.  ╕
  374. òö;DE = end of text
  375.  ┤(FILEND),ö
  376. ┤Ñ,#0214;repdel=20 , repper=2
  377. ┤(23561),Ñ
  378.  ═
  379.  
  380. cmesg û13,127 
  381. ù" * SCUMARI R&D *" 
  382. û13,13,255
  383.  
  384. VOLGENDE ┤Ñ,(CURSLIN);find addr. of next line
  385. VOLGER ┤Ç,(Ñ)
  386.  ⌐Ñ
  387.  î13
  388.  ▓╛,VOLGER
  389.  ┤Ç,(Ñ)
  390. ⌐Ç;test for 255 = end of file
  391. ═;RET Z if eof
  392.  
  393. VORIGE ┤Ñ,(CURSLIN);find addr. of previous line
  394. ┤ö,filstrt 
  395.  àÇ
  396.  █Ñ,ö
  397. íä,â;save flag
  398. éÑ,ö;restore HL
  399.  íä,â
  400. ═σ;ret if cursor on first line
  401.  òÑ
  402. VOR1 █Ñ,ö
  403.  éÑ,ö
  404.  ▓ë,VOR2
  405.  òÑ
  406. ┤Ç,(Ñ);find end of line
  407. î14 ;test enter
  408.  ▓║,VOR1
  409. VOR2 ⌐Ñ;point to first char of line
  410.  ═
  411.  
  412. WARM èCLS
  413. ┤Ñ,filstrt ;set pointers to start of file
  414.  ┤(FINDADD),Ñ
  415.  ┤(SCRTOP),Ñ
  416. WM1 ┤(CURSLIN),Ñ;print file on scr.
  417.  èPRLIN
  418.  èVOLGENDE
  419. ▓σ,EDITOR ;exit if end of file
  420. ┤Ç,(YPOS);1 line down
  421.  Γ8
  422.  ┤(YPOS),Ç
  423. ▓║,WM1 ;until screen full
  424. ┤Ñ,#B800;top left cursor coords
  425.  ┤(XPOS),Ñ
  426.  ┤Ñ,(SCRTOP)
  427. ┤(CURSLIN),Ñ;point to topline
  428. èENTEX ;copy also to linebuffer
  429.  
  430. EDITOR ΣÇ;point to start of line
  431. ┤(XPOS),Ç;on screen
  432. ┤Ñ,linbuf ;and in linebuffer
  433.  ┤(LINPOINT),Ñ
  434. WAITKEY ₧
  435. ╠5,(░+1);'no key'
  436. ΣÇ;'cursor off' flag
  437. wk0 èCURSOR 
  438. ┤å,6 ;delay
  439. wk1 ê5,(░+1)
  440. ▓╛,GET ;jp if key pressed
  441. ñ;delay
  442. ¢wk1 
  443. ▓wk0 
  444.  
  445. GET àÇ;cursor flag
  446. è╛,CURSOR ;unprint cursor if 'on'
  447.  ╠5,(░+1)
  448. ┤Ç,(23560);get key
  449. î197 ;'OR'
  450.  ▓╛,G1
  451.  èDELLINE
  452.  ▓G4 -1
  453. G1 î198 ;'AND'
  454.  ▓╛,G2
  455.  èINSLINE
  456.  èCURSDOWN
  457.  ▓G4 -1
  458. G2 î199 ;'<='
  459.  ▓╛,G3
  460. èINSSP ;delete space
  461.  ▓G4 -1
  462. G3 î200 ;'>='
  463. ▓╛,G4 
  464. èINSSP ;insert space
  465. ΣÇ;signal 'click needed'
  466. G4 î226 
  467. ▓σ,G5 
  468. ê7,Ç
  469. ▓╛,wk0 -1 ;ignore other extended keys
  470.  
  471. G5 íä,â;save key
  472. ┤Ñ,50 ;click
  473.  ┤ö,1
  474.  è949
  475. íä,â;get key
  476.  àÇ
  477. è╛,DOKEY ;call if valid key
  478. ▓WAITKEY ;editor loop
  479.  
  480. CURSOR íä,â;'print cursor' flag
  481. èCALC ;calc screenpos
  482. ┤Ç,ú;bottom pixelrow
  483.  éÇ,7
  484.  ┤ú,Ç
  485. ┤ö,#F00F;two cursor-patterns
  486.  ┤Ç,(XPOS)
  487.  à4
  488.  ▓σ,C1
  489. ┤Æ,¥;choose pattern
  490. C1 ┤Ç,Æ
  491. Σ(Ñ);move into screen
  492.  ┤(Ñ),Ç
  493.  íä,â
  494. Σ1 ;toggle cursorflag
  495.  ═
  496.  
  497. DOKEY î226 
  498. ▓σ,CONTROL 
  499. î32 
  500. ▓║,CHAR ;jp with normal chars
  501. CONTROL Γ4 ;test shifted numberkeys
  502.  ▒σ,PAGEDOWN
  503.  òÇ
  504.  ▒σ,PAGEUP
  505.  òÇ
  506.  ▓σ,CAPS
  507.  òÇ
  508.  ▒σ,FINDS
  509.  òÇ
  510. ▒σ,LEFT ;cursor
  511.  òÇ
  512.  ▒σ,RIGHT
  513.  òÇ
  514.  ▒σ,CURSDOWN
  515.  òÇ
  516.  ▒σ,CURSUP
  517.  òÇ
  518. ▓σ,BKSP ;backspace
  519.  òÇ
  520.  ▓σ,ENTER
  521. òÇ
  522. ▒σ,errmark 
  523.  òÇ
  524. ▓σ,blkmark ;graphics, insert blockmarker
  525.  
  526. ;to menu when 'STOP'
  527. èstorelin ;store current line if nec.
  528. ╔ç;drop retaddr.
  529. ┤Ñ,(filend);delete empty lines
  530. òÑ;if any at end of file
  531. EX1 òÑ
  532.  ┤Ç,(Ñ)
  533.  î13
  534.  ▓σ,EX1
  535.  ⌐Ñ
  536.  ⌐Ñ
  537. ┤(Ñ),255;insert endmarker 
  538. ┤(filend),Ñ
  539. íö,Ñ;cursor in deleted lines?
  540. ┤Ñ,(curslin)
  541. ΣÇ
  542. █Ñ,ö
  543. ▓ë,ex2 
  544. òö;adjust cursoraddr. if nec.
  545. ┤(curslin),ö
  546. EX2 ▒begin ;to menu
  547.  
  548. CAPS ┤Ñ,23658 ;toggle capsflag
  549.  ┤Ç,8
  550.  Σ(Ñ)
  551.  ┤(Ñ),Ç
  552.  ═
  553.  
  554. blkmark èINSLINE ;insert new line
  555. èCURSDOWN ;move cursor
  556. ┤Ç,126 ;=blokmarker
  557. CHAR ┤Ñ,ALTFLG
  558. ▌0,(Ñ);signal 'line changed'
  559.  ┤Ñ,(LINPOINT)
  560. ┤(Ñ),Ç;insert marker
  561. èMOVELIN ;copy to screen
  562.  ;move cursor and ret
  563. RIGHT ┤Ç,(XPOS);adjust curspos.
  564.  éÇ,4
  565. ═ë;ret if at margin
  566.  ┤Ñ,LINPOINT
  567.  ⌐(Ñ)
  568.  ┤(XPOS),Ç
  569.  ═
  570.  
  571. BKSP ┤Ñ,ALTFLG
  572. ▌0,(Ñ);line changed
  573. ┤Ñ,(LINPOINT);cursorpos. in buffer
  574.  ┤ö,LINLAST
  575.  ┤Ç,(Ñ)
  576.  àÇ
  577.  █Ñ,ö
  578. ▓ë,BK1 ;jp if not last char on line
  579.  î32
  580. ▓╛,BK1 +3 ;jp if <> space
  581. BK1 èLEFT ;'delete' char
  582. ┤Ç,32 ;change into space
  583. ┤Ñ,(LINPOINT);in buffer
  584.  ┤(Ñ),Ç
  585. ▒MOVELIN ;copy to screen
  586.  
  587. ENTER èSTORELIN ;store current line if nec.
  588. ═ë;ret if no room
  589. èVOLGENDE ;next line in file
  590. ▓╛,ENT1 ;jp if not end of file
  591. ┤Ç,(FILMAX +1);new line, test for room
  592.  îú
  593.  ▒ë,IFEX
  594. ┤(Ñ),13 ;insert new line
  595.  ⌐Ñ
  596.  ┤(Ñ),255
  597.  ┤(FILEND),Ñ
  598.  òÑ
  599. ENT1 ┤(CURSLIN),Ñ;adjust cursor
  600. èDOWN ;on screen
  601. ENTEX èPRLIN ;move line to screen + buffer
  602. ΣÇ;cursor points to start of
  603. ┤(XPOS),Ç;line on screen
  604. ┤(LINPOINT),Ç;also to start of linebuffer
  605.  ═
  606.  
  607. LEFT ┤Ç,(XPOS);adjust cursorpos.
  608.  Γ4
  609. ═ë;ret if at margin
  610.  ┤Ñ,LINPOINT
  611.  ò(Ñ)
  612.  ┤(XPOS),Ç
  613.  ═
  614.  
  615. ;insert space
  616. INSSP ┤Ñ,ALTFLG ;signal: line changed
  617.  ▌0,(Ñ)
  618. ┤ö,(LINPOINT);pointer in buffer
  619. ┤Ñ,LINLAST ;end of buffer
  620.  àÇ
  621.  █Ñ,ö
  622. ═σ;ret if cursor on last pos.
  623.  ┤å,ú
  624.  ┤ë,│
  625. î199 ;test command <=
  626. ▓σ,RECSP ;jp if 'delete space'
  627. ┤ö,LINLAST ;move buffercontents
  628.  ┤ú,Æ
  629.  ┤│,¥
  630.  òÑ
  631. ╢;make room
  632. ▓REC1 ;to put a space on cursorpos.
  633.  
  634. RECSP ┤ú,Æ;reclaim one space
  635.  ┤│,¥
  636.  ⌐Ñ
  637.  ╕
  638. REC1 ┤Ç,32 ;'delete' last char on line
  639.  ┤(ö),Ç
  640. ┤Ñ,(XPOS);save curspos. screen
  641.  ╩Ñ
  642.  ΣÇ
  643. ┤(XPOS),Ç;temp!
  644. ┤Ñ,(LINPOINT);save curspos buffer
  645.  ╩Ñ
  646. èMOVELIN ;store line + reprint
  647. ╔Ñ;restore cursorpositions
  648. ┤(LINPOINT),Ñ;in linebuffer
  649.  ╔Ñ
  650. ┤(XPOS),Ñ;in screen
  651.  ═
  652.  
  653. CURSUP ┤Ç,(XPOS)
  654.  ╩ä
  655.  èSTORELIN
  656. ▒ë,CURSEX ;jp if no room
  657.  èVORIGE
  658. ▒σ,CURSEX ;jp if on first line
  659.  ┤(CURSLIN),Ñ
  660. ┤Ç,(YPOS);one line down
  661.  éÇ,8
  662.  ┤(YPOS),Ç
  663. î185 ;test for top of screen
  664. ▒ë,UDOLIN ;jp if still on screen
  665. ┤Ç,184 ;else restore top of screen
  666.  ┤(YPOS),Ç
  667. ┤(SCRTOP),Ñ;store new top line addr.
  668. èSCRDW ;scroll down
  669. ▒UDOLIN ;print new line
  670.  
  671. SCRDW ΣÇ
  672.  ┤å,Ç
  673. SCRDW1 ┤ú,Ç;topleft coords = 0,0
  674.  ┤│,å
  675.  ┤ë,Ç
  676. èCALC +3 ;screenaddr.
  677.  íö,Ñ
  678.  ┤Ç,ë
  679.  éÇ,8
  680. ┤ú,Ç;HL = 8 pixels down
  681.  ┤│,å
  682. èCALC +3 ;screenaddr.
  683. SCRDW2 ┤Ç,ë
  684. ┤ë,32 ;move 32 bytes (1 line)
  685.  ╕
  686. ┤ë,224 ;point to next line
  687.  éÑ,ç
  688.  íö,Ñ
  689. éÑ,ç;point to next line
  690.  íö,Ñ
  691. ⌐Ç;count for 8 pixelrows
  692.  ┤ë,Ç
  693.  à7
  694.  ▓╛,SCRDW2
  695. ┤Ç,(YPOS);count for 23 lines this way
  696.  Γ8
  697.  îë
  698.  ═ ë
  699.  ┤Ç,ë
  700.  ▓SCRDW1
  701.  
  702. INSLINE èVOLGENDE ;find next lineaddr. in HL
  703.  ┤ö,(FILEND)
  704.  íö,Ñ
  705. ┤Ç,(FILMAX +1);test room
  706.  îú
  707. ▒ë,IFEX ;jp if no room
  708.  █Ñ,ö
  709. ┤å,ú;BC = length
  710.  ┤ë,│
  711.  ⌐ç
  712.  ┤ö,(FILEND)
  713.  ┤ú,Æ
  714.  ┤│,¥
  715.  ⌐ö
  716.  ┤(FILEND),ö
  717. ╢;make room for one chr$ 13
  718.  ┤Ç,13
  719.  ┤(ö),Ç
  720. ┤Ç,(YPOS);test for bottomline
  721.  î8
  722. ▓σ,INSL1 ;jp if second lowest line
  723. ▓║,INSL2 ;jp if not on bottom
  724. ;insert blank line at bottom
  725. èSCRUP ;scroll 1 line up
  726. èCLIN ;cls botlin
  727. ┤Ç,8 ;adjust cursor
  728.  ┤(YPOS),Ç
  729. ┤Ñ,(SCRTOP);adjust scrtop line
  730.  èVOLGER
  731.  ┤(SCRTOP),Ñ
  732.  ═
  733. ;insert on second lowest
  734. INSL1 ΣÇ;prepare to clean botlin
  735.  ┤å,Ç
  736. ▓CLIN ;clear 1 line
  737.  
  738. INSL2 èSCRDW ;make room on screen
  739. CLIN ┤ú,Ç
  740.  ┤│,å
  741. èCALC +3 ;calc scraddr. from A and B
  742. ┤å,8 ;8 pixrows
  743. CL1 ╩Ñ
  744. CL2 ┤(Ñ),0 ;fill with zero
  745.  ⌐│
  746.  ┤Ç,│
  747. à31 ;32 bytes
  748.  ▓╛,CL2
  749.  ╔Ñ
  750.  ⌐ú
  751. ¢CL1 ;next pixrow
  752.  ═
  753.  
  754. CURSDOWN ┤Ç,(XPOS)
  755. ╩ä;store xpos
  756.  èSTORELIN
  757. ▓ë,CURSEX ;jp if no room for line
  758.  èVOLGENDE
  759. ▓╛,CSD ;jp if there is a next line
  760. CURSEX ╔ä
  761. ═;if end of file
  762.  
  763. CSD ┤(CURSLIN),Ñ
  764. èDOWN ;move cursor down or screen up
  765. UDOLIN èPRLIN ;print next line
  766.  ╔ä
  767. ┤(XPOS),Ç;restore xpos
  768. ┤ç,#04FF;calc bufferpos. from scr.pos.
  769. UDO1 ⌐ë
  770.  Γå
  771.  ▓║,UDO1
  772.  ┤å,0
  773. ┤Ñ,linbuf 
  774.  éÑ,ç
  775. ┤(LINPOINT),Ñ;store current addr. in buff
  776.  ═
  777.  
  778. DOWN ┤Ç,(YPOS);test for bottom of screen
  779.  Γ8
  780. ▓ë,D1 ;jp if scroll needed
  781.  ┤(YPOS),Ç
  782.  ═
  783.  
  784. D1 ┤Ñ,(SCRTOP);adjust scrtop first
  785.  èVOLGER
  786.  ┤(SCRTOP),Ñ
  787. SCRUP ┤Ç,184 ;point to topline
  788.  ┤å,0
  789. SCRUP1 ┤ú,Ç
  790.  ┤│,å
  791. ┤ë,Ç;store pixrow counter
  792. èCALC +3 ;calc this rowaddr.
  793.  íö,Ñ
  794.  ┤Ç,ë
  795. Γ8 ;1 line down
  796.  ┤ú,Ç
  797.  ┤│,å
  798. èCALC +3;calc 1 line down addr.
  799. SCRUP2 ┤Ç,ë
  800. ┤ë,32 ;move 32 bytes on each row
  801.  ╕
  802.  ┤ë,224
  803. éÑ,ç;find next rowaddr
  804.  íö,Ñ
  805.  éÑ,ç
  806.  íö,Ñ
  807.  òÇ
  808.  ┤ë,Ç
  809. à7 ;counter in lower bits
  810. ▓╛,SCRUP2 ;8 pixrows to move
  811.  ┤Ç,ë
  812.  àÇ
  813. ▓╛,SCRUP1 ;until init. A = 0
  814.  ═
  815.  
  816. ;DELETE A LINE
  817. delline ┤Ñ,(CURSLIN)
  818.  ┤Æ,ú
  819.  ┤¥,│
  820. èVOLGER ;result in HL
  821. ▓╛,DELL1 ;jp if not end of text
  822. íö,Ñ;on last line simply insert
  823. ┤(Ñ),13 ;eol +eof
  824.  ⌐Ñ
  825.  ┤(Ñ),255
  826. ┤(FILEND),Ñ;adjust pointer
  827. ▒ENTEX ;move line to scr +buf
  828.  
  829. DELL1 èDELLSUB ;delete the line
  830. ┤Ç,(YPOS);test for bottom of screen
  831.  àÇ
  832. ▓╛,DELL2 ;jp if scroll needed
  833.  ┤Ñ,(CURSLIN)
  834. ▒ENTEX ;move line to scr + buf
  835.  
  836. DELL2 èSCRUP +2 ;adjust screen
  837.  ┤Ç,(YPOS)
  838. ┤Ñ,(CURSLIN);find line past bottom of scr.
  839. DLL Γ8
  840.  ╩ä
  841.  èVOLGER
  842. ▓σ,DELL3 ;exit if last line in file
  843.  ╔ä
  844.  àÇ
  845. ▓╛,DLL ;cont. until botlin +1 found
  846.  
  847.  ┤ö,YPOS
  848.  ┤Ç,(ö)
  849. ╩ä;save ypos
  850. ΣÇ;ypos = 0, temporarely
  851.  ┤(ö),Ç
  852. èexpandlin +3 ;move this line into linbuf
  853. èMOVELIN ;and to scr.
  854.  ╔ä
  855. ┤(YPOS),Ç;restore ypos
  856.  ▒ENTEX
  857.  
  858. DELL3 ╔ä;end of file reached,
  859. ┤å,Ç;retrieve ypos
  860. àÇ;test for botlin
  861. èσ,CLIN ;if so, clear botlin
  862.  ▒ENTEX
  863.  
  864. PAGEDOWN èSTORELIN 
  865. ═ë;RET if no room for line
  866. ┤å,24 ;calc 24 lines down
  867.  ┤Ñ,(SCRTOP)
  868. PD èVOLGER
  869. ═σ;ret if not present
  870.  ¢PD
  871. ▓F7 ;cls,print scr from addr in HL
  872.  
  873. PAGEUP èSTORELIN
  874.  ═ ë
  875. ┤å,24 ;calc 24 lines up
  876.  ┤Ñ,(SCRTOP)
  877. PU èVORIGE +3
  878. ▓σ,F7 ;jp if start of file reached
  879.  ¢PU
  880. ▓F7 ;print scr from addr in HL
  881.  
  882. FINDS èSTORELIN
  883. ═ë;ret if no room
  884. ┤Ñ,(FINDADD);point into file
  885.  òÑ
  886. F1 ┤ö,FINDTABLE ;point to find$
  887. F2 ⌐Ñ
  888.  ┤Ç,(Ñ)
  889. ⌐Ç;test end of file (255)
  890. ▓σ,F4 ;jp if so
  891. ┤Ç,(ö);compare first char
  892. èfindcomp 
  893. ▓╛,F2 ;next if no match
  894. ╩Ñ;save filepointer
  895. F3 ⌐Ñ
  896.  ⌐ö
  897. ┤Ç,(Ñ);test end of file
  898. ⌐Ç;(255)
  899. ▓σ,F4 +1 ;jp if so
  900. ┤Ç,(ö);test end of find$
  901.  ┐Ç
  902. ▓σ,F5 ;exit if end of find$
  903. èfindcomp ;compare char
  904. ▓σ,F3 ;loop if matching
  905. ╔Ñ;no more match
  906. ▓F1 ;cont searching in file
  907.  
  908. F4 ╩Ñ;end of file reached
  909. ┤Ñ,filstrt 
  910. ┤(FINDADD),Ñ;reset filepointer
  911. ┤Ñ,127 ;reset find$, (c) + chr$0
  912. ┤(findtable),Ñ
  913. ╔Ñ;retr. filepntr
  914.  ▓F6
  915.  
  916. F5 ╔Ñ;retrieve filepointer
  917. èVOLGER ;get start of next line
  918. ┤(FINDADD),Ñ;store
  919. F6 èVORIGE +3 ;retrieve line with match
  920. ┤Ç,(FINDTABLE)
  921.  î127
  922. èσ,VORIGE +3 ;prev. line if (c) =error
  923. F7 ╩Ñ
  924.  èCLS
  925.  ╔Ñ
  926. ╔ç;drop RETaddr.
  927. ▒WM1 -3 ;print screen  (in WARM)
  928.  
  929. expandlin ┤Ñ,(curslin);use curslin
  930. ╩Ñ;or use HL on this entrypoint
  931. ┤Ñ,linbuf +64 ;clear linebuffer
  932. pl1 ò│
  933. ┤(Ñ),32 
  934. ▓╛,pl1 
  935. íö,Ñ;DE points to linebuffer
  936. ɥ
  937. pl2 ┤Ç,(Ñ)
  938. î127 
  939. ▓σ,COMM1 ;jp if (c)
  940.  ▓║,TOKEN
  941. î";" 
  942.  ▓σ,COMMENT
  943.  î13
  944.  ═ σ
  945. î34 ;quote
  946. ▓╛,noquote ;test more
  947.  
  948. qo î13 ;inside quotes now
  949. ═σ;exit if end of line
  950. èvul 
  951. ⌐Ñ
  952. ┤Ç,(Ñ)
  953. î34 ;test for second quote
  954. ▓╛,qo 
  955.  
  956. noquote èVUL ;move from file into buffer
  957. PC1 ⌐Ñ;point to next char in file
  958.  ▓PL2
  959.  
  960. COMMENT ┤Ç,¥;test pos in linebuffer
  961.  àÇ
  962. ▓σ,COMM1 -2 ;if ';' is first char
  963. î34 ;no tokenizing inside quotes
  964.  ▓║,COMM1 -2
  965. ┤Ç,34 ;comment TAB
  966. ┤¥,Ç;adjust linbuf pointer
  967. ┤Ç,59 ;insert ';' here
  968. COMM1 èVUL
  969. ⌐Ñ;move trailing chars into
  970. ┤Ç,(Ñ);linebuffer
  971. î13 ;until end of line
  972.  ▓╛,COMM1
  973.  ═
  974.  
  975. TOKEN Γ127
  976. ┤å,Ç;B = tokennr.
  977. ┤ë,Ç;save token
  978. ┤Ç,11 ;TAB if token
  979.  î¥
  980. ▓ë,$+3 ;only if pos. < 11
  981. ┤¥,Ç;adjust linbufpntr
  982. ╩Ñ;store filepntr
  983. ┤Ñ,opcotable ;find opcode
  984. T1 ê7,(Ñ)
  985.  ⌐Ñ
  986.  ▓σ,T1
  987.  ┤Ç,(Ñ)
  988. ⌐Ç;test for 255
  989. ▓σ,T2 -1 ;jp if end of table
  990. ¢T1 ;exit with HL pointing
  991.  ;           to Bth token
  992. ┤Ç,35 ;inc hl!
  993. T2 ┤Ç,(Ñ)
  994. à127 ;move chars into linbuf
  995.  èVUL
  996.  ┤Ç,(Ñ)
  997. éÇ,Ç;test end of token
  998. ▓║,T2 -1;more chars if not 
  999. ╔Ñ;retrieve filepntr
  1000. ┤Ç,ë;retrieve token
  1001. î43 ;test 'INCLUDE'
  1002. ▓╛,$+3 
  1003. ⌐¥;insert one space after token
  1004. ┤Ç,16 ;next TAB
  1005. î¥;if possible
  1006.  ▓ë,PC1
  1007. ┤¥,Ç;adjust linbufpntr
  1008.  ▓PC1
  1009.  
  1010. VUL ┤(ö),Ç;move char into buffer
  1011.  ⌐¥
  1012.  ┤Ç,¥
  1013. î64 ;test for linbuf full
  1014. ═ë;ret if not
  1015. ╔Ñ;drop retaddr.
  1016. ═;exit directly from here
  1017.  
  1018. ;expand + print to scr
  1019. PRLIN ΣÇ;reset 'line changed' flag
  1020.  ┤(ALTFLG),Ç
  1021. èexpandlin 
  1022.  
  1023. MOVELIN ┤Ñ,YPOS ;calc screenposition
  1024.  ┤ú,(Ñ)
  1025. ┤│,0 ;start of scr line
  1026.  èCALC +3
  1027.  ┤Æ,ú
  1028.  ┤¥,│
  1029.  ó
  1030. ┤ö,linbuf -1 
  1031.  ó
  1032. LUP ó
  1033.  ⌐ö
  1034. ┤Ç,(ö);fetch from linbuf
  1035.  ⌐¥
  1036.  ó
  1037. ╩ö;store scrpos
  1038. ┤│,Ç;calc addr. of pattern
  1039.  ΣÇ
  1040.  ╨│
  1041.  ╤
  1042.  ╨│
  1043.  ╤
  1044.  ╨│
  1045.  ╤
  1046. éÇ,chartable /256 -1 
  1047. ┤ú,Ç;HL points to pattern 1
  1048.  ó
  1049. ┤Ç,(ö);fetch again from linbuf
  1050.  ó
  1051. ┤ë,Ç;calc addr of pattern
  1052.  ΣÇ
  1053.  ╨ë
  1054.  ╤
  1055.  ╨ë
  1056.  ╤
  1057.  ╨ë
  1058.  ╤
  1059. éÇ,chartable /256 -1 
  1060. ┤å,Ç;BC = addr. of pattern
  1061. ┤Ç,(ç);shift second pattern
  1062.  ╓
  1063.  ╓
  1064.  ╓
  1065.  ╓
  1066. éÇ,(Ñ);add first pattern
  1067. ┤(ö),Ç;1 move to screen
  1068. ⌐ë;next pattern2
  1069. ⌐│;next pattern1
  1070. ⌐Æ;next pixrow, 1 down
  1071.  ┤Ç,(ç)
  1072.  ╓
  1073.  ╓
  1074.  ╓
  1075.  ╓
  1076.  éÇ,(Ñ)
  1077. ┤(ö),Ç;2
  1078.  ⌐ë
  1079.  ⌐│
  1080.  ⌐Æ
  1081.  ┤Ç,(ç)
  1082.  ╓
  1083.  ╓
  1084.  ╓
  1085.  ╓
  1086.  éÇ,(Ñ)
  1087. ┤(ö),Ç;3
  1088.  ⌐ë
  1089.  ⌐│
  1090.  ⌐Æ
  1091.  ┤Ç,(ç)
  1092.  ╓
  1093.  ╓
  1094.  ╓
  1095.  ╓
  1096.  éÇ,(Ñ)
  1097. ┤(ö),Ç;4
  1098.  ⌐ë
  1099.  ⌐│
  1100.  ⌐Æ
  1101.  ┤Ç,(ç)
  1102.  ╓
  1103.  ╓
  1104.  ╓
  1105.  ╓
  1106.  éÇ,(Ñ)
  1107. ┤(ö),Ç;5
  1108.  ⌐ë
  1109.  ⌐│
  1110.  ⌐Æ
  1111.  ┤Ç,(ç)
  1112.  ╓
  1113.  ╓
  1114.  ╓
  1115.  ╓
  1116.  éÇ,(Ñ)
  1117. ┤(ö),Ç;6
  1118.  ⌐ë
  1119.  ⌐│
  1120.  ⌐Æ
  1121.  ┤Ç,(ç)
  1122.  ╓
  1123.  ╓
  1124.  ╓
  1125.  ╓
  1126.  éÇ,(Ñ)
  1127. ┤(ö),Ç;7
  1128.  ⌐ë
  1129.  ⌐│
  1130.  ⌐Æ
  1131.  ┤Ç,(ç)
  1132.  ╓
  1133.  ╓
  1134.  ╓
  1135.  ╓
  1136.  éÇ,(Ñ)
  1137. ┤(ö),Ç;8
  1138.  ╔ö
  1139.  ⌐ö
  1140.  ┤Ç,¥
  1141. à31 ;test for 64 chars (4 pix)
  1142.  ▓╛,LUP
  1143.  ═
  1144.  
  1145. CALC ┤Ñ,(XPOS);calc scr.addr. from X,Y-pos
  1146. ╩ö;do not destroy DE
  1147.  ┤Ç,191
  1148.  Γú
  1149.  ┤¥,Ç
  1150.  ╪
  1151.  ╪
  1152.  ╪
  1153.  à24
  1154.  ┐64
  1155.  ┤ú,Ç
  1156.  ┤Ç,¥
  1157.  à56
  1158.  ▐Ç
  1159.  ▐Ç
  1160.  ß│
  1161.  ß│
  1162.  ß│
  1163.  ┐│
  1164.  ┤│,Ç
  1165.  ╔ö
  1166.  ═
  1167.  
  1168. ;compress line inside linebuffer
  1169. COMPLN ┤Ñ,#0D0D;make sure line in linbuffer
  1170. ┤(LINLAST +1),Ñ;ends with ENTER
  1171. ┤Ñ,linbuf 
  1172. ┤Æ,ú;HL = insert pointer
  1173. ┤¥,│;DE = linbuf pointer
  1174.  ┤Ç,(ö)
  1175. î";" 
  1176. ▒σ,ISLN ;jp if comment
  1177. òö;prepare for loop
  1178.  
  1179. NXCH ⌐ö;test next char
  1180.  ┤Ç,(ö)
  1181. î13 ;if end of line
  1182. ▒σ,ISLN1 ;ready to insert into file
  1183. î33 ;test space e.o.
  1184. ▓ë,NXCH ;skip these
  1185. î127 ;(c)
  1186. ▒σ,ISLN ;execute 'remark' without TAB
  1187. î";" 
  1188. ▓σ,ISL ;remark
  1189. ;try for token now
  1190. ╩Ñ;save insertpntr
  1191. ┤Ñ,opcotable 
  1192.  ┤å,0
  1193. TRY ⌐Ñ
  1194.  ⌐å
  1195. ┤Ç,(ö);fetch char from linbuf
  1196. à223 ;CAPs
  1197.  ┤ë,Ç
  1198. ┤Ç,(Ñ);fetch char from tokentable
  1199. à127 ;drop bit 7
  1200.  îë
  1201. ┤Ç,(ö);retrieve char
  1202. ▓σ,FIRST ;jp if match
  1203. ▓║,NOTOK ;exit if too far in tokentable
  1204.  ;                  = not found
  1205. NXT ê7,(Ñ);test end of token
  1206. ▓╛,TRY ;find next token if so
  1207. ⌐Ñ
  1208. ▓NXT ;find end of token
  1209.  
  1210. FIRST ╩ö;save linbufpntr
  1211. ê7,(Ñ);test for 1-char token
  1212. ▓╛,VALEND ;jp if so
  1213.  
  1214. MORE ⌐ö;next char in linbuf
  1215. ⌐Ñ;next char in tokentable
  1216.  ┤Ç,(ö)
  1217.  Σ(Ñ)
  1218. à223 ;CAPs
  1219. ▓σ,MORE ;cont. if matching
  1220. à127 ;no more match, test for last
  1221. ▓╛,INVAL ;char of token, jp if not
  1222.  
  1223. VALEND ⌐ö;test in linbuf, for end of
  1224. ┤Ç,(ö);                      opcode
  1225. èTESTA ;alphanum (!)
  1226. ▓ë,VALTOK ;jp if end of opcode
  1227. INVAL ╔ö;else retrieve linbufpntr
  1228. ▓NXT ;try next token
  1229.  
  1230. VALTOK ╔Ñ;drop old linbufpntr
  1231. òö;adjust linbufpntr
  1232. ┤Ç,127 ;calc tokennr.
  1233.  éÇ,å
  1234. NOTOK ╔Ñ;retrieve insertpntr
  1235.  î13
  1236. ▓σ,ISLN1 ;exit, inserting line
  1237. ┤(Ñ),Ç;insert char
  1238.  ⌐Ñ
  1239. èTESTA ;test last char for alphanum
  1240. ▓║,ISN ;jp if so
  1241. î"%" ;binair
  1242. ▓σ,isn ;insert chars
  1243. î"#" ;hex
  1244. ▓╛,quote 
  1245.  
  1246. hex ⌐ö;point to char after #
  1247.  ┤Ç,(ö)
  1248. î32 ;skip spaces
  1249. ▓σ,hex 
  1250. ètesta ;test for alphanumeric
  1251. ▓ë,nxch +1;exit if not 
  1252. î"Z" +1 ;convert chars to caps
  1253. ▓ë,hex1 
  1254. à223 
  1255. hex1 ┤(Ñ),Ç;store
  1256. ⌐Ñ
  1257. ▓hex ;test next char for hex
  1258.  
  1259. quote î34 
  1260. ▓╛,nxch;compress more if no quote 
  1261. QUO ⌐ö;inside quotes now
  1262.  ┤Ç,(ö)
  1263.  î13
  1264. ▓σ,ISLN1 ;insert line into file
  1265.  ┤(Ñ),Ç
  1266.  ⌐Ñ
  1267. î34 ;search for second quote
  1268.  ▓╛,QUO
  1269. ISN ⌐ö;outside quotes now
  1270.  ┤Ç,(ö)
  1271. ▓NOTOK +1 ;treat next char the normal
  1272.  ;                        way
  1273. ISL ┤Ç,│;test for start of linbuf
  1274.  àÇ
  1275. ▓╛,ISLN ;jp if not
  1276. ┤(Ñ),32 ;else insert space
  1277.  ⌐Ñ
  1278. isln ┤Ç,65 ;calc length of 'tail' of
  1279. Γ¥;line in linbuf
  1280. ┤å,0 
  1281. ┤ë,Ç
  1282. ▓σ,IS1 ;jp if no 'tail'
  1283.  íö,Ñ
  1284. ╕;shift tail into position
  1285.  ▓IS1 +3
  1286. IS1 ┤ö,LINLAST ;remove any trailing spaces
  1287.  íö,Ñ
  1288.  ┤Ç,32
  1289. IS2 òÑ
  1290.  î(Ñ)
  1291.  ▓║,IS2
  1292. ⌐Ñ;insert ENTER
  1293. ISLN1 ┤(Ñ),13
  1294.  ⌐Ñ
  1295. ╩Ñ;last char +1
  1296. èINSFILE ;make room or reclaim in file
  1297. ╔Ñ;retr. last +1
  1298.  àÇ
  1299. ┤ö,linbuf 
  1300. █Ñ,ö;calc length of compr. line
  1301. ┤å,ú;incl. ENTER
  1302.  ┤ë,│
  1303. ┤Ñ,(CURSLIN);point into file
  1304.  íö,Ñ
  1305. ╕;move line into file
  1306. àÇ;NC = no error
  1307.  ═
  1308.  
  1309. ;adjust file to accommodate new line
  1310. INSFILE ╩Ñ;store 'last +1 in linbuf'
  1311. ┤ö,(CURSLIN);point into file
  1312.  èVOLGENDE
  1313.  ┤å,ú
  1314. ┤ë,│;BC = next line addr.
  1315.  àÇ
  1316. █Ñ,ö;calc length of old line
  1317. í(▀),Ñ;store old length
  1318. ┤ö,linbuf ;HL =last in linbuf
  1319. █Ñ,ö;calc length of new line
  1320. ╔ö;=old length
  1321. █Ñ,ö;compare lengths
  1322. ▓ë,MINLIN ;jp if new < old
  1323. ═σ;exit if new = old
  1324. BIGLINE ┤ö,(FILEND);new > old
  1325. éÑ,ö;test for maxfile
  1326.  ┤Ç,(FILMAX +1)
  1327.  îú
  1328. ▓║,BIG ;cont. if room available
  1329. ╔Ñ;balance stack
  1330. ╔Ñ;drop RETaddr.
  1331. IFEX ┤ö,32 ;rasp
  1332.  ┤Ñ,5000
  1333.  è949
  1334. ▄;signal ERROR
  1335.  ═
  1336.  
  1337. BIG íö,Ñ
  1338. àÇ;now DE= new fileend, HL = old
  1339. █Ñ,ç;BC = addr. of next line
  1340. ┤å,ú;BC = nr. of bytes in 'tail'
  1341.  ┤ë,│
  1342. ⌐ç;nr of bytes to move
  1343. ┤Ñ,(FILEND);adjust fileend
  1344.  ┤(FILEND),ö
  1345. ╢;move tail
  1346.  ═
  1347.  
  1348. MINLIN éÑ,ö;undo earlier subtraction
  1349. ┤ö,(CURSLIN);HL = old line length now
  1350.  éÑ,ö
  1351. íö,Ñ;DE = end of old line
  1352. ┤Ñ,(FILEND);BC =addr. of next line
  1353. █Ñ,ç;calc length of tail
  1354.  ╩ç
  1355. í(▀),Ñ;HL = addr. of next line
  1356. ╔ç;BC = length of tail
  1357. ⌐ç;take endmarker into account
  1358. ╕;move tail
  1359. òö;adjust end of file
  1360.  ┤(FILEND),ö
  1361.  ═
  1362.  
  1363. STORELIN ┤Ç,(ALTFLG);test for 'line has changed'
  1364.  ╓
  1365. ═║;ret if no change made
  1366. èCOMPLN ;else compress + store
  1367.  ╩ä
  1368. èPRLIN ;and reprint
  1369.  ╔ä
  1370.  ═
  1371.  
  1372. AONLY î123 ;on exit: C = invalid
  1373.  ï
  1374. ͉
  1375.  î95
  1376. ═║;test A - z
  1377.  î91
  1378.  ï
  1379. ͉
  1380. î63 
  1381.  ═
  1382.  
  1383. TESTA èAONLY ;on exit: C = invalid
  1384. ═║;test alphanum
  1385. TESTN î58
  1386.  ï
  1387. ═ë;test 0 - 9
  1388.  î48
  1389.  ═
  1390.  
  1391. ---------------------------------------------------------------
  1392. ; FILLERS here, to put CHARTABLE on #7000 , 28672
  1393.  
  1394. ÿ2 
  1395.  
  1396. chartable û0,0,0,0,0,0,0,0 ;space
  1397. û0,32,32,32,32,0,32,0
  1398. û0,80,80,0,0,0,0,0
  1399. û0,0,80,112,80,112,80,0 
  1400. û0,32,112,96,112,48,112,32 
  1401. û0,64,80,32,64,16,16,0 
  1402. û0,16,32,16,32,64,48,0 
  1403. û0,32,64,0,0,0,0,0
  1404. û0,32,64,64,64,64,32,0 
  1405. û0,64,32,32,32,32,64,0 
  1406. û0,0,80,32,112,32,80,0 
  1407. û0,0,32,32,112,32,32,0 
  1408. û0,0,0,0,0,32,32,64
  1409. û0,0,0,0,112,0,0,0
  1410. û0,0,0,0,0,96,96,0
  1411. û0,0,0,16,32,64,0,0
  1412.  
  1413. û0,32,80,112,112,80,32,0 ;0
  1414. û0,32,96,32,32,32,112,0 ;1
  1415. û0,32,80,16,32,64,112,0 ;2
  1416. û0,96,16,32,16,16,96,0 ;3
  1417. û0,16,16,48,80,112,16,0 ;4
  1418. û0,112,64,96,16,80,32,0 ;5
  1419. û0,32,64,96,80,80,32,0 ;6
  1420. û0,112,16,16,32,64,64,0 ;7
  1421. û0,32,80,32,80,80,32,0 ;8
  1422. û0,32,80,80,48,16,32,0 ;9
  1423. û0,0,0,32,0,0,32,0 ;:
  1424. û0,0,0,32,0,0,32,64 ;;
  1425. û0,0,16,32,64,32,16,0 ;<
  1426. û0,0,0,112,0,112,0,0 ;=
  1427. û0,0,64,32,16,32,64,0 ;>
  1428. û0,96,16,32,64,0,64,0 ;?
  1429. û0,32,80,112,112,64,32,0 ;@
  1430.  
  1431. û0,32,80,80,112,80,80,0 ;A
  1432. û0,96,80,96,80,80,96,0 ;B
  1433. û0,32,80,64,64,80,32,0 ;C
  1434. û0,96,80,80,80,80,96,0 ;D
  1435. û0,112,64,96,64,64,112,0 ;E
  1436. û0,112,64,96,64,64,64,0 ;F
  1437. û0,32,80,64,112,80,32,0 ;G
  1438. û0,80,80,112,80,80,80,0 ;H
  1439. û0,112,32,32,32,32,112,0 ;I
  1440. û0,16,16,16,80,80,32,0 ;J
  1441. û0,80,96,96,96,80,80,0 ;K
  1442. û0,64,64,64,64,64,112,0 ;L
  1443. û0,80,112,80,80,80,80,0 ;M
  1444. û0,96,80,80,80,80,80,0 ;N
  1445. û0,32,80,80,80,80,32,0 ;O
  1446. û0,96,80,80,96,64,64,0 ;P
  1447. û0,32,80,80,80,112,48,0 ;Q
  1448. û0,96,80,80,96,96,80,0 ;R
  1449. û0,48,64,32,16,16,96,0 ;S
  1450. û0,112,32,32,32,32,32,0 ;T
  1451. û0,80,80,80,80,80,32,0 ;U
  1452. û0,80,80,80,80,32,32,0 ;V
  1453. û0,80,80,80,80,112,32,0 ;W
  1454. û0,80,80,32,32,80,80,0 ;X
  1455. û0,80,80,32,32,32,32,0 ;Y
  1456. û0,112,16,32,64,64,112,0 ;Z
  1457.  
  1458. û0,112,64,64,64,64,112,0 
  1459. û0,0,0,64,32,16,0,0 
  1460. û0,112,16,16,16,16,112,0 
  1461. û0,32,112,32,32,32,32,0 
  1462. û0,0,0,0,0,0,0,240 
  1463. û0,48,64,96,64,64,112,0 
  1464.  
  1465. û0,0,32,16,48,80,112,0 ;a
  1466. û0,64,96,80,80,80,96,0 ;b
  1467. û0,0,48,64,64,64,48,0 ;c
  1468. û0,16,48,80,80,80,48,0 ;d
  1469. û0,0,32,80,112,64,48,0 ;e
  1470. û0,48,64,96,64,64,64,0 ;f
  1471. û0,0,48,80,80,112,16,96 ;g
  1472. û0,64,96,80,80,80,80,0 ;h
  1473. û0,32,0,96,32,32,112,0 ;i
  1474. û0,16,0,16,16,16,80,32 ;j
  1475. û0,64,80,96,96,80,80,0 ;k
  1476. û0,64,64,64,64,64,48,0 ;l
  1477. û0,0,80,112,80,80,80,0 ;m
  1478. û0,0,96,80,80,80,80,0 ;n
  1479. û0,0,32,80,80,80,32,0
  1480. û0,0,96,80,80,96,64,64 ;p
  1481. û0,0,48,80,80,48,16,16 ;q
  1482. û0,0,48,64,64,64,64,0 ;r
  1483. û0,0,48,64,32,16,96,0 ;s
  1484. û0,32,112,32,32,32,16,0 ;t
  1485. û0,0,80,80,80,80,48,0 ;u
  1486. û0,0,80,80,80,96,32,0 ;v
  1487. û0,0,80,80,80,112,32,0 ;w
  1488. û0,0,80,32,32,32,80,0 ;x
  1489. û0,0,80,80,80,48,16,32 ;y
  1490. û0,0,112,16,32,64,112,0 ;z
  1491. û0,48,32,64,32,32,48,0 
  1492. û0,32,32,32,32,32,32,0 
  1493. û0,96,32,16,32,32,96,0 
  1494. û240,240,240,240 
  1495. û240,240,240,240 
  1496. û192,96,48,80,80,48,96,192 
  1497.  
  1498. opcotable û128 ;startmark
  1499. û"A" +128 ;    128
  1500. ù"AD" :û"C" +128 
  1501. ù"AD" :û"D" +128 
  1502. û"A" :û"F" :û39 +128 ;rara?
  1503. û"A" :û"F" +128 
  1504. ù"AN" :û"D" +128 
  1505. û"B" +128 
  1506. ù"B" :û"C" +128 
  1507. ù"BI":û"T" +128 
  1508. û"C" +128 
  1509. ù"CAL":û"L" +128 
  1510. ù"CC":û"F" +128 
  1511. ù"C":û"P" +128 ;    140
  1512. ù"CP":û"D" +128 
  1513. ù"CPD":û"R" +128 
  1514. ù"CP":û"I" +128 
  1515. ù"CPI":û"R" +128 
  1516. ù"CP":û"L" +128 
  1517. û"D" +128 
  1518. ù"DA":û"A" +128 
  1519. ù"D":û"E" +128 
  1520. ù"DE":û"C" +128 
  1521. ù"DEF":û"B" +128 ;    150
  1522. ù"DEF":û"M" +128 
  1523. ù"DEF":û"S" +128 
  1524. ù"DEF":û"W" +128 
  1525. ù"D":û"I" +128 
  1526. ù"DJN":û"Z" +128 
  1527. ù"DUM":û"P" +128 
  1528. û"E" +128 
  1529. ù"E":û"I" +128 
  1530. ù"EN":û"D" +128 
  1531. ù"EQ" :û"U" +128 ;    160
  1532. ù"E":û"X" +128 
  1533. ù"EX":û"X" +128 
  1534. û"H" +128 
  1535. ù"HAL":û"T" +128 
  1536. ù"H":û"L" +128 
  1537. û"I" +128 
  1538. ù"I":û"M" +128 
  1539. ù"I":û"N" +128 
  1540. ù"IN":û"C" +128 
  1541. ù"INCLUD" :û197 ;    170
  1542. ù"IN":û"D" +128 
  1543. ù"IND":û"R" +128 
  1544. ù"IN":û"I" +128 
  1545. ù"INI":û"R" +128 
  1546. ù"I":û"X" +128 
  1547. ù"I":û"Y" +128 
  1548. ù"J":û"P" +128 
  1549. ù"J":û"R" +128 
  1550. û"L" +128 
  1551. ù"L" :û"D" +128 ;    180
  1552. ù"LD" :û"D" +128 
  1553. ù"LDD":û"R" +128 
  1554. ù"LD":û"I" +128 
  1555. ù"LDI" :û"R" +128 
  1556. û"M" +128 
  1557. ù"N" :û"C" +128 
  1558. ù"NE" :û"G" +128 
  1559. ù"NO" :û"P" +128 
  1560. ù"N" :û"V" +128 
  1561. ù"N" :û"Z" +128 ;    190
  1562. ù"O" :û"R" +128 
  1563. ù"OR" :û"G" +128 
  1564. ù"OTD" :û"R" +128 
  1565. ù"OTI" :û"R" +128 
  1566. ù"OU" :û"T" +128 
  1567. ù"OUT" :û"D" +128 
  1568. ù"OUT" :û"I" +128 
  1569. û"P" +128 
  1570. ù"P" :û"E" +128 
  1571. ù"P" :û"O" +128 ;    200
  1572. ù"PO" :û"P" +128 
  1573. ù"PUS" :û"H" +128 
  1574. û"R" +128 
  1575. ù"RE" :û"S" +128 
  1576. ù"RE" :û"T" +128 
  1577. ù"RET" :û"I" +128 
  1578. ù"RET" :û"N" +128 
  1579. ù"R" :û"L" +128 
  1580. ù"RL" :û"A" +128 
  1581. ù"RL" :û"C" +128 ;   210
  1582. ù"RLC" :û"A" +128 
  1583. ù"RL" :û"D" +128 
  1584. ù"R":û"R" +128 
  1585. ù"RR" :û"A" +128 
  1586. ù"RR" :û"C" +128 
  1587. ù"RRC" :û"A" +128 
  1588. ù"RR" :û"D" +128 
  1589. ù"RS" :û"T" +128 
  1590. ù"SB" :û"C" +128 
  1591. ù"SC" :û"F" +128 ;   220
  1592. ù"SE" :û"T" +128 
  1593. ù"SL" :û"A" +128 
  1594. ù"S" :û"P" +128 
  1595. ù"SR" :û"A" +128 
  1596. ù"SR" :û"L" +128 
  1597. ù"SU" :û"B" +128 
  1598. û"V" +128 
  1599. ù"XO" :û"R" +128 
  1600. û"Z" +128 ;    229
  1601. û255 ;endmarker
  1602. ù"ERRO" :û128 +82 
  1603.  
  1604. CLS ┤Ñ,16384
  1605.  ┤ö,16385
  1606.  ┤ç,6144
  1607.  ┤(Ñ),0
  1608.  ╕
  1609. ┤Ñ,22528 ;ATTR
  1610. ┤ç,768 
  1611. ┤Ç,71 ;paper 0, ink 7, bright 1
  1612.  ┤(Ñ),Ç
  1613.  ╕
  1614. ┤(23624),Ç;border
  1615. ┤Ç,0 
  1616.  ├(254),Ç
  1617. ┤Ñ,#B800;point to topleft pixelpos
  1618.  ┤(XPOS),Ñ
  1619.  ═
  1620.  
  1621. findcomp èaonly ;test for alpha char
  1622. ▓║,fc1 ;jp if so
  1623. î(Ñ);test other char
  1624. fc1 Σ(Ñ);cp alpha char
  1625. à223 ;take CAPS into account
  1626.  
  1627. SYMT ┤Ç,3 ;use printer
  1628.  ▓SMT
  1629. SYMV è3435 ;cls
  1630. ┤Ç,2 ;use screen
  1631. SMT ┤(storevar+1),Ç
  1632. è5633 ;open #
  1633. ┤Ñ,SERM ;point to 'SYMBOLTABLE'
  1634. èprintmsge 
  1635. ╩Ñ;store msge pointer
  1636. ┤ç,(SYMPO);print bottomaddr. of S-table
  1637. è11563 
  1638. è11747 
  1639. ╔Ñ;point to '-65520'
  1640. èprintmsge 
  1641. ┤Ç,13 ;newline
  1642. ┌16 
  1643. ┤ö,SYMBTOP -16 ;get top of table
  1644. LS1 ┤Ñ,(SYMPO);test for ready
  1645.  òÑ
  1646.  àÇ
  1647.  █Ñ,ö
  1648. ▓║,LSEND ;jp if ready
  1649. ╩ö;store pointer
  1650. ┤å,14 ;print 14 chars
  1651.  ┤Ç,(ö)
  1652.  ┤ë,Ç
  1653. LS2 ┤Ç,(ö)
  1654. à127 ;drop bit 7
  1655.  ⌐ö
  1656.  ┌16
  1657. ¢LS2 ;loop
  1658. ê7,ë;test 'undefined'
  1659. ▓╛,LS3 ;jp if not
  1660.  ┤Ñ,UNDEF
  1661. èprintmsge 
  1662.  ⌐ö
  1663. ▓LS4 ;do not print an adress
  1664. LS3 ┤Ç,(ö);collect adress in BC
  1665.  ┤ë,Ç
  1666.  ⌐ö
  1667.  ┤Ç,(ö)
  1668.  ┤å,Ç
  1669. ┤Ç,32 ;space
  1670.  ┌16
  1671. ┤Ç,35 ; #
  1672.  ┌16
  1673.  ┤Ç,å
  1674. èPRHX ;print hex
  1675.  ┤Ç,ë
  1676. èPRHX ;print hex
  1677. ┤Ç,32 ;spaces
  1678.  ┌16
  1679. ┤Ç,32 
  1680.  ┌16
  1681.  ┤Ç,32
  1682.  ┌16
  1683. è11563 ;print decimal in BC
  1684.  è11747
  1685. LS4 ╔ö;retrieve table pointer
  1686.  ┤Ç,¥
  1687. Γ16 ;next label
  1688.  ┤¥,Ç
  1689.  ▓║,LS5
  1690. òÆ;adjust high byte when needed
  1691. LS5 ┤Ç,13 ;newline
  1692.  ┌16
  1693. ▓LS1 ;loop
  1694.  
  1695. PRHX ╩ä;print number in hex
  1696.  ╓
  1697.  ╓
  1698.  ╓
  1699.  ╓
  1700.  èHXZ
  1701.  ╔ä
  1702. HXZ à15
  1703.  éÇ,48
  1704.  î58
  1705.  ▓ë,HXZ1
  1706.  éÇ,7
  1707. HXZ1 ┌16
  1708.  ═
  1709.  
  1710. LSEND ┤Ç,(storevar+1);retrieve command
  1711. î3 ;was it printer
  1712. ▒σ,begin ;ready if so
  1713. ┤Ñ,PRESS 
  1714. èprintmsge 
  1715. ╠5,(░+1);wait for keypress
  1716. LS6 ê5,(░ +1)
  1717.  ▓σ,LS6
  1718. ▒begin ;to menu
  1719.  
  1720. printmsge ┤Ç,(Ñ);print msge until 255 is found
  1721.  ⌐Ñ
  1722.  î255
  1723. ═σ;exit here
  1724.  ╩Ñ
  1725.  ┌16
  1726.  ╔Ñ
  1727. ▓printmsge 
  1728.  
  1729. PRESS û13,20,1 
  1730. ù"Press..." 
  1731. û255
  1732.  
  1733. UNDEF ù"Undef" 
  1734. û255
  1735.  
  1736. ASSEMBLE á$
  1737. LENGTE áassemble -begin 
  1738.