so How to design a proper memory map for an 8-bit microprocessor that would keep everything simple and neat?
I also have a hand full of questions to ask you about:
1) do I need to make ROM at the beginning of the memory space?
2) does interrupts need to be addressed to the ROM memory space?
3) which is better in organising memory, pages or arbitrary assigning of memory space?
4) if I use a GDC like the NEC uPD7220AD or intel 82720, do I need to include the memory for the GDC as addressable memory for the NSC800 even though the processor can't address it directly -or at least this is what I think-?
5)for peripherals in the minimalistic computers made by Grant Searle he uses the z80's /IORQ and /MREQ to choose the the things he whats to address and he treats them as two separate 64k banks - see:http://searle.hostei.com/grant/z80/SimpleZ80.html - is it possible to do the same with a dual function pin on the NSC800 or similarly in the intel 8085?
6) if I have certain programmable I/O in my computer, say a UART chip or a PIA or keyboard interface chip or even the GDC it self, do I need a special address for the chip or can I use RAM? if I have to use a special address for the chip how to choose it properly?
7)if an I/O chip has its own separate memory does I need to treat it as a totally independent system, thus designing its own memory map?
8)which is the best option regarding addressing, using chips or glue logic?
I work from the high bits of the address bus toward the chip select signals. For instance a '138 3-to-8 decoder divides the entire address space into 8 parts. Then one of those address spaces can be divided into 8 sections again with another '138.
1) do I need to make ROM at the beginning of the memory space?
2) does interrupts need to be addressed to the ROM memory space?
3) which is better in organising memory, pages or arbitrary assigning of memory space?
I work from the high bits of the address bus toward the chip select signals. For instance a '138 3-to-8 decoder divides the entire address space into 8 parts. Then one of those address spaces can be divided into 8 sections again with another '138.
That is how I used to do that as well. A very long time ago... Be careful though that each sub-selection adds extra delay which eats into the access time of the memory device.
How to design a proper memory map for an 8-bit microprocessor that would keep everything simple and neat?
1) do I need to make ROM at the beginning of the memory space?
2) does interrupts need to be addressed to the ROM memory space?
3) which is better in organising memory, pages or arbitrary assigning of memory space?
4) if I use a GDC like the NEC uPD7220AD or intel 82720, do I need to include the memory for the GDC as addressable memory for the NSC800 even though the processor can't address it directly -or at least this is what I think-?
5)for peripherals in the minimalistic computers made by Grant Searle he uses the z80's /IORQ and /MREQ to choose the the things he whats to address and he treats them as two separate 64k banks - see:http://searle.hostei.com/grant/z80/SimpleZ80.html - is it possible to do the same with a dual function pin on the NSC800 or similarly in the intel 8085?
6) if I have certain programmable I/O in my computer, say a UART chip or a PIA or keyboard interface chip or even the GDC it self, do I need a special address for the chip or can I use RAM? if I have to use a special address for the chip how to choose it properly?
7)if an I/O chip has its own separate memory does I need to treat it as a totally independent system, thus designing its own memory map?
8)which is the best option regarding addressing, using chips or glue logic?
1) what comes first in ROM, front end setup or back end setup? I/O setup or OS setup?
2)is it possible to create a C ROM?
3)is it possible to create a mix language ROM?
Quote1) do I need to make ROM at the beginning of the memory space?
Execution begins at 0 after reset, but various things (notably CP/M) want RAM at low memory locations. General purpose microcomputers (ie that ran CP/M) would use some sort of logic to "temporarily" change the address decoding logic at reset, so that ROM could be (normally) in high memory. (The very start of the ROM would "jp REALROMLOC" and then reset the address decode logic. Or copy itself to RAM, jump to the copied code, and reset the address decode logic.)
QuoteExecution begins at 0 after reset, but various things (notably CP/M) want RAM at low memory locations.I do not know how the CP/M systems I used handled this.
Many CPU's have 0 as a nop opcode. If ram is empty, they just execute nop's until there is a rom.
The processor needs to load code from its start address at reset so the short answer is yes. You could implement something to delay startup at power on and insert code into RAM but that would be making things needlessly complicated.
Many CPU's have 0 as a nop opcode. If ram is empty, they just execute nop's until there is a rom.
These old systems were pretty slow leaving lots time for decoding and modern implementations have memory with 25 to 50 nanosecond access times and faster logic like AS, FAST, AC, or ACT making things much easier.
Decoding with '138s can be done in parallel with some cleverness. There are other decoding options like using an EPROM but access times are slower. After the era of TTL logic, PLDs were very commonly used for this type of decoding and they are both fast and dense.
74138 3-to-8 5 to 45 nanoseconds
74139 2-to-4 5 to 45 nanoseconds
PLDs 5 to 15 nanoseconds
You will need chip select logic and the simplest way will be to divide into regions.
A quick glance at the data sheet brings back Z80 memories.
The external pins are different using the address latch most notable.
Try to wrap your head around interfacing a single static memory (any size) chip to this CPU, draw the schematic and post it.
[2c]
QuoteQuoteExecution begins at 0 after reset, but various things (notably CP/M) want RAM at low memory locations.I do not know how the CP/M systems I used handled this.It's not hard to have your ROM enable be (<ROMaddressDecode>|<resetting>) and the RAM enable be (<RAMaddressDecode>& !<resetting>) where "resetting" is a bit from a SR FlipFlop.
One example I found is here: https://k1.spdns.de/Develop/Hardware/K1-Bus%20Z80%20CPU%20board%20with%20SRAM/
Some boards may have used discreet logic to force certain instructions onto the bus at reset instead. For instance, you could simply force NOP (0) onto the bus until the address increments up to the point where there is ROM.QuoteMany CPU's have 0 as a nop opcode. If ram is empty, they just execute nop's until there is a rom.OTOH, note that RAM is not "empty"; at power-on, you should assume that its contents are random values!
I have looked up the bbc micro's memory map and I was a bit confused, because the there isn't any ROM in the first memory location that can be used to facilitate a load to RAM so how does it do it?
I have looked up the bbc micro's memory map and I was a bit confused, because the there isn't any ROM in the first memory location that can be used to facilitate a load to RAM so how does it do it?
Like the Z80 the NSC800 has a bunch of restart vectors at the lower (address) part of the memory.
Look at the data sheet (search for 'restart address' or 'vector') and you'll see vectors for (software) RST0 to RST38. The external reset/interrupt lines also have their vector addresses. /NMI at address 0x66 is the highest.
p: Designates restart vectors and may be the hex values
0, 8, 10, 18, 20, 28, 30 or 38. Restart instructions
employing the modified page zero addressing mode
use this indicator.
It is simplest if you put these into ROM. So ROM starts at address 0x0000 and goes up from there - depending on how big a chip you're using.
Lets say 16k. You'll need (the lower) 14 address bits (A0-A13) to access all bytes in that rom.
In order to make the ROM chip active at the correct time you need to check if address bits A14-A15 are zero. If they are not zero that means some other (higher) memory is being accessed and the ROM chips should not be active. This is where chips like the 74x138 come in, they make it easy to do that address decoding.
Also, the rom should only become active when the /RD signal is active (low). Usually a ROM chip has several CE inputs you can use to directly connect these signals to. Note that the S0 and S1 signals are ignored here, you do not need them.
A small complication of this processor is that it does not expose the address but as a whole. You have to latch in the lower 8 bits. So you need something like a 74x373 or 74x573 to hold onto that lower address part while the rest of the interfacing takes place.
See 9.2 (datasheet) where the signals and timing involved in op-code fetch are displayed. The Address Latch Enable is the signal that tells you you have to grab the lower 8 address bits. (the /WAIT and /REFRESH signals can be ignored - assuming you have a fast enough ROM chip - check the timings).
I do not know if you have any output logic (UART/Display?) but at this point you should be able to write a 'hello world' program, burn it into the ROM chip and run it - assuming you have an assembler or compiler that will make a binary image of the code for you, which you can then program the ROM chip with.
Hope it helps.
Like the Z80 the NSC800 has a bunch of restart vectors at the lower (address) part of the memory.
Look at the data sheet (search for 'restart address' or 'vector') and you'll see vectors for (software) RST0 to RST38. The external reset/interrupt lines also have their vector addresses. /NMI at address 0x66 is the highest.I found this in page 31:Quotep: Designates restart vectors and may be the hex values
0, 8, 10, 18, 20, 28, 30 or 38. Restart instructions
employing the modified page zero addressing mode
use this indicator.so these restart vectors and the interrupt vectors must all be contained in the initial 8K or 16K ROM page(s)...
It is simplest if you put these into ROM. So ROM starts at address 0x0000 and goes up from there - depending on how big a chip you're using.
Lets say 16k. You'll need (the lower) 14 address bits (A0-A13) to access all bytes in that rom.
In order to make the ROM chip active at the correct time you need to check if address bits A14-A15 are zero. If they are not zero that means some other (higher) memory is being accessed and the ROM chips should not be active. This is where chips like the 74x138 come in, they make it easy to do that address decoding.
Also, the rom should only become active when the /RD signal is active (low). Usually a ROM chip has several CE inputs you can use to directly connect these signals to. Note that the S0 and S1 signals are ignored here, you do not need them.
I have a couple of questions regarding this quote:
1)Is it possible to get full 64K ROM bank AND 64K RAM bank with the full I/O bank using a 74x138?
2)in my previous post I said that I was thinking of using small ROMs to address the memory, Is it possible to use the method I described to get a full 64K ROM bank AND 64K RAM bank with the full I/O bank?
for the compiler I think I can use a z80 compilers,the NSC800 has the same instruction set...
for the 'hello world' program should I put a BASIC ROM and then a basic program in ROM or should it be in RAM.
defc IO_ADDRESS = $??
org $0000
start:
ld hl, TextSource
loop:
ld a, (hl)
cp a, 0
jr z, end
out (IO_ADDRESS), a
inc hl
jr loop
end:
halt
TextSource:
defm "Hello World!", 0