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