1 | ;
|
---|
2 | ; VBox disassembler:
|
---|
3 | ; Assembler test routines
|
---|
4 |
|
---|
5 | ;
|
---|
6 | ; Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
7 | ;
|
---|
8 | ; This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | ; available from http://www.virtualbox.org. This file is free software;
|
---|
10 | ; you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | ; General Public License (GPL) as published by the Free Software
|
---|
12 | ; Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | ; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | ;
|
---|
16 | ; Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
17 | ; Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
18 | ; additional information or have any questions.
|
---|
19 | ;
|
---|
20 |
|
---|
21 | ;*******************************************************************************
|
---|
22 | ;* Header Files *
|
---|
23 | ;*******************************************************************************
|
---|
24 | %include "VBox/nasm.mac"
|
---|
25 | %include "VBox/vm.mac"
|
---|
26 | %include "VBox/err.mac"
|
---|
27 | %include "VBox/stam.mac"
|
---|
28 | %include "VBox/x86.mac"
|
---|
29 |
|
---|
30 | BITS 32
|
---|
31 |
|
---|
32 | BEGINCODE
|
---|
33 |
|
---|
34 | align 16
|
---|
35 | BEGINPROC TestProc
|
---|
36 | mov word [edi], 0123ah
|
---|
37 | movzx eax,byte [edx]
|
---|
38 | movzx eax,word [edx]
|
---|
39 | ; mov dword es:[ebx + 1234h], 0789h
|
---|
40 | ; mov word fs:[ebx + ecx], 0654h
|
---|
41 | ; mov byte [esi + eax*4], 0654h
|
---|
42 | ; mov bl, byte ds:[ebp + 1234h]
|
---|
43 | ; mov al, cs:[1234h + ecx*8]
|
---|
44 | ; mov al, cs:[1234h]
|
---|
45 | ; mov ax, cs:[1234h]
|
---|
46 | ; mov eax, cs:[1234h]
|
---|
47 | lock cmpxchg [ecx], eax
|
---|
48 | lock cmpxchg [ecx], ax
|
---|
49 | lock cmpxchg [ecx], dl
|
---|
50 | movzx ESI,word [EAX]
|
---|
51 | in al, dx
|
---|
52 | in ax, dx
|
---|
53 | in eax, dx
|
---|
54 | mov ebx, [ecx + eax*4 + 17]
|
---|
55 | mov ebx, [ebp + eax*4 + 4]
|
---|
56 | mov ebx, [ebp + eax*4]
|
---|
57 | int 80h
|
---|
58 | in al, 60h
|
---|
59 | in ax, dx
|
---|
60 | out 64h, eax
|
---|
61 |
|
---|
62 | movss xmm0, xmm1
|
---|
63 | movsd xmm6, xmm1
|
---|
64 |
|
---|
65 | pause
|
---|
66 |
|
---|
67 | ENDPROC TestProc
|
---|
68 |
|
---|
69 | %ifndef RT_OS_OS2
|
---|
70 | BITS 64
|
---|
71 | align 16
|
---|
72 | BEGINPROC TestProc64
|
---|
73 | ;incorrectly assembled by yasm; REX.W should not be added!
|
---|
74 | ;test rax, dword 0cc90cc90h
|
---|
75 | mov rax, dword 0cc90cc90h
|
---|
76 | mov rax, qword 0ffffcc90cc90h
|
---|
77 |
|
---|
78 | movzx rax,byte [edx]
|
---|
79 | movzx rax,word [edx]
|
---|
80 | movzx rax,byte [rdx]
|
---|
81 | lock cmpxchg [rcx], rax
|
---|
82 | lock cmpxchg [rcx], ax
|
---|
83 | lock cmpxchg [r15], dl
|
---|
84 | movzx RSI, word [R8]
|
---|
85 | in al, dx
|
---|
86 | in ax, dx
|
---|
87 | in eax, dx
|
---|
88 | mov rbx, [rcx + rax*4 + 17]
|
---|
89 | mov rbx, [rbp + rax*4 + 4]
|
---|
90 | mov rbx, [rbp + rax*4]
|
---|
91 | mov rbx, [ebp + eax*4]
|
---|
92 | int 80h
|
---|
93 | in al, 60h
|
---|
94 | in ax, dx
|
---|
95 | out 64h, eax
|
---|
96 |
|
---|
97 | movss xmm0, xmm14
|
---|
98 | movsd xmm6, xmm1
|
---|
99 |
|
---|
100 | ret
|
---|
101 | ENDPROC TestProc64
|
---|
102 | %endif |
---|