tokafondo wrote:
How much memory would be enough to have it always accesible by a 6502 CPU, so it could run code there no matter what happens to the rest of the memory (like being banked in and out).
I ask this because I've read several times that from the POV of a developer, 64K of memory is a huge space to be filled with code. But maybe too little as 4K would be too little.
Is it worth looking at some historical implementations?
The early SBCs had very little RAM and even in the early 80's I was building systems with just 128 bytes of RAM and 2KB of EPROM (Industrial controllers - "Arudino" of their day, as it were) Also Atari 2600 with 128 bytes too.
The Apple II initially shipped with just 4KB of RAM - 1KB was for the video too, leaving a minimal amount (by todays standards). However by 1978 most were being shipped with 48KB of RAM and that 16KB RAM card to take it to 64KB was a reality (And it introduced bank switching too as it overlayed the existing ROM space).
In 1981, The BBC Micro shipped with just 32KB of RAM which seemed bizarre at the time. Screen RAM was variable - the highest resolution mode needed 20KB however the intention was that that would always be the Base of IO processor with a 2nd processor plugged into it to do the actual "compute" tasks. That RAM limitation didn't stop elite being written though...
So to usefully run code you need some RAM in page 0 and some in page 1 - that 128 bytes I mentioned earlier came from the RIOT (RAM, IO, Timer) chip and the 128 bytes was mirrored all over the bottom 32KB range, so you set stack pointer to $FF and it grew down, and used RAM from $00 up for zero page and hoped the 2 never met in the middle...
My Ruby 6502 project sort of mirrored the BBC Micro, although it has 64KB of RAM - OS usage, buffers, vectors, etc. is $0000 through $0DFF, "user" RAM (Program + Data) is from $0E00 through $7FFF. "Language/Application ROM" is 16KB from $8000 through $BFFF and Operating system "ROM" is 16KB minus a small window for IO from $C000 through $FFFF. (I put ROM in ""'s as it's really RAM, but pretending to be a ROM image area)
Will I ever write (BASIC) code to use all that 32KB area? Nope, but then I ran up the old Acornsoft BCPL system it sure did...
The BBC Micro "paged" ROM area from $8000 through $BFFF and as the OS was fixed in $C000 upwards, code in the OS could select any one of up to 16 ROM images to run code inside.
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/