home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
commodore-users-of-norman
/
CUON_18_(11-1984).d64
/
autoboot
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
1KB
|
47 lines
10 REM AUTOBOOT FROM COMPUTE 9/84 PG 130
20 REM ENTERED FOR CUON LIBRARY BY SAM BARRETT
100 PRINT"[147] AUTOBOOT ":T=18:S=1:D$="0":OPEN15,8,15,"I"+D$
110 OPEN 2,8,2,"#"+"0"
120 REM **** LOCATE TARGET
130 INPUT"FILENAME";NA$:LN=LEN(NA$)
140 GOSUB210:GOSUB300
150 IFT=0THENPRINTNA$" NOT FOUND":GOTO540
160 GOTO140
170 GOTO540
180 REM***POINT TO BYTE AND GET IT INTO X.
190 PRINT#15,"B-P:"2,L:GET#2,A$:IFA$=""THENA$=CHR$(0)
200 X=ASC(A$):RETURN
210 PRINT"TRACK"T" SECTOR"S
220 PRINT#15,"U1:"2;D$;T;S
230 L=0:GOSUB180:T=X:L=1:GOSUB180:S=X:RETURN
240 REM *** CHECK FOR FULL MATCH
250 FORJ=ITOI+LN:L=J:GOSUB180:IFX=0ORX=160THEN270
260 X$=X$+CHR$(X):NEXTJ
270 IFX$<>NA$THENX$="":RETURN
280 L=I-2:GOSUB180:TT=X:L=I-1:GOSUB180:SS=X:PRINT
290 GOTO340
300 REM *** CHECK THROUGH ONE BLOCK FOR NAME MATCH
310 FORI=5TO230STEP32
320 L=I:GOSUB180:IFCHR$(X)=LEFT$(NA$,1)THENGOSUB240
330 NEXTI:RETURN
340 REM *** ACCESS 1ST SECTOR OF TARGET PROGRAM
350 T=TT:S=SS:GOSUB210
360 L=2:GOSUB180:AL=X:L=3:GOSUB180:AH=X:SA=AL+AH*256
370 IFSA<>256THENPRINT:PRINTNA$" IS NOT PREPARED FOR AUTOBOOT":GOTO540
380 REM *** ESTABLISH FALSE STACK
400 PRINT#15,"U1:"2;DR;TT;SS:PRINT
410 FORPB=173TO254STEP2:PRINT#15,"B-P:"2;PB
420 PRINT#2,CHR$(96);
430 PRINT#15,"B-P:"2;PB+1
440 PRINT#2,CHR$(3);:PRINT"*";:NEXT:PRINT
450 PRINT#15,"U2:"2;DR;TT;SS
460 GOSUB210:PRINT
470 REM ***PUT AUTOBOOT CODE ONTO PAGE 3
481 DATA165,175,133,46,165,174,133,45,32,89,166,32
491 DATA 142,166,76,174,167
500 PRINT#15,"U1:"2;DR;T;S
510 FORPB=105TO121:READBY:PRINT#15,"B-P:"2;PB
520 PRINT#2,CHR$(BY);:PRINT". ";:NEXT:PRINT:PRINTNA$" CAN NOW BOOT ITSELF"
530 PRINT#15,"U2:"2;DR;T;S
540 CLOSE2:CLOSE15