Moll writes ... > > I'm trying to figure out just how to correlate the image of a BASIC > program in memory with the image on disk, as I remember last time I > tried this, it didn't work right because these weren't the same, or > because I had various pointers wrong and stuff... An Applesoft BASIC file on disk will begin with two bytes giving the length of the program. The rest of the bytes are the program (e.g. offset to next line, line number, BASIC tokens, ...). What DOS knows is that the program is going to load in at whatever address is at $67-$68-- by default, it's $801 (01 08 in memory at $67-$68). And, the byte just before (like at $800) needs to be set to 00. You can change the load address, say to $4001, by sticking 01 40 in at $67-$68 (and putting 00 in $4000). For instance, under DOS, ... 10 POKE 103,01: POKE 104,64: POKE 16384,0: PRINT CHR$(4);"RUN NARFGAME" is a program line that will load in NARFGAME at $4001 and RUN it. > > If anyone could give me some pointers, I would appreciate it - I want to > add LOAD/SAVE from MS-DOS support to this project. The pointers you need in order to have a LIST-able, etc. BASIC program (in case you want to move the code around) are available for jotting down after the program is LOADed at ... $67-$68 (Start of program) $69-$6A (duplicated in $6B-$6C and $6D-$6E) $AF-$B0 (End of program) Once you have the pointers for any particular load address, you can adjust them to fit any place the program may be moved. (And, the byte just before the start of the program code needs to be 00.) > (prolly also need the address of the hook for RUN in FPBASIC) > .... I'm pretty sure the RUN hook is $D566 (54630 in decimal). All of the addresses are for an Apple II or, on a PC, an Apple II as emulated via some emulator program such as AppleWin. Rubywand