flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > 32-bit addressing in RM |
Author |
|
nkeck72 28 Sep 2016, 13:39
I was reading up on 32-bit addressing schemes on the OSDev wiki. and I came across this little exciting bit of info:
Quote: Note that you can still use 32-bit addressing modes in Real Mode, simply by adding the "Address Size Override Prefix" (0x67) to the beginning of any instruction. Your assembler is likely to do this for you, if you simply try to use a 32-bit addressing mode. But you are still constrained by the current "limit" for the segment that you use in each memory access (always 64K in Real Mode -- Unreal Mode can be bigger). Does this technically mean I can address more than 1MB of RAM, but can only use it in 64k segments, or am I still limited to 640k of conventional RAM, plus the HMA? [/code] _________________ It may look hard, but it won't take long if you take it one byte at a time. NOS: www.github.com/nkeck720/nos |
|||
28 Sep 2016, 13:39 |
|
nkeck72 29 Sep 2016, 21:25
So a little over a megabyte with standard settings. But the question remains, what about with the 67h prefix?
|
|||
29 Sep 2016, 21:25 |
|
revolution 29 Sep 2016, 22:22
nkeck72 wrote: But the question remains, what about with the 67h prefix? * Things like "mov dx,[ecx+eax*4]" etc. |
|||
29 Sep 2016, 22:22 |
|
nkeck72 04 Oct 2016, 01:36
Ah, gotcha. thanks.
|
|||
04 Oct 2016, 01:36 |
|
neville 22 Oct 2016, 23:12
What revo didn't mention was that setting the segment limits to 4Gigabytes in real mode makes 32-bit addressing VERY useful. Code still has to be executed in the conventional 20-bit 1M byte address space, but you have direct linear access to the entire 32-bit address space for data and/or relocatable code.
[rant]There is no magic or voodoo about this, as some people like to claim. I call it Linear Memory Mode in my FAMOS os, but it is also known as Big Real Mode or Unreal Mode. It's just a pity that it was too useful and logical for Intel or AMD to replicate it in any of the 64-bit modes. Instead, they opted to insist on Paging in Long Mode, which is even more cumbersome and tedious than Segmentation in the original Real Mode![/rant] _________________ FAMOS - the first memory operating system |
|||
22 Oct 2016, 23:12 |
|
ivan_tux 05 Nov 2016, 00:53
nkeck72 wrote: Does this technically mean I can address more than 1MB of RAM, but can only use it in 64k segments, or am I still limited to 640k of conventional RAM, plus the HMA? Maybe yes, After A20 enabled and your os still in RM; you can do this Code: mov al,[0x80000000] This will point to actual address DS * 0x10 + 0x80000000 But, for stack pointer, instruction pointer and data pointer will always grow automatically in 16-bit way. So; stosd, stosb, stosb will only increment SI and DI; not ESI and EDI. And, when IP goes to 0xFFFF, it will be back to 0x0000 |
|||
05 Nov 2016, 00:53 |
|
revolution 05 Nov 2016, 00:56
ivan_tux wrote:
|
|||
05 Nov 2016, 00:56 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.