On Thursday, December 30, 2021 at 8:58:32 PM UTC-8,
rodrigo...@gmail.com wrote:
> I was able to find a high level description that it is possible to run BASIC commands from an assembler application by adding the BLOAD FILENAME, A$MEMORY command in a buffer and calling an address memory to execute it, but the same information didn't provide any detail about how to do it. Does anyone know how to do it?
In DOS you can just output the commands prefixed by Ctrl+M Ctrl+D, assuming you haven't redirected character I/O. For example, the Scott Adams adventure games used this to load and save games from disk. See
https://6502disassembly.com/a2-scott-adams/GoldenVoyage.html#SymSaveGame (look for "dos_save_cmd"). (As examples go it's a bit convoluted... just write the characters to COUT like you would any other text.)
For ProDOS you can use a sequence of MLI commands (OPEN / READ / CLOSE). These work whether or not BASIC.System is active. See e.g. _Beneath Apple ProDOS_.