1 | ; $Id: bs3-cpu-basic-2-template.mac 60088 2016-03-18 00:07:33Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; BS3Kit - bs3-cpu-basic-2 assembly template.
|
---|
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 | %include "bs3kit-template-header.mac" ; setup environment
|
---|
29 |
|
---|
30 |
|
---|
31 | %undef Bs3Printf
|
---|
32 | BS3_EXTERN_CMN Bs3Printf
|
---|
33 |
|
---|
34 |
|
---|
35 | BS3_PROC_BEGIN_MODE bs3CpuBasic2_iret
|
---|
36 | BS3_CALL_CONV_PROLOG 1
|
---|
37 | push xBP
|
---|
38 | mov xBP, xSP
|
---|
39 | sub xSP, 20h
|
---|
40 |
|
---|
41 | %if TMPL_BITS == 64
|
---|
42 | %if TMPL_BITS == 16
|
---|
43 | xor ax, ax
|
---|
44 | mov al, [xBP + xCB*2]
|
---|
45 | push ax
|
---|
46 | push cs
|
---|
47 | push .szMsg wrt BS3TEXT16
|
---|
48 | call Bs3Printf
|
---|
49 | add sp, 6
|
---|
50 | %else
|
---|
51 | movzx xDX, byte [xBP + xCB*2]
|
---|
52 | push xDX
|
---|
53 | push .szMsg wrt FLAT
|
---|
54 | BS3_CALL Bs3Printf, 2
|
---|
55 | add xSP, xCB * 2
|
---|
56 | %endif
|
---|
57 | %endif
|
---|
58 |
|
---|
59 | ; Return
|
---|
60 | xor al, al
|
---|
61 | ;mov al, TMPL_MODE ; remove me
|
---|
62 |
|
---|
63 |
|
---|
64 | mov xSP, xBP
|
---|
65 | pop xBP
|
---|
66 | BS3_CALL_CONV_EPILOG 1
|
---|
67 | ret
|
---|
68 | .szMsg: db 'hello world %#x!', 13, 10, 0
|
---|
69 |
|
---|
70 | BS3_PROC_END_MODE bs3CpuBasic2_iret
|
---|
71 |
|
---|
72 |
|
---|
73 |
|
---|
74 | BS3_PROC_BEGIN_MODE bs3CpuBasic2_TssGateEsp_IntXx
|
---|
75 | int 80h
|
---|
76 | nop
|
---|
77 | BS3_PROC_END_MODE bs3CpuBasic2_TssGateEsp_IntXx
|
---|
78 |
|
---|
79 |
|
---|
80 |
|
---|
81 |
|
---|
82 |
|
---|
83 | %include "bs3kit-template-footer.mac" ; reset environment
|
---|
84 |
|
---|