Is there a conventional name for accessing e.g. memories with fewer address bits than required, using range a selector?
-
Let's assume you have a 1 MByte memory, divided into 8 equal sized sectors. Then your address (or register) range occupies 1048576 addresses (or registers). Instead, you could have a state variable that occupies 1 register that selects the current sector. Then you only need 1 + 262144 registers to access the entire memory (of course, it's more inefficient because every once in a while you need an extra write in order to switch sector). My question is, does this technique have a conventional name?
-
Let's assume you have a 1 MByte memory, divided into 8 equal sized sectors. Then your address (or register) range occupies 1048576 addresses (or registers). Instead, you could have a state variable that occupies 1 register that selects the current sector. Then you only need 1 + 262144 registers to access the entire memory (of course, it's more inefficient because every once in a while you need an extra write in order to switch sector). My question is, does this technique have a conventional name?
Memory management, often specifically called bank switching: Memory management unit - Wikipedia[^] I used to use it in a Z80 clone called the HD64180 which included a MMU to expand the 16 bit address space of the Z80 processor (i.e 64Kbyte) to 1Meg by dividing the processor address space into three banks and assigning them to different areas in the 1MB space. So your ROM was in Bank0, say, and that where the core software was (interrupts, threading, bank control, important stuff you needed all the time), Bank1 was your "user code", and Bank2 was your RAM - and you swapped the banks in and out as needed. Took a bit of work to get it straight in your head (it wasn't the most obvious implementation or an MMU) but it worked pretty well in practice as long as you paid attention.
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
Let's assume you have a 1 MByte memory, divided into 8 equal sized sectors. Then your address (or register) range occupies 1048576 addresses (or registers). Instead, you could have a state variable that occupies 1 register that selects the current sector. Then you only need 1 + 262144 registers to access the entire memory (of course, it's more inefficient because every once in a while you need an extra write in order to switch sector). My question is, does this technique have a conventional name?
Memory paging most often used in Virtual Memory systems.
In vino veritas
-
Memory management, often specifically called bank switching: Memory management unit - Wikipedia[^] I used to use it in a Z80 clone called the HD64180 which included a MMU to expand the 16 bit address space of the Z80 processor (i.e 64Kbyte) to 1Meg by dividing the processor address space into three banks and assigning them to different areas in the 1MB space. So your ROM was in Bank0, say, and that where the core software was (interrupts, threading, bank control, important stuff you needed all the time), Bank1 was your "user code", and Bank2 was your RAM - and you swapped the banks in and out as needed. Took a bit of work to get it straight in your head (it wasn't the most obvious implementation or an MMU) but it worked pretty well in practice as long as you paid attention.
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
Yup, The C=ommodore Plus 4 and C=16/116 also used Bank switching to get the full 16 bit address space accessible for BASIC while keeping the OS in the ROM(s). I've heard the C=64 already had the same technology in hardware, but Basic 2 didn't support it. Therefore only the memory area unused for the OS was available for BASIC programs.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
-
Let's assume you have a 1 MByte memory, divided into 8 equal sized sectors. Then your address (or register) range occupies 1048576 addresses (or registers). Instead, you could have a state variable that occupies 1 register that selects the current sector. Then you only need 1 + 262144 registers to access the entire memory (of course, it's more inefficient because every once in a while you need an extra write in order to switch sector). My question is, does this technique have a conventional name?
What if I was to turn that sector selector into a uint32_t so that I can move the "window" freely (even across sector boundaries), does this have a different name? The reason I ask is that I want to name my registers appropriately. Today they are named SLIDING_WINDOW_BUFFER_position, SLIDING_WINDOW_BUFFER_start and SLIDING_WINDOW_BUFFER_endExcl but I have a feeling this is called something else.
-
What if I was to turn that sector selector into a uint32_t so that I can move the "window" freely (even across sector boundaries), does this have a different name? The reason I ask is that I want to name my registers appropriately. Today they are named SLIDING_WINDOW_BUFFER_position, SLIDING_WINDOW_BUFFER_start and SLIDING_WINDOW_BUFFER_endExcl but I have a feeling this is called something else.
This is starting to sound like the ancient x86 segmented memory. 20 bit addresses (1MB) were made up of a 16 bit segment (shifted left 4) added to a 16 bit offset. The 8086 for example had 4 segment registers IIRC, CS (code), DS (data), SS (stack) and ES (extra). Cheers, Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
-
What if I was to turn that sector selector into a uint32_t so that I can move the "window" freely (even across sector boundaries), does this have a different name? The reason I ask is that I want to name my registers appropriately. Today they are named SLIDING_WINDOW_BUFFER_position, SLIDING_WINDOW_BUFFER_start and SLIDING_WINDOW_BUFFER_endExcl but I have a feeling this is called something else.
From what I can work out you are still building a Virtual Memory system what you are calling the sector selector is the page index and the memory window size itself is the page size. Memory segmentation - Wikipedia[^]
Quote:
Segmentation with paging Instead of an actual memory location the segment information includes the address of a page table for the segment.
If that is the case you are building a page table for a Virtual Memory Implementation Page table - Wikipedia[^] The Virtual space can be bigger, 1:1 or smaller than the real memory space. Even on Flash Memory we still call them pages and a group of pages become a block. That also holds for the old superVGA (VESA) standard where you have blocks being made up of pages of a set granularity Although in both those cases we do call the selector a "bank selector" or a "block selector" as opposed to a "page index" Sliding Window tends to be used as a term on transmission protocols Realistically we understand what you are doing and it's only a name.
In vino veritas