home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_16_1987_Transactor_Publishing.d64
/
ramdisk64.pal
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
3KB
|
146 lines
100 sys700
110 .opt oo
120 ;
130 *=$9ee8
140 ;
150 chrget =$0073
160 ciaint =$dc0d
170 bankin =$01
180 tempzero =$fd52
190 tempbloc =$fd57
200 tempreg =$fd59
210 sov =$fd5a
220 basicvec =$0308
230 border =$d020
240 ;
250 ;*** change basic vector
260 lda basicvec
270 sta tempvec ;move to end of program
280 lda basicvec+1
290 sta tempvec+1
300 lda #<ram
310 sta basicvec
320 lda #>ram
330 sta basicvec+1
340 rts
350 ;
360 ;*** main routine starts here
370 ram ldy #$01
380 lda ($7a),y ; look ahead of basic
390 cmp #"&" ; check for character
400 beq r2
410 jmp lode
420 r2 jsr chrget ; start of save
430 sec
440 lda 46
450 sbc 44
460 cmp #93 ; check size
470 bcc r3
480 dec border ; warn too large
490 jmp exit
500 r3 jsr zersa
510 sec
520 lda $2d
530 sta sov
540 sbc $2b
550 sta tempbloc ;get number blks low
560 lda $2e
570 sta sov+1
580 sbc $2c
590 sta tempbloc+1 ;number blks high
600 sec
610 lda #$00
620 sbc tempbloc ; subtract blks
630 sta $fd
640 sta strdisk ; start address in ram disk
650 lda #$fd
660 sbc tempbloc+1
670 sta $fe
680 sta strdisk+1
690 lda $2b
700 sta $fb
710 lda $2c
720 sta $fc
730 ldy #$00
740 start lda ($fb),y ; source
750 sta ($fd),y ; destination
760 inc $fb
770 bne s2
780 inc $fc
790 s2 inc $fd
800 bne s3
810 inc $fe
820 s3 lda $fb
830 cmp sov
840 bne start
850 lda $fc
860 cmp sov+1 ;keep (NULL)ing to the sov
870 bne start
880 jsr zerlo
890 jmp exit
900 lode cmp #"\" ;check for character
910 bne exit
920 jsr chrget ;start of load
930 jsr zersa
940 lda strdisk ;start address in ram disk
950 sta $fb ;store in source
960 lda strdisk+1
970 sta $fc
980 lda $2b ;start of basic (low)
990 sta $fd ;destination (low)
1000 lda $2c ;basic (high)
1010 sta $fe ; destination (high)
1020 ldy #$00
1030 stld lda ($fb),y ;source
1040 sta ($fd),y ; target
1050 inc $fb
1060 bne l2
1070 inc $fc
1080 l2 inc $fd
1090 bne l3
1100 inc $fe
1110 l3 lda $fb
1120 cmp #$00
1130 bne stld
1140 lda $fc
1150 cmp #$fd
1160 bne stld
1170 lda $7b ;check for running prgrm
1180 cmp #$02
1190 bne prgm
1200 lda $fd ;direct mode then set sov
1210 sta $2d
1220 lda $fe ; sov
1230 sta 46
1240 jsr zerlo
1250 exit jmp (tempvec)
1260 prgm jsr zerlo
1270 jsr $e1a1 ;basic load routine
1280 jmp $a7ae ;back to interpreter
1290 zersa lda bankin ;switch out roms
1300 sta tempreg
1310 lda #$7f
1320 sta ciaint ;kill interupts
1330 lda #$00
1340 sta bankin
1350 ldx #$04
1360 zs1 lda $fb,x ;move to a safe spot
1370 sta tempzero,x
1380 dex
1390 bne zs1
1400 rts
1410 zerlo ldx #$04
1420 zl1 lda tempzero,x ; put back
1430 sta $fb,x
1440 dex
1450 bne zl1
1460 lda tempreg ;switch roms on
1470 sta bankin
1480 lda #$81 ;start interupts
1490 sta ciaint
1500 rts
1510 ;************ program variables
1520 strdisk .byte 0,0 ;start address in disk memory
1530 tempvec .byte 0,0 ;points to interpreter loop
1540 ;