]>
Commit | Line | Data |
---|---|---|
762e073a LG |
1 | ;------------------------------------------------------------------------------\r |
2 | ;*\r | |
3 | ;* Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r | |
4 | ;* This program and the accompanying materials\r | |
5 | ;* are licensed and made available under the terms and conditions of the BSD License\r | |
6 | ;* which accompanies this distribution. The full text of the license may be found at\r | |
7 | ;* http://opensource.org/licenses/bsd-license.php\r | |
8 | ;*\r | |
9 | ;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | ;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | ;*\r | |
12 | ;* CpuAsm.nasm\r | |
13 | ;*\r | |
14 | ;* Abstract:\r | |
15 | ;*\r | |
16 | ;------------------------------------------------------------------------------\r | |
17 | \r | |
18 | SECTION .text\r | |
19 | \r | |
20 | ;------------------------------------------------------------------------------\r | |
21 | ; VOID\r | |
22 | ; SetCodeSelector (\r | |
23 | ; UINT16 Selector\r | |
24 | ; );\r | |
25 | ;------------------------------------------------------------------------------\r | |
26 | global ASM_PFX(SetCodeSelector)\r | |
27 | ASM_PFX(SetCodeSelector):\r | |
28 | mov ecx, [esp+4]\r | |
29 | sub esp, 0x10\r | |
30 | lea eax, [setCodeSelectorLongJump]\r | |
31 | mov [esp], eax\r | |
32 | mov [esp+4], cx\r | |
33 | jmp dword far [esp]\r | |
34 | setCodeSelectorLongJump:\r | |
35 | add esp, 0x10\r | |
36 | ret\r | |
37 | \r | |
38 | ;------------------------------------------------------------------------------\r | |
39 | ; VOID\r | |
40 | ; SetDataSelectors (\r | |
41 | ; UINT16 Selector\r | |
42 | ; );\r | |
43 | ;------------------------------------------------------------------------------\r | |
44 | global ASM_PFX(SetDataSelectors)\r | |
45 | ASM_PFX(SetDataSelectors):\r | |
46 | mov ecx, [esp+4]\r | |
47 | o16 mov ss, cx\r | |
48 | o16 mov ds, cx\r | |
49 | o16 mov es, cx\r | |
50 | o16 mov fs, cx\r | |
51 | o16 mov gs, cx\r | |
52 | ret\r | |
53 | \r |