I got confused by a simple build problem while learning simple os source code.
On this website: http://wiki.osdev.org/Babystep7, the following code is for switching from real mode to protected mode
mov eax, cr0 or al,1 mov cr0, eax
I know how to switch from real mode to protected. But my question is that the program is still in real mode, how can it use 32-bit registers or instructions?
Is it possible to use 32-bit registers / instructions in real mode?
( ), 16- . , 32- .
" " (66h), . , 16- , 32-. , , 32- , 16 . ( 67h .)
, 32- 16- . , 32- 16- .
, 64- , . " ".
, , CPU, , CPU.
, , eax, [eax].
eax
[eax]
. Intel.
: http://forum.nasm.us/index.php?topic=991.0.
, ninjalj, .
, 32- . 32- CR0 CR0 (PE). PE (mov cr0, eax). , 32- .
. 16- ( ), - Windows ( 3,1 9 ), 64 API Windows, , . , () , , 40 , 16- .
- , , 32- , 16-. 16- , , . ( , ) 32- emit, , , .
32- , . , .
Perhaps you can use LoadAll opcode 0F07h , which gives you 32-bit 16-bit real-time access.