ret\r
AsmExchangeRole ENDP\r
\r
-AsmInitializeGdt PROC near C PUBLIC\r
- push ebp\r
- mov ebp, esp\r
- pushad\r
- mov edi, [ebp + 8] ; Load GDT register\r
-\r
- mov ax,cs ; Get the selector data from our code image\r
- mov es,ax\r
- lgdt FWORD PTR es:[edi] ; and update the GDTR\r
-\r
- push PROTECT_MODE_CS\r
- lea eax, SetCodeSelectorFarJump\r
- push eax\r
- retf\r
-SetCodeSelectorFarJump:\r
- mov ax, PROTECT_MODE_DS ; Update the Base for the new selectors, too\r
- mov ds, ax\r
- mov es, ax\r
- mov fs, ax\r
- mov gs, ax\r
- mov ss, ax\r
-\r
- popad\r
- pop ebp\r
- ret\r
-AsmInitializeGdt ENDP\r
-\r
END\r