Babystep7: Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
mNo edit summary
m Bot: Replace deprecated source tag with syntaxhighlight
 
(2 intermediate revisions by 2 users not shown)
Line 12:
While this code is largely just a party trick, understanding it gives a gentle intro to protected mode concepts and possibly avoids some headaches later on 'cause you skipped over this kind of stuff.
 
The single descriptor in the global descriptor table at the bottom is layedlaid out to match [[Babystep6|Babystep6]]. The 'size' given is 1 MB, the base address is 0x0, and the bit fields you can work out yourself.
 
The reason for doing this is to enable 32-bit offsets in real mode. However, you won't be able to go past 1 meg quite yet.
Line 22:
Finally, note that IP is unaffected by all this, so the code itself is still limited to 64k.
 
<sourcesyntaxhighlight lang="asm">
AsmExample:
 
Line 34:
mov ds, ax ; DS=0
mov ss, ax ; stack starts at 0
mov sp, 0x9c00 ; 200h2000h past code start
 
cli ; no interrupt
Line 72:
db 0xAA
;==========================================
</syntaxhighlight>
</source>
 
==See Also==