AgonConsole8 / agon-mos

Official AGON QUARK Firmware for Console8: eZ80 MOS
MIT License
31 stars 10 forks source link

Enhanced *EXEC #18

Open stevesims opened 1 year ago

stevesims commented 1 year ago

Back in the mists of time, it was possible on a BBC Micro to *EXEC a text file in BASIC to load in that file. This was essentially the only way to implement libraries on the Beeb.

Our current *EXEC implementation doesn't support this mode of operation, as it passes file contents directly to the MOS command line interpreter.

We should consider whether it's possible to change the implementation of *EXEC so that it is compatible with BASIC, and potentially other language CLIs too.

One possibility is that instead of passing file contents directly to MOS it instead interprets the file contents as effectively key presses. This needs some more thought and investigation.

stevesims commented 1 month ago

*exec on Acorn systems essentially works by effectively sending the contents of a file to the keyboard buffer, and then allowing that to be processed.

our MOS doesn't currently have a keyboard buffer. we may wish/need to add one

stevesims commented 3 weeks ago

there may be a way to do this without adding in a keyboard buffer

if the line editor API had an associated input file handle, then that could be used as a source for input. exec could then be a matter of opening up a file, and setting that as the current input source for the line editor. once the line editor has reached the end of this file it would close it

this may be related to #80 and #81