home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 35 / 64er_Magazin_Sonderheft_35_19xx_Markt__Technik_de.d64 / smon+src (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  8KB  |  432 lines

  1. 100 sys9*4096
  2. 110 .opt oo
  3. 130 ;
  4. 140 ; !smon-erweiterung
  5. 150 ; erweitert smon um folgende
  6. 160 ; befehle   - h adr1 (adr2)
  7. 170 ;           - z adr1 (adr2)
  8. 180 ;           - n adr1 (adr2)
  9. 190 ;           - u adr1 (adr2)
  10. 200 ;           - e adr1  adr2
  11. 210 ;           - y byte
  12. 220 ;           - q adr1
  13. 230 ;           - j
  14. 240 ;
  15. 250 ;------------------------------
  16. 260 ; 'h'
  17. 270 ;
  18. 280 ;     bildet jeweils drei bytes
  19. 290 ;     in binaerdarstellung ab.
  20. 300 ;     (fuer sprite-daten)
  21. 310 ;------------------------------
  22. 320 ; 'z' (zeichen)
  23. 330 ;
  24. 340 ;     bildet jeweils ein byte
  25. 350 ;     in binaerdarstellung ab.
  26. 360 ;     (fuer character-daten)
  27. 370 ;------------------------------
  28. 380 ; 'n' (normal)
  29. 390 ;
  30. 400 ;     bildet 32 bytes als bild-
  31. 410 ;     schirm-code ab.(+ adr!)
  32. 420 ;------------------------------
  33. 430 ; 'u' (uebersicht)
  34. 440 ;
  35. 450 ;     bildet 40 bytes als bild-
  36. 460 ;     schirm-code ab.       
  37. 470 ;------------------------------
  38. 480 ; 'e' (erase)
  39. 490 ;
  40. 500 ;     fuellt bereich von adr1
  41. 510 ;     bis adr2 mit $00.
  42. 520 ;------------------------------
  43. 530 ; 'y'
  44. 540 ;
  45. 550 ;     schreibt smon auf
  46. 560 ;     $byte00 um.
  47. 570 ;------------------------------
  48. 580 ; 'q'
  49. 590 ;
  50. 600 ;     kopiert zeichensatz
  51. 610 ;     nach adr1.
  52. 620 ;------------------------------
  53. 630 ; 'j'
  54. 640 ;
  55. 650 ;     holt letzten ausgabe-
  56. 660 ;     befehl (h,z,n,u,k,m,d)
  57. 670 ;     zurueck.
  58. 680 ;------------------------------
  59. 690 ;
  60. 700 s = $c000      ;basisadresse smon
  61. 710 ;
  62. 720 hch      ="("  ;hidden commands
  63. 730 hcz      =")"
  64. 740 hcn      ="!"
  65. 750 ;
  66. 760 flag     =$aa
  67. 770 temp     =$ab
  68. 780 pcl      =$fb
  69. 790 pch      =$fc
  70. 800 hinibble =$ff
  71. 810 ;
  72. 820 cmds     =s+$02b
  73. 830 get12adr =s+$264
  74. 840 get2adr  =s+$27a
  75. 850 getadr1  =s+$27e
  76. 860 getbyt   =s+$28d
  77. 870 skipspac =s+$2b8
  78. 880 getret   =s+$2c2
  79. 890 getchrer =s+$2ca
  80. 900 error    =s+$2d1
  81. 910 execute  =s+$2d6
  82. 920 cmdstore =s+$2ff
  83. 930 charret  =s+$340
  84. 940 return   =s+$351
  85. 950 hexout   =s+$323
  86. 960 pcinc    =s+$367
  87. 970 ascii4   =s+$44f
  88. 980 ascii5   =s+$456
  89. 990 contin   =s+$45d
  90. 1000 occupy   =s+$9c7
  91. 1010 ;-------------
  92. 1011 *= s+38
  93. 1012 .byte 00      ;alten z-befehl loeschen
  94. 1013 ;
  95. 1020 *= s+$61
  96. 1030 ;
  97. 1040 hcmdtab .asc "':;,"
  98. 1050 .byte hch,hcz,hcn
  99. 1060 ;
  100. 1070 *=s+$2e3
  101. 1080 ;
  102. 1090 ldx #6        ;zeilenanfang
  103. 1100 f1 cmp hcmdtab,x
  104. 1110 beq exec1
  105. 1120 dex
  106. 1130 bpl f1
  107. 1140 lda #"."
  108. 1150 jsr $ffd2
  109. 1160 ;
  110. 1170 exec1 jsr getchrerr
  111. 1180 cmp #"."
  112. 1190 beq exec1
  113. 1200 jmp linstore
  114. 1210 weiter jmp morecmd
  115. 1220 ;
  116. 1230 *=s+$30d      ;weitere befehle
  117. 1240 ;
  118. 1250 beq weiter
  119. 1260 ;
  120. 1270 *=s+$e09      ;neue routinen
  121. 1280 ;
  122. 1290 ;-------------
  123. 1300 ;
  124. 1310 zcmd lda #$80 ;flag setzen
  125. 1320 .byte $2c
  126. 1330 ;
  127. 1340 hcmd lda #0
  128. 1350 sta temp
  129. 1360 jsr get12adr  ;start/end-adresse
  130. 1370 ;
  131. 1380 l1 bit temp
  132. 1390 bpl w8
  133. 1400 ldx #hcz      ;hidden command
  134. 1410 .byte $2c     ;ausgeben
  135. 1420 w8 ldx #hch
  136. 1430 jsr charret
  137. 1440 jsr hexout    ;pc ausgeben
  138. 1450 ldy #6        ;spalte 6
  139. 1460 ;
  140. 1470 l2 ldx #0
  141. 1480 lda (pcl,x)
  142. 1490 ;
  143. 1500 l3 asl
  144. 1510 pha           ;byte merken
  145. 1520 bcs bitset    ;bit=1, dann *
  146. 1530 lda #"."      ;bit=0, dann .
  147. 1540 .byte $2c     ;ausgeben
  148. 1550 bitset lda #"*"
  149. 1560 sta ($d1),y
  150. 1570 lda $286
  151. 1580 sta ($f3),y
  152. 1590 ;
  153. 1600 pla           ;byte zurueckholen
  154. 1610 iny           ;cursor weiter
  155. 1620 inx           ;naechstes byte
  156. 1630 cpx #8        ;8 bit
  157. 1640 bne l3        ;byte weiterschieben
  158. 1650 ;
  159. 1660 jsr pcinc     ;zaehler erhoehen
  160. 1670 bit temp      ;flag fuer 1*8 bit
  161. 1680 bmi w9        ;zeile fertig
  162. 1690 cpy #30       ;3 bytes
  163. 1700 bcc l2
  164. 1710 w9 jsr contin ;tasten-abfrage
  165. 1720 bcc l1
  166. 1730 rts
  167. 1740 ;
  168. 1750 ;-------------
  169. 1760 ;
  170. 1770 zcmdh   ldy #8
  171. 1780 .byte $2c     ;1 byte
  172. 1790 ;
  173. 1800 hcmdh ldy #24 ;3 byte
  174. 1810 jsr getadr1
  175. 1820 jsr skipspace ;spaces ueberlesen
  176. 1830 a1 ldx #8
  177. 1840 lda #0
  178. 1850 sta flag
  179. 1860 ;
  180. 1870 a2 jsr getchrerr
  181. 1880 cmp #"."      ;. => bit=0
  182. 1890 beq bit0      ;* => bit=1
  183. 1900 cmp #"*"
  184. 1910 beq bit1
  185. 1920 err1 jmp error ;anderes zeichen
  186. 1930 ;
  187. 1940 bit0 clc
  188. 1950 bit1 rol flag
  189. 1960 dey
  190. 1970 dex           ;byte
  191. 1980 bne a2        ;noch nicht fertig
  192. 1990 ;
  193. 2000 lda flag      ;in speicher
  194. 2010 sta (pcl,x)   ;schreiben
  195. 2020 cmp (pcl,x)
  196. 2030 bne err1
  197. 2040 jsr pcinc
  198. 2050 ;
  199. 2060 cpy #0
  200. 2070 bne a1        ;noch nicht fertig
  201. 2080 rts
  202. 2090 ;
  203. 2100 ;-------------
  204. 2110 ;
  205. 2120 ncmd lda #$80
  206. 2130 .byte $2c
  207. 2140 ucmd lda #0
  208. 2150 sta temp
  209. 2160 jsr get12adr
  210. 2170 ;
  211. 2180 l5 jsr return
  212. 2190 bit temp
  213. 2200 bpl u
  214. 2210 lda #hcn      ;hidden command
  215. 2220 jsr $ffd2
  216. 2230 jsr hexout
  217. 2240 ldy #8        ;spalte 8
  218. 2250 .byte $2c
  219. 2260 ;
  220. 2270 u ldy #0      ;spalte 0
  221. 2280 ldx #0
  222. 2290 ;
  223. 2300 l4 lda (pcl,x)
  224. 2310 jsr ascii4    ;als bildschirm-code
  225. 2320 bne l4        ;ausgeben
  226. 2330 ;
  227. 2340 jsr contin
  228. 2350 bcc l5        ;naechste zeile
  229. 2360 rts
  230. 2370 ;-------------
  231. 2380 ncmdh jsr getadr1
  232. 2390 ldx #0
  233. 2400 ldy #8        ;spalte 8
  234. 2410 c1 lda ($d1),y
  235. 2420 sta (pcl,x)   ;in speicher
  236. 2430 cmp (pcl,x)   ;schreiben
  237. 2440 bne err1
  238. 2450 jsr ascii5    ;pc erhoehen
  239. 2460 bcc c1
  240. 2470 rts           ;zeile fertig
  241. 2480 ;
  242. 2490 ;-------------
  243. 2500 ;
  244. 2510 ycmd jsr getbyt
  245. 2520 and #%11110000
  246. 2530 sta hinibble  ;neuer 4k-block
  247. 2540 jsr setptr    ;adressen setzen
  248. 2550 jsr $79d6     ;w-befehl
  249. 2560 ;
  250. 2570 jsr setptr
  251. 2580 lda #$14      ;bereich ohne
  252. 2590 sta $fb       ;tabellen
  253. 2600 lda #2
  254. 2610 ora hinibble
  255. 2620 sta $fc
  256. 2630 lda #<newcmds
  257. 2640 sta $fd
  258. 2650 lda #(newcmds>8 & $f)
  259. 2660 ora hinibble
  260. 2670 sta $fe
  261. 2680 jsr $7a68     ;v-befehl
  262. 2690 ;
  263. 2700 ldy #0        ;lade-befehle
  264. 2710 ldx #13       ;anpassen
  265. 2720 d3 lda change,x
  266. 2730 ora hinibble
  267. 2740 sta pch       ;adresse als zeiger
  268. 2750 dex
  269. 2760 lda change,x
  270. 2770 sta pcl
  271. 2780 lda (pcl),y
  272. 2790 and #%00001111
  273. 2800 ora hinibble
  274. 2810 sta (pcl),y
  275. 2820 dex
  276. 2830 bpl d3
  277. 2840 ;
  278. 2850 lda #<cmds    ;zeiger auf
  279. 2860 sta pcl       ;befehlsadressen
  280. 2870 lda #(cmds>8 & $f)
  281. 2880 ora hinibble
  282. 2890 sta pch
  283. 2900 ;
  284. 2910 ldy #53
  285. 2920 d1 lda (pcl),y
  286. 2930 and #%00001111
  287. 2940 ora hinibble  ;hibytes
  288. 2950 sta (pcl),y   ;angleichen
  289. 2960 w1 dey
  290. 2970 dey
  291. 2980 bpl d1
  292. 2990 ;
  293. 3000 lda #<newadr  ;zeiger auf neue
  294. 3010 sta pcl       ;befehlsadressen
  295. 3020 lda #(newadr>8 & $f)
  296. 3030 ora hinibble
  297. 3040 sta pch
  298. 3050 ;
  299. 3060 ldy #tabend-newadr-1
  300. 3070 d2 lda (pcl),y
  301. 3080 and #%00001111
  302. 3090 ora hinibble  ;hibytes
  303. 3100 sta (pcl),y   ;angleichen
  304. 3110 dey
  305. 3120 dey
  306. 3130 bpl d2
  307. 3140 rts
  308. 3150 ;
  309. 3160 ;
  310. 3170 setptr lda hinibble
  311. 3180 sta $a9       ;neuer start hi
  312. 3190 jsr gethi
  313. 3200 gethi pla
  314. 3210 pla
  315. 3220 and #%11110000
  316. 3230 sta $a5       ;alter start hi
  317. 3240 clc
  318. 3250 adc #$10
  319. 3260 sta $a7       ;altes ende hi
  320. 3270 ;
  321. 3280 lda #0        ;lo-bytes loeschen
  322. 3290 sta $a4
  323. 3300 sta $a6
  324. 3310 sta $a8
  325. 3320 rts
  326. 3330 ;
  327. 3340 ;---------
  328. 3350 ;
  329. 3360 ecmd jsr get2adr
  330. 3370 lda #0
  331. 3380 jmp occupy
  332. 3390 ;
  333. 3400 ;---------
  334. 3410 ;
  335. 3420 qcmd jsr getadr1
  336. 3430 ldy #0
  337. 3440 lda #$d0      ;zeiger auf
  338. 3450 sty $fd       ;zeichenrom
  339. 3460 sta $fe
  340. 3470 ;
  341. 3480 sei
  342. 3490 lda #%011     ;rom einblenden
  343. 3500 sta 1
  344. 3510 ldx #16       ;4k uebertragen
  345. 3520 e1 lda ($fd),y
  346. 3530 sta (pcl),y
  347. 3540 iny
  348. 3550 bne e1
  349. 3560 inc pch
  350. 3570 inc $fe
  351. 3580 dex
  352. 3590 bne e1
  353. 3600 lda #$27      ;normaleinstellung
  354. 3610 sta 1
  355. 3620 cli
  356. 3630 rts
  357. 3640 ;
  358. 3650 ;---------
  359. 3660 ;
  360. 3670 linstore pha  ;befehl merken
  361. 3680 cmp #"j"
  362. 3690 bne store
  363. 3700 ;
  364. 3710 ldy #39
  365. 3720 g1 lda $0200,y
  366. 3730 sta ($d1),y   ;zeile auf
  367. 3740 dey           ;bildschirm
  368. 3750 bpl g1        ;schreiben
  369. 3760 pla
  370. 3770 dec $d6       ;cursor 1 hoch
  371. 3780 jmp execute
  372. 3790 ;
  373. 3800 store ldy #6
  374. 3810 g3 cmp outcmds,y
  375. 3820 bne w3
  376. 3830 ;
  377. 3840 ok1 ldy #39
  378. 3850 g2 lda ($d1),y
  379. 3860 sta $0200,y   ;zeile nur bei
  380. 3870 dey           ;h,z,n,u,k,m,d
  381. 3880 bpl g2        ;speichern
  382. 3890 ;
  383. 3900 w3 dey
  384. 3910 bpl g3
  385. 3920 stend pla     ;befehl zurueckholen
  386. 3930 jmp cmdstore
  387. 3940 ;
  388. 3950 ;+++++++++
  389. 3960 ;
  390. 3970 morecmd ldx #newadr-newcmds-3
  391. 3980 b1 cmp newcmds-1,x
  392. 3990 beq found
  393. 4000 dex
  394. 4010 bne b1
  395. 4020 jmp error
  396. 4030 ;
  397. 4040 found jsr cmdexec2
  398. 4050 jmp execute
  399. 4060 ;
  400. 4070 cmdexec2 txa
  401. 4080 asl
  402. 4090 tax
  403. 4100 lda newadr-1,x
  404. 4110 pha
  405. 4120 lda newadr-2,x
  406. 4130 pha
  407. 4140 rts
  408. 4150 ;
  409. 4160 newcmds .byte hch,hcz,hcn
  410. 4170 .asc "eyq"
  411. 4180 outcmds .asc "hznudkm"
  412. 4190 ;
  413. 4200 newadr .word hcmdh-1
  414. 4210 .word zcmdh-1
  415. 4220 .word ncmdh-1
  416. 4230 .word ecmd-1             ;e
  417. 4240 .word ycmd-1             ;y
  418. 4250 .word qcmd-1             ;q
  419. 4260 .word hcmd-1             ;!
  420. 4270 .word zcmd-1             ;z
  421. 4280 .word ncmd-1             ;n
  422. 4290 .word ucmd-1             ;u
  423. 4300 tabend = *
  424. 4310 ;
  425. 4320 change .word $0005+1
  426. 4330 .word $0386+1
  427. 4340 .word $0c2c+1
  428. 4350 .word $0c5b+1
  429. 4360 .word $0cf4+1
  430. 4370 .word $0da1+1
  431. 4380 .word $0e03+1
  432.