home *** CD-ROM | disk | FTP | other *** search
- 100 rem open2,8,1,"ss baby.o"
- 110 sys700
- 120 ;
- 130 .opt oo
- 140 ;
- 150 memctrl = $01
- 160 maskout = %11111101
- 170 maskin = %00000010
- 180 frmevl = $ad9e
- 190 getcomma = $aefd
- 200 convert = $b1aa
- 210 illquan = $b248
- 220 pntr1 = $fb
- 230 pntr2 = pntr1 + 2
- 240 ;
- 250 dummyloc = $ff00
- 260 kill = $60
- 270 theenmi = $fffa
- 280 ;
- 290 clc ; preserve a screen
- 300 nop ;
- 310 .byte $24
- 320 ;
- 330 sec ; restore a screen
- 340 ;
- 350 php ; save flags
- 360 sei ; disable irq's
- 370 ;
- 380 ldx #0 ; init vector to disable
- 390 stx theenmi ; nmi's
- 400 dex ;
- 410 stx theenmi+1 ;
- 420 ;
- 430 lda #kill ; put an 'rti' at
- 440 sta dummyloc ; dummy location
- 450 ;
- 460 lda pntr1 ; preserve the contents
- 470 pha ; of two 16-bit pointers
- 480 lda pntr1+1 ;
- 490 pha ;
- 500 lda pntr2 ;
- 510 pha ;
- 520 lda pntr2+1 ;
- 530 pha ;
- 540 ;
- 550 php ; save get/restore flag
- 560 ;
- 570 jsr getcomma ; skip past comma
- 580 jsr frmevl ; evaluate expression
- 590 jsr convert ;
- 600 ;
- 610 ; on return -- a=msb, y=lsb
- 620 ; of integer number
- 630 ;
- 640 tax ; exit if acc != 0
- 650 bne error ;
- 660 ;
- 670 sta pntr1 ; clear lsb of each pntr
- 680 sta pntr2 ;
- 690 ;
- 700 tya ;
- 710 and #7 ; mask the lsb
- 720 beq error ; exit if acc = 0
- 730 ;
- 740 asl ; multiply by eight
- 750 asl ;
- 760 asl ;
- 770 ;
- 780 cmp #%00101000 ; determine which
- 790 bcc less ; rom to look under
- 800 adc #$b7 ; if > #$20, then kernal
- 810 .byte $2c
- 820 less adc #$98 ; else basic rom
- 830 sta pntr2+1 ;
- 840 ;
- 850 ldy 648 ; get msb of screen
- 860 beq error ;
- 870 sty pntr1+1 ;
- 880 ;
- 890 lda memctrl ; switch out both roms
- 900 and #maskout ;
- 910 sta memctrl ;
- 920 ;
- 930 plp ; fetch get/restore flag
- 940 ;
- 950 ldx #4 ;
- 960 ldy #0 ;
- 970 ;
- 980 bcs recall ;
- 990 ;
- 1000 l1 lda (pntr1),y ;
- 1010 sta (pntr2),y ;
- 1020 iny ;
- 1030 bne l1 ;
- 1040 inc pntr1+1 ;
- 1050 inc pntr2+1 ;
- 1060 dex ;
- 1070 bne l1 ;
- 1080 lda #$d8 ;
- 1090 sta pntr1+1 ;
- 1100 ldx #4 ;
- 1110 l2 lda (pntr1),y ;
- 1120 sta (pntr2),y ;
- 1130 iny ;
- 1140 bne l2 ;
- 1150 inc pntr1+1 ;
- 1160 inc pntr2+1 ;
- 1170 dex ;
- 1180 bne l2 ;
- 1190 beq exit ;
- 1200 ;
- 1210 ;
- 1220 error pla ;
- 1230 clv ;
- 1240 bvc exit ;
- 1250 ;
- 1260 ;
- 1270 recall = *
- 1280 lda (pntr2),y ;
- 1290 sta (pntr1),y ;
- 1300 iny ;
- 1310 bne recall ;
- 1320 inc pntr1+1 ;
- 1330 inc pntr2+1 ;
- 1340 dex ;
- 1350 bne recall ;
- 1360 ldx #4 ;
- 1370 lda #$d8 ;
- 1380 sta pntr1+1 ;
- 1390 l3 lda (pntr2),y ;
- 1400 sta (pntr1),y ;
- 1410 iny ;
- 1420 bne l3 ;
- 1430 inc pntr1+1 ;
- 1440 inc pntr2+1 ;
- 1450 dex ;
- 1460 bne l3 ;
- 1470 ;
- 1480 exit lda memctrl ;
- 1490 ora #maskin ;
- 1500 sta memctrl ;
- 1510 ;
- 1520 pla ;
- 1530 sta pntr2+2 ;
- 1540 pla ;
- 1550 sta pntr2 ;
- 1560 pla ;
- 1570 sta pntr1+1 ;
- 1580 pla ;
- 1590 sta pntr1 ;
- 1600 plp ;
- 1610 rts ;
-