Home | History | Annotate | Download | only in Ia32
      1       TITLE   CpuAsm.asm:
      2 ;------------------------------------------------------------------------------
      3 ;*
      4 ;*   Copyright (c) 2006 - 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     .686
     20     .model  flat,C
     21     .code
     22 
     23 ;------------------------------------------------------------------------------
     24 ; VOID
     25 ; SetCodeSelector (
     26 ;   UINT16 Selector
     27 ;   );
     28 ;------------------------------------------------------------------------------
     29 SetCodeSelector PROC PUBLIC
     30     mov     ecx, [esp+4]
     31     sub     esp, 0x10
     32     lea     eax, setCodeSelectorLongJump
     33     mov     [esp], eax
     34     mov     [esp+4], cx
     35     jmp     fword ptr [esp]
     36 setCodeSelectorLongJump:
     37     add     esp, 0x10
     38     ret
     39 SetCodeSelector ENDP
     40 
     41 ;------------------------------------------------------------------------------
     42 ; VOID
     43 ; SetDataSelectors (
     44 ;   UINT16 Selector
     45 ;   );
     46 ;------------------------------------------------------------------------------
     47 SetDataSelectors PROC PUBLIC
     48     mov     ecx, [esp+4]
     49     mov     ss, cx
     50     mov     ds, cx
     51     mov     es, cx
     52     mov     fs, cx
     53     mov     gs, cx
     54     ret
     55 SetDataSelectors ENDP
     56 
     57 
     58 END
     59