cjs wrote:
Yes, I strictly avoid $00 and $01 due to the 6510 thing. For larger programs I've been reserving $00-$15 for "BIOS" stuff and starting my stuff at $16, but in this case I was thinking about small routines (such as an I/O driver) that you might want to share amongst multiple applications and might need 2-4 bytes of easy-to-access storage.
Sad to hear that BBC went the other direction from Apple. (Not that there are a lot of addresses free on an Apple II if you want to work with the monitor, Integer and Applesoft BASIC, DOS and ProDOS.) I guess in the end one needs to settle on specific addresses on a platform-by-platform basis, if one wants to fix them to run with multiple applications.
Acorn who made the BBC Micro already had "prior art" with the Acorn System 1 (1979) and Atom (1980) computers, so already had their own base to build on. The Apple II really was a bit all over the place... The monitor, sweet16 and Integer Basic went together fairly well, but then Applesoft - derived from MS Basic upset the cart somewhat (can't use sweet16 with Applesoft as it overwrites a lot of zero page and that's before you worry about switching the language card off.. (or on)
The Acorn approach is quite sensible, but it came after all the MS Basics (Apple, OSI, PET), so while they had a lot to look at and possibly base their own thing on, the also had the benefit of a fresh start and their setup worked over all BBC Micros - Beeb, Beeb64K, Master, Electron, Master compact (and whatever else)
Zero page $00 through $9F is for the current application (e.g. BASIC, or a word processor, spreadsheet, or other programming language, etc. which normally lives in $8000 through $BFFF) with $90 through $FF being reserved for the operating system. (BASIC itself reserves $80 through $8F for user programs which is handy because BASIC has a built in assembler)
The OS also claims RAM from $200 through $DFF , however $400 through $7FF are reserved for the current application (e.g. BASIC, wordprocessor, etc.). $800 through $DFF are reserved for buffers for various bits of the OS - sound and video processing, cassette tape buffers, keyboard, function key expansions, user-definable fonts and some other uses.
Utility ROMs can extend the value of PAGE (which starts at $E00) for private workspace - so e.g. a filing system ROM can reserve some private space for buffers and so on - typically the value of PAGE would be $1900 in a system using the Advanced Disk Filing System. So BASIC, on entry, would read the value of PAGE from the OS then use that as the start of program data. The upper value being the bottom of screen memory which started at $7FFF and grew downwards.
So I think that starting fresh put them in a good position to make the system expandable and usable by many programming languages, filing systems, and so on - as long as you stuck to the rules - stick a 2nd processor onto it and (if it's a 6502!) everything gets invisibly copied over and PAGE starts low ($200 IIRC) and the top of memory is way up there - $8000 or even higher if a "Hi BASIC" version is used.
These days - it's easy to start again, and we end up with XKCD 927
https://xkcd.com/927/ or just be prepared to be flexible....
Cheers,
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/