Load and Run

Here is a utility program for everyone. One of the worst features of the C64 is the way the 1541 handles machine language program. It is essential that you load a ML program wit a “,8,1” suffix so that the computer knows where to locate the program in its memory. This program coverts ML programs into a BASIC load and run format. You never need to remember another SYS command (except to reactivate some routines).

HINT: Once in BASIC form you don’t need file copiers to put programs on other disks, simple LOAD it and then SAVE it.

 2 REM #############################
 3 REM # LOAD AND RUN UTILITY V1.0 #
 4 REM # CONVERTS ML PRG TO BASIC  #
 5 REM #############################
 6 :
 10 POKE53280,11:POKE53281,0:PRINTCHR$(147)
 20 PRINT"LOAD & RUN PROGRAM CONVERTER"
 25 PRINT"============================":PRINT
 100 REM LOAD AND RUN UTILITY
 110 DIMS%(7)
 120 INPUT"FILENAME:";F$ : PRINT
 130 INPUT"PRG LENGHT (BLOCKS * 254):";LE:PRINT:PL=LE*254
 135 PRINT"PRG LENGHT =";PL:PRINT
 140 INPUT"SYS ADDRESS:";SY
 150 OPEN1,8,12,F$+",P,R"
 160 GET#1,A$,B$: REM START ADDRESS
 170 S1=ASC(A$+CHR$(0)):S2=ASC(B$+CHR$(0)):SA=S1+256*S2
 180 BS=2048:PTRS=43
 200 MLS=BS+43
 210 ME=PL+MLS+1
 220 NA=SA+PL+1
 230 S%(0)=MLSAND255
 240 S%(1)=MLS/256
 250 S%(2)=MEAND255
 260 S%(3)=ME/256
 270 NI%=NA/256
 280 S%(4)=NA-256*NI%
 290 S%(5)=NI%
 300 SY%=SY/256
 310 S%(6)=SY-256*SY%
 320 S%(7)=SY%
 340 DATA 11,8,10,0,158,50,48,54,49,0
 350 DATA 0,0,169,-1,133,95,169,-1
 355 DATA 133,96,169,-1,133,90,169,-1
 360 DATA 133,91,169,-1,133,88,169,-1
 370 DATA 133,89,32,191,163,76,-1,-1
 390 OPEN2,8,11,"@0:LR."+F$+",P,W"
 400 C=0:BS=BS+1
 410 PRINT#2,CHR$(BSAND255)CHR$(BS/256);
 420 FORI=1TO42:READA:IFA=-1THENA=S%(C):C=C+1
 430 PRINT#2,CHR$(A);:NEXT
 440 FORI=0TO1:GET#1,A$: S=ST:PRINT#2,LEFT$(A$+CHR$(0),1);: I=S:NEXT
 450 CLOSE1:CLOSE2:END
This entry was posted in BASIC, Commodore, Programming, Software. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *