;------------------------------------------------------------------------------\r
InternalX86DisablePaging64 PROC\r
cli\r
- shl rcx, 32 ; rcx[32..47] <- Cs\r
- lea eax, @F\r
+ lea r10, @F\r
mov esi, r8d\r
- or rcx, rax ; rcx[0..47] <- Cs:@F\r
mov edi, r9d\r
mov eax, [rsp + 28h] ; eax <- New Stack\r
- push rcx\r
- retf ; switch to compatibility mode\r
+ push rcx ; push Cs to stack\r
+ push r10\r
+ DB 48h ; prefix to composite "retq" with next "retf"\r
+ retf ; Use far return to load CS register from stack\r
@@:\r
mov esp, eax ; set up new stack\r
mov rax, cr0\r