Skylie33 wrote:
Yes, I do agree that it'd be more complicated to not waste address space, hence why I'm open to using GALs.
You'd likely need multiple GALs to generate all the needed chip selects, which circuit may end up with obdurate timing issues. Even then, the logic density in a GAL is significantly limited compared to even a small CPLD and you may find yourself wishing for more resources.
In any case, virtually all 6502-based systems end up "wasting" address space simply because to do otherwise can result in extremely complex glue logic, with little gain achieved.
Quote:
...thanks to BigDumbDinosaur for the helpful schematic. It's really helped me understand how to use a different memory map in the 64K than the rest of the address space.
You're welcome.
Note that by replacing
U6b with a 74ACT11030 and inverting the latter's output, you will have the capability to distinguish between bank $00 and the remaining 255 banks. However, the logic required to select individual SRAMs in excess of 512 KB becomes convoluted. Realistically, it is not practical in discrete logic if performance at all matters, which is why I limited that design to 512KB, which is available in a single SRAM.
If you are going to go with more than 512KB it's time to get a CPLD involved. Not only will you need room for the chip select logic, you will need many more output pins to select SRAMs (one chip select per 512KB of RAM).
BigEd wrote:
Commonly, I would expect Bank 0 to contain all of the ROM, and also the I/O, although it needn't.
What Ed is saying is in a practical system code has to exist at the upper end of bank $00 so the '816 has somewhere to go at reset. Your decision to make 12KB available at $00D000 takes care of that requirement. However, consider that ROM is quite a bit slower than SRAM, so you might want to consider running your operating system out of write-protected RAM so you can avoid wait-states.
Also as noted by Ed, I/O could be anywhere, but if not in bank $00, it will be interrupting what would otherwise be contiguous RAM above $00FFFF. That's not necessarily an impediment if your operating system kernel is running in the same bank, as it would be able to access I/O with conventional 16-bit addresses, which is faster than 24-bit addressing. For example, you could place I/O and all of the kernel except the front end of the interrupt service routines (ISR) in bank $01. In bank $00, your ISRs could do a long jump into the kernel in bank $01, at an expense of four Ø2 cycles.
Don't forget that bank $00 is the only bank in which direct page and stack accesses can occur. Also, the
JMP (<addr>) instruction looks in bank $00 for
<addr> (on the other hand,
JMP (<addr>,X) and
JSR (<addr>,X) look for
<addr> in whatever bank is in
PB).