home *** CD-ROM | disk | FTP | other *** search
- 1000 rem --- garbage collector message ---
- 1010 rem ----- by michael t. graham ------
- 1020 rem open8,8,8,"0:garbmsg,p,w"
- 1030 sys700
- 1040 ;.opt o8
- 1050 ;pal assembler source code
- 1060 ;
- 1070 ;this basic patch puts a message
- 1080 ;on screen when basic's garbage
- 1090 ;collector runs. basic is moved to
- 1100 ;ram at initialization.
- 1110 ;
- 1120 hibase =$0288 ;kernal screen page addr
- 1130 addr =$fb ;move vector
- 1140 patch1 =$b526 ;"patch start of collector
- 1150 patch2 [178]$b606 ;"patch end of collecttor
- 1160 ret1 =$b52a ;continue start
- 1170 cont =$b60c ;(NULL)or not done
- 1180 quit =$b601 ;"end collection
- 1190 col[176] [178]$02 ;message col[176] s[164]rage
- 1200 cmem [178]$d80a ;col[176] mem[176]y start
- 1210 screen [178]$fd ;screen vec[164]r s[164]rage
- 1220 ;
- 1230 [172][178]$033c ;cassette buffer
- 1240 ;
- 1250 ;initialize message patch ([158] 828)
- 1260 ;
- 1270 init lda #$00 ;set up
- 1280 sta addr ;indirect
- 1290 lda #$a0 ;address
- 1300 sta addr[170]1 ;[164] move
- 1310 ldy #$00 ;basic
- 1320 xfer lda (addr),y ;move basic rom
- 1330 sta (addr),y ;[164] ram
- 1340 iny
- 1350 bne xfer
- 1360 inc addr[170]1 ;bump page address
- 1370 lda addr[170]1 ;[154]inue move
- 1380 cmp #$c0 ; up [164]
- 1390 bmi xfer ;$bfff
- 1400 lda #$4c ;jmp instructi[145] op code
- 1410 sta patch1 ;s[164]re the jumps [129] the
- 1420 sta patch2 ;patches
- 1430 lda #[179]fix1 ;jump [164] fix1 at start
- 1440 sta patch1[170]1
- 1450 lda #[177]fix1
- 1460 sta patch1[170]2
- 1470 lda #[179]fix2 ;jump [164] fix2 at [128]
- 1480 sta patch2[170]1
- 1490 lda #[177]fix2
- 1500 sta patch2[170]2
- 1510 lda #$ef ;map
- 1520 sta $00 ;out
- 1530 lda $01 ;the basic
- 1540 [175] #$fe ;rom
- 1550 sta $01
- 1560 lda #01 ;initialize
- 1570 sta col[176] ;col[176] [164] white
- 1580 rts ;[128] init
- 1590 ;
- 1600 ;patch h[175]ler
- 1610 ;
- 1620 ;fix1 [178] patch [164] start of [209][176]
- 1630 ;
- 1640 fix1 jsr ms[203]n ;display message
- 1650 ldx $37 ;finish displaced basic
- 1660 lda $38 ;code
- 1670 jmp ret1 ;[142] [164] basic
- 1680 ;
- 1690 ;fix2 [178] patch [164] [128] of [209][176]
- 1700 ;
- 1710 fix2 lda $4f ;finish basic's
- 1720 [176]a $4e ;stuff
- 1730 beq retrn ;d[145]e [209]i[145]
- 1740 jmp [154] ;[154]inue [209]i[145]
- 1750 retrn jsr ms[203]ff ;put screen back
- 1760 jmp quit ;[209][176] d[145]e
- 1770 ;
- 1780 ;[148] user screen [175] put message
- 1790 ;[145] screen be[129]e starting
- 1800 ;garbage [209][176].
- 1810 ;
- 1820 ms[203]n php ;[148] status
- 1830 tya ;[175] y
- 1840 pha ;register
- 1850 lda #10 ;start at
- 1860 sta screen ;11th char
- 1870 lda hibase ;[161] screen
- 1880 sta screen[170]1 ;page addr
- 1890 ldy #19 ;20 characters
- 1900 ldx col[176] ;message col[176]
- 1910 move lda (screen),y ;[148] existing
- 1920 sta buffer,y ;screen [154]ents
- 1930 lda messag,y ;[161] message
- 1940 [175] #$bf ;c[145]vert [164] screen code
- 1950 sta (screen),y ;display message
- 1960 lda cmem,y ;[148] existing
- 1970 sta cbuff,y ;col[176] mem[176]y
- 1980 txa ;replace with
- 1990 sta cmem,y ;message col[176]
- 2000 dey ;bump index
- 2010 bpl move ;move 20 characters
- 2020 pla ;[140]
- 2030 tay ;registers
- 2040 plp
- 2050 rts ;d[145]e
- 2060 ;
- 2070 ;put user's screen [154]ents back
- 2080 ;after collec[164]r is d[145]e.
- 2090 ;
- 2100 ms[203]ff php ;[148]
- 2110 pha
- 2120 tya ;registers
- 2130 pha
- 2140 lda #10 ;11th character
- 2150 sta screen ;[145] screen
- 2160 lda hibase ;screen page
- 2170 sta screen[170]1 ;address
- 2180 ldy #19 ;20 characters
- 2190 res[164]r lda buffer,y ;put text
- 2200 sta (screen),y ;back
- 2210 lda cbuff,y ;[140]
- 2220 sta cmem,y ;col[176]s
- 2230 dey ;bump index
- 2240 bpl res[164]r ;[140] 20 characters
- 2250 pla ;[140]
- 2260 tay
- 2270 pla ;registers
- 2280 plp
- 2290 rts ;d[145]e
- 2300 ;
- 2310 messag .[198] " >wait,system busy< "
- 2320 ;
- 2330 ;[131] storage - 40 bytes at $02a7
- 2340 ;
- 2350 [172][178]$02a7
- 2360 ;
- 2370 buffer [172][178][172][170]20
- 2380 cbuff [172][178][172][170]20
- 2390 ;
- 2400 .[128]
-