GDT Tutorial: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
Line 167: Line 167:
<source lang="asm">
<source lang="asm">
reloadSegments:
reloadSegments:
; Reload CS register containing code selector:
JMP 0x08:reload_CS ; 0x08 points at the new code selector
.reload_CS:
; Reload data segment registers:
; Reload data segment registers:
MOV AX, 0x10 ; 0x10 points at the new data selector
MOV AX, 0x10 ; 0x10 points at the new data selector
Line 174: Line 177:
MOV GS, AX
MOV GS, AX
MOV SS, AX
MOV SS, AX
; Reload CS register containing code selector:
JMP 0x08:reload_CS ; 0x08 points at the new code selector
.reload_CS:
RET
RET
</source>
</source>