VirtualBox

source: vbox/trunk/src/VBox/Disassembler/DisasmTestA.asm@ 25045

Last change on this file since 25045 was 21187, checked in by vboxsync, 15 years ago

Deal with operand size and mod default values for certain instructions (mov crx, mov drx)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
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
30BITS 32
31
32BEGINCODE
33
34align 16
35BEGINPROC TestProc
36 xor eax, eax
37 mov al, 4
38 lea edx, [4]
39 mov edx, 4
40 mov eax, 4
41 shl eax, 4
42 shl edx, 4
43 shr edx, 4
44 mov eax, edx
45 mov eax, ecx
46 mov edx, eax
47 mov ecx, eax
48 DB 0xF0, 0x0F, 0x22, 0xC0
49 DB 0xF0, 0x0F, 0x20, 0xC0
50 smsw word [edx+16]
51; invept eax, qword [ecx]
52 DB 0x66, 0x0F, 0x38, 0x80, 0x1
53; invept eax, qword [ecx]
54 DB 0x66, 0x0F, 0x38, 0x81, 0x1
55 mov eax, dword [ecx]
56 mov word [edi], 0123ah
57 movzx eax,byte [edx]
58 movzx eax,word [edx]
59; mov dword es:[ebx + 1234h], 0789h
60; mov word fs:[ebx + ecx], 0654h
61; mov byte [esi + eax*4], 0654h
62; mov bl, byte ds:[ebp + 1234h]
63; mov al, cs:[1234h + ecx*8]
64; mov al, cs:[1234h]
65; mov ax, cs:[1234h]
66; mov eax, cs:[1234h]
67 lock cmpxchg [ecx], eax
68 lock cmpxchg [ecx], ax
69 lock cmpxchg [ecx], dl
70 movzx ESI,word [EAX]
71 in al, dx
72 in ax, dx
73 in eax, dx
74 mov ebx, [ecx + eax*4 + 17]
75 mov ebx, [ebp + eax*4 + 4]
76 mov ebx, [ebp + eax*4]
77 int 80h
78 in al, 60h
79 in ax, dx
80 out 64h, eax
81
82 movss xmm0, xmm1
83 movsd xmm6, xmm1
84
85 pause
86
87ENDPROC TestProc
88
89%ifndef RT_OS_OS2
90BITS 64
91align 16
92BEGINPROC TestProc64
93 mov cr8, rax
94 mov cr8, rbx
95 mov [0xfffe0080], rax
96 mov [0xfffe0080], rbx
97 mov rax, cr8
98 mov rbx, cr8
99 mov rax, [0xfffe0080]
100 mov rbx, [0xfffe0080]
101 divsd xmm1, xmm0
102 ; invept rdi, qword [rsi]
103 DB 0x66, 0x0F, 0x38, 0x80, 0x3E
104; invept rcx, qword [rdx]
105 DB 0x66, 0x0F, 0x38, 0x80, 0xA
106 ;invvpid rdi, qword [rsi]
107 DB 0x66, 0x0F, 0x38, 0x81, 0x3E
108; invvpid rcx, qword [rdx]
109 DB 0x66, 0x0F, 0x38, 0x81, 0xA
110 mov rdi, [rsi]
111 mov rcx, [rdx]
112 db 48h
113 db 0c7h
114 db 42h
115 db 18h
116 db 20h
117 db 3eh
118 db 23h
119 db 80h
120 call qword [r8+10h]
121 ; test
122 db 48h
123 db 8bh
124 db 44h
125 db 0ah
126 db 0f8h
127 ;incorrectly assembled by yasm; REX.W should not be added!
128 ;test rax, dword 0cc90cc90h
129 db 8bh
130 db 04h
131 db 8dh
132 db 00h
133 db 00h
134 db 0feh
135 db 0ffh
136 mov qword [rcx+rdx], 0
137 mov dword [rcx+rdx], 0
138 and [r15], rax
139 movzx rcx, sil
140 and sil, 3
141 movzx ecx, ah
142 and ah, 3
143
144 sub rcx, 1234h
145 mov rax, qword [0cc90cc90h]
146 mov rax, qword [00c90cc90h]
147 mov rax, dword 0cc90cc90h
148 mov rax, qword 0ffffcc90cc90h
149
150 movzx rax,byte [edx]
151 movzx rax,word [edx]
152 movzx rax,byte [rdx]
153 lock cmpxchg [rcx], rax
154 lock cmpxchg [rcx], ax
155 lock cmpxchg [r15], dl
156 movzx RSI, word [R8]
157 in al, dx
158 in ax, dx
159 in eax, dx
160 mov rbx, [rcx + rax*4 + 17]
161 mov rbx, [rbp + rax*4 + 4]
162 mov rbx, [rbp + rax*4]
163 mov rbx, [ebp + eax*4]
164 int 80h
165 in al, 60h
166 in ax, dx
167 out 64h, eax
168
169 movss xmm0, xmm14
170 movsd xmm6, xmm1
171
172 ret
173ENDPROC TestProc64
174%endif
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