Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- init_prot:
- ; Since this moment all data segment registers
- ; point to the same data segment in GDT:0x10
- mov ax, GDT_DS_PROT
- mov es, ax
- mov fs, ax
- mov gs, ax
- mov ds, ax
- mov ss, ax
- ; Get 16 bit return address from real mode stack and zero extend it
- ; to 32-bit and place in EAX
- movzx eax, word [esp]
- ; Set up the protected mode stack
- mov esp, STACK_SEGMENT_PROT_MODE
- mov ebp, esp
- ; Push 32-bit return address in EAX onto stack.
- push eax
- xor eax, eax
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement