;------------------------------------------------------------------------------\r
InternalX86DisablePaging64 PROC\r
cli\r
- shl rcx, 32\r
+ shl rcx, 32 ; rcx[32..47] <- Cs\r
lea eax, @F\r
- mov ecx, eax\r
- push rcx\r
- mov ebx, edx\r
mov esi, r8d\r
+ or rcx, rax ; rcx[0..47] <- Cs:@F\r
mov edi, r9d\r
- mov eax, [rsp + 28h]\r
- retf\r
+ mov eax, [rsp + 28h] ; eax <- New Stack\r
+ push rcx\r
+ retf ; switch to compatibility mode\r
@@:\r
mov esp, eax ; set up new stack\r
mov rax, cr0\r
mov rax, cr4\r
and al, NOT (1 SHL 5) ; clear PAE\r
mov cr4, rax\r
- push rdi\r
- push rsi\r
- call rbx\r
- jmp $\r
+ push rdi ; push Context2\r
+ push rsi ; push Context1\r
+ call rdx ; transfer control to EntryPoint\r
+ hlt ; no one should get here\r
InternalX86DisablePaging64 ENDP\r
\r
END\r