4 ms·
How is it able to access more than 640KB of memory? Am I misremembering the architecture?
by b800h 4y ago
How is it able to access more than 640KB of memory? Am I misremembering the architecture?
- rep_lodsb 4y agoBecause segment B800h is also RAM here :) It's not a PC emulator (or even x86 really, it just interprets the mnemonics you write instead of actual machine code).
- b800h 4y agoAh yes of course! You're allowing access to the whole bus width. Got it!
- mshook 4y agoYou are, on a 8086 the address width is 20 bits, hence the 1 Mo limit. https://en.wikipedia.org/wiki/X86_memory_segmentation https://en.wikipedia.org/wiki/X86_memory_segmentation
- yjdoc2 4y agoHey, the 8086 has 20 bit memory bus, so it can theoretically support full 1 MB of memory. However, as much as I know, 8086 chips never had complete 1 MB,they had at the most 256/512 KB of memory, and rest address space was used instead as memory mapped IO, or to interface with other chips. When designing this, we never intended to have support for external chips, so instead we designed this to have the full 1 MB of memory. Hope this helps!
- jart 4y agoThis is how much memory the 8086 had: 0b11111111111111110000 + 0b1111111111111111 + 1 = 0x10fff0 = 1mb+64kb-16 (for 8086)
- rep_lodsb 4y agoNope. The 8086 only had 20 physical address lines, so any address beyond FFFF:000F would wrap around to low memory. Some old Microsoft runtime library adjusted the data segment in order to place variables descending from the top offset. If the program was loaded below 64K, the segment value would become 'negative', which was not a problem until the 286 added more address lines. The main reason for the A20 gate hack was to fix this.
- peterfirefly 4y agoAddress space is not memory. (+ what the string function said: It really was 1MB.)