home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_26_1988_Transactor_Publishing.d64 / kernal++.src (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  15KB  |  715 lines

  1. 1000 goto1055
  2. 1005 open15,8,15,"s0:kernal++.src":close15:save"0:kernal++.src",8:end
  3. 1010 ;
  4. 1015 ; --------------------------------
  5. 1020 ; "[203][197][210][206][193][204]++ [214]1.0    ([195]) 14 [202][213][206][197] 87
  6. 1025 ; "(NULL)illiam lenoleman 1431 (NULL)acetti (NULL)d
  7. 1030 ; "      aka       [199]reen [195]ove [211]pgs
  8. 1035 ; "(NULL)aster peeklaster  asclorida   32043
  9. 1040 ; --------------------------------
  10. 1045 ;
  11. 1050 ; these 2 lines copy the roms into ram
  12. 1055 : for i=57344 to 65535:pokei,peek(i):next
  13. 1060 : for i=40960 to 49151:pokei,peek(i):next
  14. 1065 sys32768
  15. 1070 .opt oo
  16. 1075 .page 65
  17. 1080 ; above is for abacus assembler. for pal, use sys 700, delete .page line
  18. 1085 ;
  19. 1090 ; *** kernal equates ***
  20. 1095 ;
  21. 1100 second = $ff93
  22. 1105 tksa = $ff96
  23. 1110 acptr = $ffa5
  24. 1115 ciout = $ffa8
  25. 1120 untalk = $ffab
  26. 1125 unlsn = $ffae
  27. 1130 listen = $ffb1
  28. 1135 talk = $ffb4
  29. 1140 readst = $ffb7
  30. 1145 open = $f3d5
  31. 1150 close = $f642
  32. 1155 chrout = $ffd2
  33. 1160 load = $f49e
  34. 1165 stop = $ffe1
  35. 1170 clall = $ffe7
  36. 1175 ;
  37. 1180 ; *** other equates ***
  38. 1185 ;
  39. 1190 basinit = $e3bf;    initialize basic
  40. 1195 basmsg = $e422;     power-up message
  41. 1200 vecp3 = $e453;      restore pg 3 vectors
  42. 1205 setpnts = $e56c;    set charout pntrs
  43. 1210 chardone = $e6a8;   exit 4 screen charout
  44. 1215 chkcodes = $e72a;   charout (after patch)
  45. 1220 clrline = $e9ff;    clear screenline
  46. 1225 upordown = $ec44;   chk for case change
  47. 1230 save = $e159
  48. 1235 border = $d020
  49. 1240 backrnd = $d021
  50. 1245 ciapra = $dc00
  51. 1250 ciaprb = $dc01
  52. 1255 outnum = $bdcd;     print integer
  53. 1260 strout = $ab1e;     outputs a string
  54. 1265 newstt = $a7ae;     set up statement
  55. 1270 runc = $a68e;       set up for run
  56. 1275 clear = $a659;      clear basic
  57. 1280 crunch = $a57c;     tokenize line
  58. 1285 link = $a533;       relink basic
  59. 1290 crvec = $0304;      crunch vector
  60. 1295 spckey = $028d;     ctrl,shift,or c=
  61. 1300 repeat = $028a;     keybrd repeat flag
  62. 1305 inbuf = $0200;      input buffer
  63. 1310 ;
  64. 1315 ; *** zero page equates ***
  65. 1320 ;
  66. 1325 cpnt = $f3;         pntr to color mem
  67. 1330 llynx = $d9;        line link table
  68. 1335 insert = $d8;       >0 = insert mode
  69. 1340 row = $d6;          cursor row (0-24)
  70. 1345 lmax = $d5;         max chars in line
  71. 1350 quote = $d4;        >0 = quote mode
  72. 1355 column = $d3;       cursor column
  73. 1360 rpnt = $d1;         pntr to video matrix
  74. 1365 keycnt = $c6;       keybrd buffer count
  75. 1370 wejdev = $be;       wedge device #
  76. 1375 fname = $bb
  77. 1380 device = $ba;       current device
  78. 1385 snd = $b9;          secondary addr
  79. 1390 length = $b7;       length of filename
  80. 1395 eal = $ae;          end of load
  81. 1400 kflag = $9d;        kernal message flag
  82. 1405 st = $90
  83. 1410 txtptr = $7a
  84. 1415 sov = $2d;          start of variables
  85. 1420 sob = $2b;          start of basic
  86. 1425 misc = $22
  87. 1430 flag = $02;         flag for autoboot
  88. 1435 ;
  89. 1440 ctrlret = 21;       ctrl-return
  90. 1445 ctrlhm = 22;        ctrl-home
  91. 1450 ctrlins = 23;       ctrl-ins/del
  92. 1455 ctrlvcr = 25;       ctrl-vert cursor
  93. 1460 ctrlhcr = 26;       ctrl-hori cursor
  94. 1465 ; ---------------------------------------
  95. 1470 ;
  96. 1475 ; -- patches default device # --
  97. 1480 ;
  98. 1485 *= $e1da
  99. 1490 .byte 8;   load"file" = load"file",8
  100. 1495 *= $e228
  101. 1500 .byte 4;   open4 = open4,4,7
  102. 1505 ldy #7
  103. 1510 ;
  104. 1515 ; -- patches vector table --
  105. 1520 ;
  106. 1525 *= $e44b
  107. 1530 .word wedge
  108. 1535 ;
  109. 1540 ; -- modify power up message --
  110. 1545 ;
  111. 1550 *= $e488
  112. 1555 .asc "[203]ernal++ [214]1.0 "
  113. 1560 ;
  114. 1565 ; -- text for load --
  115. 1570 ;
  116. 1575 *= $e4b7
  117. 1580 loadtxt .asc "load"
  118. 1585 .byte 34
  119. 1590 .asc "0:*"
  120. 1595 .byte 34
  121. 1600 .asc ",8,1"
  122. 1605 ;
  123. 1610 ; -- patch to for stop keys --
  124. 1615 ;
  125. 1620 *= $e5ea
  126. 1625 jmp onekeys
  127. 1630 nop
  128. 1635 ldx #5
  129. 1640 ;
  130. 1645 ; -- patch to print routine --
  131. 1650 ;
  132. 1655 *= $e725
  133. 1660 jmp chkquote
  134. 1665 nop
  135. 1670 nop
  136. 1675 *= $e7d1
  137. 1680 jmp newcodes
  138. 1685 ;
  139. 1690 *= $e962
  140. 1695 jmp wait
  141. 1700 ;
  142. 1705 ; -- patch to ctrl table --
  143. 1710 ;
  144. 1715 *= $ec42
  145. 1720 .byte $84
  146. 1725 *= $ec78
  147. 1730 .byte ctrlins,ctrlret,ctrlhcr
  148. 1735 *= $ec7f
  149. 1740 .byte ctrlvcr
  150. 1745 *= $ecab
  151. 1750 .byte ctrlhm
  152. 1755 *= $ecb7
  153. 1760 .byte $85
  154. 1765 ;
  155. 1770 ; -- patch shift-run/stop --
  156. 1775 ;
  157. 1780 *= $ece7
  158. 1785 .byte 13
  159. 1790 .asc "run"
  160. 1795 .byte 13
  161. 1800 ;
  162. 1805 ; -- patch out cassette --
  163. 1810 ;
  164. 1815 *= $f2ce
  165. 1820 jmp $f271
  166. 1825 *= $f38b
  167. 1830 jmp $f713
  168. 1835 *= $f539
  169. 1840 jmp $f713
  170. 1845 *= $f65a
  171. 1850 nop
  172. 1855 nop
  173. 1860 ;
  174. 1865 ; -- do stop keys --
  175. 1870 ;
  176. 1875 *= $f65f
  177. 1880 onekeys cmp #$83;   shifted
  178. 1885 bne ok1
  179. 1890 jmp $e5ee
  180. 1895 ok1 cmp #$84;       c= key
  181. 1900 bne ok2
  182. 1905 ldx #13
  183. 1910 bne stickit;        always
  184. 1915 ok2 cmp #$85;       ctrl key
  185. 1920 bne ok3
  186. 1925 ldx #9
  187. 1930 stickit sei
  188. 1935 stx keycnt
  189. 1940 okloop lda loadtxt-1,x
  190. 1945 sta $0276,x
  191. 1950 dex
  192. 1955 bne okloop
  193. 1960 jmp $e5cd
  194. 1965 ok3 jmp $e5fe
  195. 1970 ;
  196. 1975 ; -- activates wedge --
  197. 1980 ;
  198. 1985 *= $f72c
  199. 1990 wedgeon jsr vecp3
  200. 1995 lda #$08
  201. 2000 sta wejdev
  202. 2005 rts
  203. 2010 ;
  204. 2015 ;
  205. 2020 ; -- wedge proper --
  206. 2025 ;
  207. 2030 wedge ldx txtptr;   if not input buffer
  208. 2035 bne doreg;          then crunch
  209. 2040 cmp #"@"
  210. 2045 beq doat
  211. 2050 cmp #">"
  212. 2055 beq doat
  213. 2060 cmp #"_"
  214. 2065 beq dosave
  215. 2070 wdge cmp #"%";        entry from autoboot
  216. 2075 beq doml
  217. 2080 cmp #"^"
  218. 2085 beq doload
  219. 2090 cmp #"/"
  220. 2095 beq doload
  221. 2100 cmp #"="
  222. 2105 beq doload
  223. 2110 cmp #"!"
  224. 2115 beq jdobas
  225. 2120 cmp #"#"
  226. 2125 beq seq
  227. 2130 doreg jmp crunch;   normal crunching
  228. 2135 ;
  229. 2140 jdobas jmp dobas;   springboard
  230. 2145 ;
  231. 2150 ; -- save routine _ --
  232. 2155 ;
  233. 2160 dosave jsr setup;   set up file params
  234. 2165 jsr save;           save program
  235. 2170 frmseq jsr prntret; print return
  236. 2175 jmp disperr;        display error chan.
  237. 2180 ;
  238. 2185 ; -- set up for load --
  239. 2190 ;
  240. 2195 doml lda #1
  241. 2200 .byte $2c
  242. 2205 doload lda #0
  243. 2210 jmp loadit
  244. 2215 ;
  245. 2220 ; -- read seq file --
  246. 2225 ;
  247. 2230 seq lda inbuf+1
  248. 2235 beq done;         exit if just #
  249. 2240 jsr setup;        set up file parameters
  250. 2245 ldy length;       length of filename
  251. 2250 iny
  252. 2255 lda #","
  253. 2260 sta inbuf,y
  254. 2265 iny;              add two
  255. 2270 lda #"s"
  256. 2275 sta inbuf,y;      append ',s'
  257. 2280 sty length;       save new length
  258. 2285 jsr yoohoo;       tell drive to talk
  259. 2290 lda #25;          ctrl-return
  260. 2295 jsr chrout;       clear to bottom
  261. 2300 seql lda st
  262. 2305 bne sqout;        exit if st set
  263. 2310 jsr stop
  264. 2315 beq sqout;        also check stop key
  265. 2320 jsr acptr;        get a byte
  266. 2325 jsr chrout;       and print it
  267. 2330 jmp seql;         loop back
  268. 2335 ;
  269. 2340 sqout jsr close;  close file
  270. 2345 jmp frmseq;       exit
  271. 2350 ;
  272. 2355 ; -- parse @ commands --
  273. 2360 ;
  274. 2365 doat jsr setup;  set up file parameters
  275. 2370 lda inbuf+1
  276. 2375 beq jdisperr;    just @
  277. 2380 cmp #"#"
  278. 2385 beq chgdev
  279. 2390 cmp #"q"
  280. 2395 beq quit
  281. 2400 cmp #"$"
  282. 2405 beq dir
  283. 2410 cmp #"\"
  284. 2415 beq jwprot
  285. 2420 ;
  286. 2425 ; -- send string to error channel --
  287. 2430 ;
  288. 2435 jsr hello;          make drive listen
  289. 2440 ldy #0
  290. 2445 daloop lda inbuf+1,y; send string
  291. 2450 jsr ciout;            to drive
  292. 2455 iny
  293. 2460 cpy length
  294. 2465 bne daloop
  295. 2470 jsr unlsn
  296. 2475 done jmp bye
  297. 2480 jdisperr jmp disperr; read error chan.
  298. 2485 ;
  299. 2490 jwprot beq wprot;     springboard
  300. 2495 ;
  301. 2500 ; -- disable wedge --
  302. 2505 ;
  303. 2510 quit lda #<crunch;  restore default
  304. 2515 sta crvec        ;  crunch vector
  305. 2520 lda #>crunch
  306. 2525 sta crvec+1
  307. 2530 ;
  308. 2535 ; -- change wedge device --
  309. 2540 ;
  310. 2545 chgdev lda inbuf+2
  311. 2550 and #$0f
  312. 2555 sta wejdev
  313. 2560 ;
  314. 2565 ; -- common exit point --
  315. 2570 ;
  316. 2575 bye jsr $a67a;      part of clear
  317. 2580 jmp $a47b;          main basic loop
  318. 2585 ;
  319. 2590 ; -- list directory to screen --
  320. 2595 ;
  321. 2600 dir jsr yoohoo;   make drive talk
  322. 2605 lda #3;           load addr,link,blocks
  323. 2610 linein sta $9c
  324. 2615 suk jsr acptr;    get byte from drive
  325. 2620 sta $9e;          store
  326. 2625 jsr acptr;        get another
  327. 2630 sta $9f;          store it too
  328. 2635 ldx st
  329. 2640 bne ddone;        check st
  330. 2645 dec $9c;          loop to read in
  331. 2650 bne suk;          $9c pairs
  332. 2655 ldx $9e;          print decimal
  333. 2660 ldy $9f;          number, i.e.
  334. 2665 jsr outnum;       number of blks
  335. 2670 lda #" "
  336. 2675 jsr chrout;       print space
  337. 2680 dloop jsr acptr;  get a byte
  338. 2685 beq endline;      loop till zero (eol)
  339. 2690 jsr chrout
  340. 2695 jmp dloop
  341. 2700 endline jsr prntret
  342. 2705 jsr stop;         check stop key
  343. 2710 beq ddone
  344. 2715 lda #2
  345. 2720 bne linein;       link,blocks
  346. 2725 ddone jsr close
  347. 2730 jmp bye
  348. 2735 ;
  349. 2740 prntret lda #13
  350. 2745 jmp chrout;       print return
  351. 2750 ;
  352. 2755 ; -- write (un)protect disk --
  353. 2760 ;
  354. 2765 ; this routine sends to commands to the
  355. 2770 ; drive. the first writes some code and
  356. 2775 ; the second one executes that code.
  357. 2780 ;
  358. 2785 wprot jsr hello
  359. 2790 ldy #0
  360. 2795 wloop lda protstr,y
  361. 2800 jsr ciout
  362. 2805 iny
  363. 2810 cpy #31
  364. 2815 bne wloop
  365. 2820 jsr unlsn
  366. 2825 jsr hello
  367. 2830 ldy #0
  368. 2835 wloop2 lda exestr,y
  369. 2840 jsr ciout
  370. 2845 iny
  371. 2850 cpy #5
  372. 2855 bne wloop2
  373. 2860 jsr unlsn
  374. 2865 jmp disperr
  375. 2870 ;
  376. 2875 ; these two commands are sent to the
  377. 2880 ; drive. the first is a memory write
  378. 2885 ; and the second is a memory execute
  379. 2890 ;
  380. 2895 protstr .asc "m-w"; m-w 00 06 25
  381. 2900 .word $0600
  382. 2905 .byte 25
  383. 2910 jsr $d042;          load bam
  384. 2915 lda $0702;          get dos version
  385. 2920 eor #4;             a to e/e to a
  386. 2925 sta $0702;          store it back
  387. 2930 sta $07a6;          directory (2a/e)
  388. 2935 lda #$41;           make sure drive
  389. 2940 sta $0101;          will write
  390. 2945 jsr $ef07;          bam to disk
  391. 2950 jmp $d042;          reread bam and exit
  392. 2955 ;
  393. 2960 exestr .asc "m-e";  m-e 00 06
  394. 2965 .word $0600
  395. 2970 ;
  396. 2975 ; -- load routine % / ^ = --
  397. 2980 ;
  398. 2985 loadit sta snd
  399. 2990 jsr setup;       set up file parameters
  400. 2995 ldx sob
  401. 3000 ldy sob+1;       get start of basic
  402. 3005 lda inbuf;       if verify then
  403. 3010 cmp #"=";        accum > 0
  404. 3015 beq ver
  405. 3020 lda #0
  406. 3025 ver jsr load;    load program
  407. 3030 bcs lbad;        branch on error
  408. 3035 lda st
  409. 3040 and #$10
  410. 3045 bne lbad2;       branch on st
  411. 3050 lda inbuf
  412. 3055 cmp #"%"
  413. 3060 beq ldone;       if ml load then done
  414. 3065 lda eal
  415. 3070 sta sov
  416. 3075 lda eal+1
  417. 3080 sta sov+1;       set end of load pntrs
  418. 3085 jsr clear;       reset remaining pntrs
  419. 3090 jsr link;        re-link program
  420. 3095 jsr runc;        partial clear
  421. 3100 lda inbuf
  422. 3105 cmp #"^"
  423. 3110 bne ldone;       if not ^ then done
  424. 3115 lda #0
  425. 3120 sta kflag;       suppress kernal mess.
  426. 3125 sta inbuf
  427. 3130 jmp newstt;      execute next statement
  428. 3135 ;
  429. 3140 lbad tax
  430. 3145 bne lfini
  431. 3150 ldx #$1e
  432. 3155 .byte $2c
  433. 3160 lbad2 ldx #$1c
  434. 3165 .byte $2c
  435. 3170 ldone ldx #$80;   no error
  436. 3175 lda #$ff
  437. 3180 sta $3a;          set direct mode
  438. 3185 lfini jmp ($0300)
  439. 3190 ;
  440. 3195 ; -- parse command string --
  441. 3200 ;
  442. 3205 ; this routine set length and addr
  443. 3210 ; parameters of filename in buffer.
  444. 3215 ; %    "filename"  will become
  445. 3220 ; %filenamelname
  446. 3225 ;     this ^^^^^ will be ignored
  447. 3230 ;
  448. 3235 parse ldy #$02
  449. 3240 sty fname+1
  450. 3245 dey
  451. 3250 sty fname;          filename at $0201
  452. 3255 dey; now zero
  453. 3260 ploop1 lda inbuf+1,y
  454. 3265 beq pdone
  455. 3270 cmp #$22
  456. 3275 beq quot
  457. 3280 iny
  458. 3285 bpl ploop1
  459. 3290 quot ldx #0
  460. 3295 pmove lda inbuf+2,y; shift string to
  461. 3300 sta inbuf+1,x;       start of buffer.
  462. 3305 beq x2y;             no trailing quote
  463. 3310 cmp #$22
  464. 3315 beq x2y
  465. 3320 iny
  466. 3325 inx
  467. 3330 cpx #$25
  468. 3335 bne pmove
  469. 3340 x2y txa
  470. 3345 tay
  471. 3350 pdone sty length
  472. 3355 rts
  473. 3360 ;
  474. 3365 ; -- display error channel --
  475. 3370 ;
  476. 3375 disperr jsr clrst
  477. 3380 lda device
  478. 3385 jsr talk
  479. 3390 lda #%01101111;     $60+0f
  480. 3395 jsr tksa
  481. 3400 errloop jsr acptr
  482. 3405 jsr chrout
  483. 3410 cmp #13
  484. 3415 beq errdone
  485. 3420 lda st
  486. 3425 beq errloop
  487. 3430 errdone jsr untalk
  488. 3435 jbye jmp bye
  489. 3440 ;
  490. 3445 ; -- make disk listen --
  491. 3450 ;
  492. 3455 hello lda device
  493. 3460 jsr listen
  494. 3465 lda #%01101111;     $60+0f
  495. 3470 jmp second
  496. 3475 ;
  497. 3480 ; -- make drive talk --
  498. 3485 ;
  499. 3490 yoohoo lda #%01100000;   $60+0
  500. 3495 sta snd;          2ndary addr
  501. 3500 jsr open;         open channel
  502. 3505 lda device
  503. 3510 jsr talk;         make drive talk
  504. 3515 lda snd
  505. 3520 jmp tksa;         2ndary addr
  506. 3525 ;
  507. 3530 ; -- setup for drive routines --
  508. 3535 ;
  509. 3540 setup jsr parse;  parse filename
  510. 3545 lda wejdev
  511. 3550 sta device;       set drive #
  512. 3555 clrst lda #0
  513. 3560 sta st;           clear status
  514. 3565 rts
  515. 3570 ;
  516. 3575 ; -- parse ! routines --
  517. 3580 ;
  518. 3585 dobas lda inbuf+1
  519. 3590 beq jbye;           just !
  520. 3595 cmp #"d"
  521. 3600 beq default
  522. 3605 cmp #"*"
  523. 3610 beq unnew
  524. 3615 cmp #"0"
  525. 3620 bcc jbye
  526. 3625 cmp #"<"
  527. 3630 bcs jbye
  528. 3635 sta border
  529. 3640 ldy inbuf+2
  530. 3645 beq scolor
  531. 3650 clc
  532. 3655 tya
  533. 3660 adc #10
  534. 3665 sta border
  535. 3670 scolor sta backrnd
  536. 3675 jmp bye
  537. 3680 ;
  538. 3685 default jsr color
  539. 3690 jmp bye
  540. 3695 ;
  541. 3700 ; -- unnew basic --
  542. 3705 ;
  543. 3710 unnew lda #1
  544. 3715 tay
  545. 3720 sta (sob),y;   set first link
  546. 3725 jsr link;      re-link program
  547. 3730 lda misc
  548. 3735 sta sov;       link provides the
  549. 3740 lda misc+1;    end of program.
  550. 3745 sta sov+1;     just move it.
  551. 3750 jsr clear
  552. 3755 jmp bye
  553. 3760 ;
  554. 3765 ; -- set default screen colors --
  555. 3770 ; -- modify to suit your taste --
  556. 3775 ;
  557. 3780 color lda #$80
  558. 3785 sta repeat;         make all keys repeat
  559. 3790 lda #0;             backround
  560. 3795 sta border
  561. 3800 nop;                you can insert a
  562. 3805 nop;                a lda #xx here.
  563. 3810 sta backrnd
  564. 3815 lda #153;           char color
  565. 3820 jsr chrout
  566. 3825 lda #14;            lowercase
  567. 3830 jmp chrout
  568. 3835 ;
  569. 3840 ; -- check for autoboot --
  570. 3845 ;
  571. 3850 autoboot jsr wedgeon
  572. 3855 jsr basinit;        initialize basic
  573. 3860 jsr color
  574. 3865 jsr basmsg;         power up message
  575. 3870 ;
  576. 3875 ldx #251
  577. 3880 txs; clear stack
  578. 3885 lda #1
  579. 3890 sta flag;           init load type flag
  580. 3895 lda spckey
  581. 3900 cmp #1
  582. 3905 beq auto1;          if shift key
  583. 3910 cmp #4
  584. 3915 beq auto2;          if ctrl key
  585. 3920 bne fini;           always if no match
  586. 3925 auto1 lsr flag;     flag now zero
  587. 3930 auto2 jsr clall
  588. 3935 ldy #$ff
  589. 3940 bootl iny;          tranfer "0:?*"
  590. 3945 lda star,y;         to input buffer.
  591. 3950 sta inbuf+1,y
  592. 3955 bne bootl
  593. 3960 jsr parse;          parse buffer
  594. 3965 lda flag
  595. 3970 bne mlload
  596. 3975 lda #"^"
  597. 3980 .byte $2c
  598. 3985 mlload lda #"%"
  599. 3990 sta inbuf;          use the wedge
  600. 3995 jmp wdge;           to load program.
  601. 4000 fini jmp $e386;     to basic
  602. 4005 star .asc "0:?*"
  603. 4010 .byte 0
  604. 4015 ;
  605. 4020 ; -- power up default colors --
  606. 4025 ;
  607. 4030 setclr jsr color
  608. 4035 jmp ($a002)
  609. 4040 ;
  610. 4045 ; -- stop scroll if shift --
  611. 4050 ;
  612. 4055 wait sta $ac
  613. 4060 sei
  614. 4065 w1 lda #$fd
  615. 4070 sta ciapra
  616. 4075 lda ciaprb
  617. 4080 cmp #%01111111
  618. 4085 beq w1;             loop if shift
  619. 4090 cli
  620. 4095 rts
  621. 4100 ;
  622. 4105 ; -- quote toggle --
  623. 4110 ;
  624. 4115 chkquote bpl chkq;  part of reg kernal
  625. 4120 jmp $e7d4;          key > 128
  626. 4125 chkq cmp #ctrlins;  "ctrl-ins pressed?
  627. 4130 beq q[164]g;           yep
  628. 4135 jmp chkcodes;       nope
  629. 4140 q[164]g lda insert;    "insert mode?
  630. 4145 beq tryq;           nope
  631. 4150 qoff lda #0
  632. 4155 sta insert;         clear insert
  633. 4160 sta quote;          clear quote
  634. 4165 beq qdone;          always
  635. 4170 tryq lda quote;     "quote mode?
  636. 4175 bne qoff;           yep, clear it
  637. 4180 inc quote;          nope, set it
  638. 4185 qd[145]e jmp chard[145]e
  639. 4190 ;
  640. 4195 ; [171][171] parse [162] ctrl codes [171][171]
  641. 4200 ;
  642. 4205 [162]codes cmp #ctrlret
  643. 4210 beq [156]2eol
  644. 4215 cmp #ctrlhm
  645. 4220 beq bothome
  646. 4225 cmp #ctrlvcr
  647. 4230 beq [156]2bot
  648. 4235 cmp #ctrlhcr
  649. 4240 beq [156]2[164]p
  650. 4245 jmp up[176]down;      check [129] case change
  651. 4250 ;
  652. 4255 ; [171][171] clear [164] [128] of line [171][171]
  653. 4260 ;
  654. 4265 [156]2eol lda #$20;  put a space
  655. 4270 sta (rpnt),y;      in video matrix
  656. 4275 lda back[187];       put backround col[176]
  657. 4280 sta (cpnt),y;      in col[176] mem[176]y
  658. 4285 iny
  659. 4290 cpy lmax;          check [129] eol
  660. 4295 bcc [156]2eol
  661. 4300 beq [156]2eol
  662. 4305 bcs jchrd[145]e
  663. 4310 ;
  664. 4315 ; [171][171] curs[176] [164] bot[164]m [171][171]
  665. 4320 ;
  666. 4325 bothome ldy #0
  667. 4330 ldx #24
  668. 4335 jsr $e50c;       jump [181]o clear screen
  669. 4340 jchrd[145]e jmp chard[145]e
  670. 4345 ;
  671. 4350 ; [171][171] clear [164] bot[164]m of screen [171][171]
  672. 4355 ;
  673. 4360 [156]2bot ldx #$19
  674. 4365 c2b1 dex;        from the bot[164]m up
  675. 4370 cpx row
  676. 4375 beq c2b2
  677. 4380 lda llynx,x;     clear line links
  678. 4385 [176]a #$80
  679. 4390 sta llynx,x
  680. 4395 jsr [156]line;     clear line
  681. 4400 bmi c2b1;        always
  682. 4405 c2b2 jsr $e9f0;  reset po[181]ers
  683. 4410 jsr $ea24
  684. 4415 ldy column;      clear line the
  685. 4420 jmp [156]2eol;     curs[176]s [145].
  686. 4425 ;
  687. 4430 ; [171][171] clear [164] [164]p of screen [171][171]
  688. 4435 ;
  689. 4440 [156]2[164]p ldx #$ff
  690. 4445 c2t1 inx;        from the [164]p down
  691. 4450 lda llynx,x;     clear line links
  692. 4455 [176]a #$80
  693. 4460 sta llynx,x
  694. 4465 jsr [156]line;     clear line
  695. 4470 cpx row
  696. 4475 bne c2t1
  697. 4480 beq jchrd[145]e;    always
  698. 4485 ;
  699. 4490 ; [171][171] various patches [171][171]
  700. 4495 ;
  701. 4500 [172][178] $fcff
  702. 4505 jmp au[164]boot
  703. 4510 [172][178] $fe6f
  704. 4515 jmp set[156]
  705. 4520 [172][178] $ff80
  706. 4525 .byte $10;   versi[145] byte (1.0)
  707. 4530 ;
  708. 4535 ; [171][171] [158]65526 [164] reactivate [171][171]
  709. 4540 ;
  710. 4545 [172][178] $fff6;    last jump table entry
  711. 4550 jmp wedge[145]; is n[176]mally unused.
  712. 4555 ;
  713. 4560 ;
  714. 4565 .[128]
  715.