2016-06-14 09:43:44 +02:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
;*
|
|
|
|
;* Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
|
2019-04-04 01:07:22 +02:00
|
|
|
;* SPDX-License-Identifier: BSD-2-Clause-Patent
|
2016-06-14 09:43:44 +02:00
|
|
|
;*
|
|
|
|
;* CpuAsm.nasm
|
|
|
|
;*
|
|
|
|
;* Abstract:
|
|
|
|
;*
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
DEFAULT REL
|
|
|
|
SECTION .text
|
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
; VOID
|
|
|
|
; SetCodeSelector (
|
|
|
|
; UINT16 Selector
|
|
|
|
; );
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
global ASM_PFX(SetCodeSelector)
|
|
|
|
ASM_PFX(SetCodeSelector):
|
2021-01-07 04:10:45 +01:00
|
|
|
push rcx
|
2016-06-14 09:43:44 +02:00
|
|
|
lea rax, [setCodeSelectorLongJump]
|
2021-01-07 04:10:45 +01:00
|
|
|
push rax
|
|
|
|
o64 retf
|
2016-06-14 09:43:44 +02:00
|
|
|
setCodeSelectorLongJump:
|
|
|
|
ret
|
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
; VOID
|
|
|
|
; SetDataSelectors (
|
|
|
|
; UINT16 Selector
|
|
|
|
; );
|
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
global ASM_PFX(SetDataSelectors)
|
|
|
|
ASM_PFX(SetDataSelectors):
|
|
|
|
o16 mov ss, cx
|
|
|
|
o16 mov ds, cx
|
|
|
|
o16 mov es, cx
|
|
|
|
o16 mov fs, cx
|
|
|
|
o16 mov gs, cx
|
|
|
|
ret
|
|
|
|
|