VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SelRealModeDataToFlat.asm@ 60657

Last change on this file since 60657 was 60657, checked in by vboxsync, 9 years ago

bs3kit: updates

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1; $Id: bs3-cmn-SelRealModeDataToFlat.asm 60657 2016-04-22 15:57:22Z vboxsync $
2;; @file
3; BS3Kit - Bs3SelRealModeDataToFlat.
4;
5
6;
7; Copyright (C) 2007-2016 Oracle Corporation
8;
9; This file is part of VirtualBox Open Source Edition (OSE), as
10; available from http://www.virtualbox.org. This file is free software;
11; you can redistribute it and/or modify it under the terms of the GNU
12; General Public License (GPL) as published by the Free Software
13; Foundation, in version 2 as it comes in the "COPYING" file of the
14; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17; The contents of this file may alternatively be used under the terms
18; of the Common Development and Distribution License Version 1.0
19; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20; VirtualBox OSE distribution, in which case the provisions of the
21; CDDL are applicable instead of those of the GPL.
22;
23; You may elect to license modified versions of this file under the
24; terms and conditions of either the GPL or the CDDL or both.
25;
26
27
28;*********************************************************************************************************************************
29;* Header Files *
30;*********************************************************************************************************************************
31%include "bs3kit-template-header.mac"
32
33
34;*********************************************************************************************************************************
35;* External Symbols *
36;*********************************************************************************************************************************
37TMPL_BEGIN_TEXT
38%if TMPL_BITS == 16
39CPU 8086
40%endif
41
42
43;;
44; @cproto BS3_CMN_PROTO_NOSB(uint32_t, Bs3SelRealModeDataToFlat,(uint32_t uFar1616));
45;
46; @uses Only return registers (ax:dx, eax, eax);
47; @remarks No 20h scratch area requirements.
48;
49BS3_PROC_BEGIN_CMN Bs3SelRealModeDataToFlat, BS3_PBC_NEAR ; Far stub generated by the makefile/bs3kit.h.
50 push xBP
51 mov xBP, xSP
52
53 ; Calc flat address.
54%if TMPL_BITS == 16
55 push cx
56 mov dx, [xBP + xCB + cbCurRetAddr + 2]
57 mov ax, dx
58 mov cl, 12
59 shr dx, cl
60 mov cl, 4
61 shl ax, cl
62 add ax, [xBP + xCB + cbCurRetAddr]
63 adc dx, 0
64 pop cx
65
66%elif TMPL_BITS == 32
67 movzx eax, word [xBP + xCB + cbCurRetAddr + 2]
68 shl eax, 4
69 add ax, [xBP + xCB + cbCurRetAddr]
70 jnc .return
71 add eax, 10000h
72
73%elif TMPL_BITS == 64
74 mov eax, ecx
75 shr eax, 16
76 shl eax, 4
77 add ax, cx
78 jnc .return
79 add eax, 10000h
80
81%else
82 %error "TMPL_BITS!"
83%endif
84
85.return:
86 pop xBP
87 BS3_HYBRID_RET
88BS3_PROC_END_CMN Bs3SelRealModeDataToFlat
89
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette