[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make an Applesoft Basic program Brun-able



On Thursday, July 19, 2012 5:30:50 PM UTC-7, (unknown) wrote:
> I've searched to no avail, and am wondering if anyone can tell me a nifty way or provide the code to append to an Applesoft file to make it a self-executable BINary file. I remember reading that there is a way, but after 20+ years have forgotten that magical code. The reason is that I want to make self-contained Basic files which will execute from Beautiful Boot, and other similar binary-loading programs. I know location $801 has be modified, and probably location 64 also, but how to sandwitch the machine language code together with the tokenized Applesoft code?
> 
> I'm NOT talking about an Applesoft compiler!

You could make an applesoft program Brun-able.  You would need to BSAVE it, after knowing the start address and length of program.  then you would need to append some extra code to set the start and length of the program, and then JMP (jsr?) the applesoft interpreter...

Another way you could do it is make a small 6502 program that RUNS the program from whatever DOS you are using...

in DOS, from a 6502 program, you can print chr$(4);"run file" to COUT.  DOS will intercept the command (chr$(4)), and RUN the applesoft file.

In Prodos, from a 6502 program, you can call the MLI to load a file, but you would have to set up the applesoft start and length pointers, and then JSR the Applesoft interpreter..

I've done it with DOS, http://rich12345.tripod.com/prog/asstext.html

JSR MSGOUT ; 
HEX 8D ; change this to chr$(4) 
ASC "RUN FILE" 
HEX 00 ;signals the end of what to print


I've never used Prodos MLI to RUN a program.  Any readers here done it?