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