BigEd wrote:
Ha ha - 10k is much more than I was thinking of! Maybe a couple of hundred bytes, surely less than 2k, and with the hope that there's some slack in the original 16k to condense down and cram everything in.
(Of course, Acorn's originals did have 16k Basic, 16k OS, and optionally 16k filesystem, so 10k isn't bad for a fully-featured system. But I'm thinking of just serial I/O.)
You need a couple of OSBYTES to let BASIC know the RAM size... Then read/write character (OSRDCH, OSWRCH) and OSWORD 0 - Read a line of text (with optional editing).
That'll get you going - until you hit a syntax error then you need a BRK handler that will indirect to the handler that BASIC supplies, or want to ESCape (same as Ctrl-C in other systems) from an infinite loop...
That will get you a long way... but after that, I found I just wanted more... so a 100Hz timer so that TIME worked, more access to the filing system, VDU support and so on...
For those unaware, Acorn separated the "Language" from the Operating System, so the OS provided everything a language (Basic, Forth, Comal, etc.) might need to run which enabled other languages to be quickly implemented - it also left a full 16KB for the language without it having to worry about including code for trivial stuff like reading a character, line, or opening a file, redefining a character, playing sounds and so on.
There was no machine code monitor as such, just the operating system.
Cheers,
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/