VirtualBox

source: vbox/trunk/src/VBox/Disassembler/testcase/tstDisasm-1A.asm@ 46712

Last change on this file since 46712 was 44528, checked in by vboxsync, 12 years ago

header (C) fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.4 KB
Line 
1; $Id: tstDisasm-1A.asm 44528 2013-02-04 14:27:54Z vboxsync $
2;; @file
3; VBox disassembler: Assembler test routines
4;
5
6;
7; Copyright (C) 2006-2012 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
18;*******************************************************************************
19;* Header Files *
20;*******************************************************************************
21%include "iprt/asmdefs.mac"
22;%include "VBox/vmm/vm.mac"
23;%include "VBox/err.mac"
24;%include "VBox/vmm/stam.mac"
25;%include "iprt/x86.mac"
26
27BITS 32
28
29
30BEGINCODE
31
32align 16
33BEGINPROC TestProc32
34 xor eax, eax
35 mov al, 4
36 lea edx, [4]
37 mov edx, 4
38 mov eax, 4
39 shl eax, 4
40 shl edx, 4
41 shr edx, 4
42 mov eax, edx
43 mov eax, ecx
44 mov edx, eax
45 mov ecx, eax
46 DB 0xF0, 0x0F, 0x22, 0xC0
47 DB 0xF0, 0x0F, 0x20, 0xC0
48 smsw word [edx+16]
49 ; invept eax, qword [ecx]
50 DB 0x66, 0x0F, 0x38, 0x80, 0x1
51 ; invept eax, qword [ecx]
52 DB 0x66, 0x0F, 0x38, 0x81, 0x1
53 mov eax, dword [ecx]
54 mov word [edi], 0123ah
55 movzx eax,byte [edx]
56 movzx eax,word [edx]
57 mov dword [es:ebx + 1234h], 0789h
58 mov word [fs:ebx + ecx], 0654h
59 mov byte [esi + eax*4], 054h
60 mov bl, byte [ds:ebp + 1234h]
61 mov al, [cs:1234h + ecx*8]
62 mov al, [cs:1234h]
63 mov ax, [cs:1234h]
64 mov eax, [cs:1234h]
65 lock cmpxchg [ecx], eax
66 lock cmpxchg [ecx], ax
67 lock cmpxchg [ecx], dl
68 movzx ESI,word [EAX]
69 in al, dx
70 in ax, dx
71 in eax, dx
72 mov ebx, [ecx + eax*4 + 17]
73 mov ebx, [ebp + eax*4 + 4]
74 mov ebx, [ebp + eax*4]
75 int 80h
76 in al, 60h
77 in ax, dx
78 out 64h, eax
79
80 movss xmm0, xmm1
81 movss xmm3, [eax]
82 movss [eax], xmm4
83 movsd xmm6, xmm1
84
85 pause
86 nop
87
88 ; 3Dnow!
89 pavgusb mm1, mm0
90 pf2id mm5, mm4
91 pf2iw mm6, mm3
92 pfacc mm7, mm2
93 pfadd mm5, mm4
94 pfcmpeq mm6, mm3
95 pfcmpge mm2, mm7
96 pfcmpgt mm4, mm5
97 pfmax mm3, mm6
98 pfmin mm1, mm0
99 pfmul mm5, mm4
100 pmulhrwa mm3, mm6
101 pfnacc mm4, mm5
102 pfpnacc mm3, mm6
103 pfrcp mm0, mm1
104 pfrcpit1 mm2, mm7
105 pfrcpit2 mm4, mm5
106 pfrsqrt mm7, mm2
107 pfrsqit1 mm1, mm0
108 pfsub mm6, mm3
109 pfsubr mm0, mm1
110 pi2fd mm7, mm2
111 pi2fw mm0, mm1
112 pswapd mm2, mm7
113
114 pavgusb mm1, qword [es:eax+000000010h]
115 pf2id mm5, qword [ds:esi+000101010h]
116 pf2iw mm6, qword [fs:esi+000101010h]
117 pfacc mm7, qword [gs:esi+000101010h]
118 pfadd mm5, qword [ esi+000101010h]
119 pfcmpeq mm6, qword [ edi*8+000101010h]
120 pfcmpge mm2, qword [es:esi+000100010h]
121 pfcmpgt mm4, qword [es:esi+000101010h]
122 pfmax mm3, qword [es:esi+000101010h]
123 pfmin mm1, qword [es:esi+000101010h]
124 pfmul mm5, qword [es:esi+000101000h]
125 pmulhrwa mm3, qword [es:eax+0ffffffffh]
126 pfnacc mm4, qword [es:ebx+000101010h]
127 pfpnacc mm3, qword [es:edx+000102900h]
128 pfrcp mm0, qword [es:ecx+000101020h]
129 pfrcpit1 mm2, qword [es:ebp+000101510h]
130 pfrcpit2 mm4, qword [es:esp+000101310h]
131 pfrsqrt mm7, qword [es:esi+0f0106010h]
132 pfrsqit1 mm1, qword [es:edi+0001f1010h]
133 pfsub mm6, qword [es:esi*2]
134 pfsubr mm0, qword [es:esi*3]
135 pi2fd mm7, qword [es:esi*4]
136 pi2fw mm0, qword [es:esi*5]
137 pswapd mm2, qword [es:esi*8]
138
139 pmulhrwa mm0, qword [ds:ebp+edi*8+00f000001h]
140
141 ; MMX
142 psubusb mm1, mm3
143 cvtpi2pd xmm0, mm3
144 paddd mm1, mm3
145 paddd xmm1, xmm3
146ENDPROC TestProc32
147
148
149%ifndef RT_OS_OS2
150BITS 64
151align 16
152BEGINPROC TestProc64
153 mov cr8, rax
154 mov cr8, rbx
155 mov [0xfffe0080], rax
156 mov [0xfffe0080], rbx
157 mov rax, cr8
158 mov rbx, cr8
159 mov rax, [0xfffe0080]
160 mov rbx, [0xfffe0080]
161 divsd xmm1, xmm0
162 ; invept rdi, qword [rsi]
163 DB 0x66, 0x0F, 0x38, 0x80, 0x3E
164 ; invept rcx, qword [rdx]
165 DB 0x66, 0x0F, 0x38, 0x80, 0xA
166 ;invvpid rdi, qword [rsi]
167 DB 0x66, 0x0F, 0x38, 0x81, 0x3E
168 ; invvpid rcx, qword [rdx]
169 DB 0x66, 0x0F, 0x38, 0x81, 0xA
170 mov rdi, [rsi]
171 mov rcx, [rdx]
172 db 48h
173 db 0c7h
174 db 42h
175 db 18h
176 db 20h
177 db 3eh
178 db 23h
179 db 80h
180 call qword [r8+10h]
181 ; test
182 db 48h
183 db 8bh
184 db 44h
185 db 0ah
186 db 0f8h
187 ;incorrectly assembled by yasm; REX.W should not be added!
188 ;test rax, dword 0cc90cc90h
189 db 8bh
190 db 04h
191 db 8dh
192 db 00h
193 db 00h
194 db 0feh
195 db 0ffh
196 mov qword [rcx+rdx], 0
197 mov dword [rcx+rdx], 0
198 and [r15], rax
199 movzx rcx, sil
200 and sil, 3
201 movzx ecx, ah
202 and ah, 3
203
204 sub rcx, 1234h
205 mov rax, qword [0cc90cc90h]
206 mov rax, qword [00c90cc90h]
207 mov rax, dword 0cc90cc90h
208 mov rax, qword 0ffffcc90cc90h
209
210 movzx rax,byte [edx]
211 movzx rax,word [edx]
212 movzx rax,byte [rdx]
213 lock cmpxchg [rcx], rax
214 lock cmpxchg [rcx], ax
215 lock cmpxchg [r15], dl
216 movzx RSI, word [R8]
217 in al, dx
218 in ax, dx
219 in eax, dx
220 mov rbx, [rcx + rax*4 + 17]
221 mov rbx, [rbp + rax*4 + 4]
222 mov rbx, [rbp + rax*4]
223 mov rbx, [ebp + eax*4]
224 int 80h
225 in al, 60h
226 in ax, dx
227 out 64h, eax
228
229 movss xmm0, xmm14
230 movsd xmm6, xmm1
231
232 ret
233ENDPROC TestProc64
234%endif ; !OS2
235
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