1 | ; $Id: DisasmTestA.asm 41719 2012-06-14 18:15:56Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; VBox disassembler: Assembler test routines
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2006-2010 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 |
|
---|
27 | BITS 32
|
---|
28 |
|
---|
29 |
|
---|
30 | BEGINCODE
|
---|
31 |
|
---|
32 | align 16
|
---|
33 | BEGINPROC 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 | ENDPROC TestProc32
|
---|
88 |
|
---|
89 |
|
---|
90 | %ifndef RT_OS_OS2
|
---|
91 | BITS 64
|
---|
92 | align 16
|
---|
93 | BEGINPROC TestProc64
|
---|
94 | mov cr8, rax
|
---|
95 | mov cr8, rbx
|
---|
96 | mov [0xfffe0080], rax
|
---|
97 | mov [0xfffe0080], rbx
|
---|
98 | mov rax, cr8
|
---|
99 | mov rbx, cr8
|
---|
100 | mov rax, [0xfffe0080]
|
---|
101 | mov rbx, [0xfffe0080]
|
---|
102 | divsd xmm1, xmm0
|
---|
103 | ; invept rdi, qword [rsi]
|
---|
104 | DB 0x66, 0x0F, 0x38, 0x80, 0x3E
|
---|
105 | ; invept rcx, qword [rdx]
|
---|
106 | DB 0x66, 0x0F, 0x38, 0x80, 0xA
|
---|
107 | ;invvpid rdi, qword [rsi]
|
---|
108 | DB 0x66, 0x0F, 0x38, 0x81, 0x3E
|
---|
109 | ; invvpid rcx, qword [rdx]
|
---|
110 | DB 0x66, 0x0F, 0x38, 0x81, 0xA
|
---|
111 | mov rdi, [rsi]
|
---|
112 | mov rcx, [rdx]
|
---|
113 | db 48h
|
---|
114 | db 0c7h
|
---|
115 | db 42h
|
---|
116 | db 18h
|
---|
117 | db 20h
|
---|
118 | db 3eh
|
---|
119 | db 23h
|
---|
120 | db 80h
|
---|
121 | call qword [r8+10h]
|
---|
122 | ; test
|
---|
123 | db 48h
|
---|
124 | db 8bh
|
---|
125 | db 44h
|
---|
126 | db 0ah
|
---|
127 | db 0f8h
|
---|
128 | ;incorrectly assembled by yasm; REX.W should not be added!
|
---|
129 | ;test rax, dword 0cc90cc90h
|
---|
130 | db 8bh
|
---|
131 | db 04h
|
---|
132 | db 8dh
|
---|
133 | db 00h
|
---|
134 | db 00h
|
---|
135 | db 0feh
|
---|
136 | db 0ffh
|
---|
137 | mov qword [rcx+rdx], 0
|
---|
138 | mov dword [rcx+rdx], 0
|
---|
139 | and [r15], rax
|
---|
140 | movzx rcx, sil
|
---|
141 | and sil, 3
|
---|
142 | movzx ecx, ah
|
---|
143 | and ah, 3
|
---|
144 |
|
---|
145 | sub rcx, 1234h
|
---|
146 | mov rax, qword [0cc90cc90h]
|
---|
147 | mov rax, qword [00c90cc90h]
|
---|
148 | mov rax, dword 0cc90cc90h
|
---|
149 | mov rax, qword 0ffffcc90cc90h
|
---|
150 |
|
---|
151 | movzx rax,byte [edx]
|
---|
152 | movzx rax,word [edx]
|
---|
153 | movzx rax,byte [rdx]
|
---|
154 | lock cmpxchg [rcx], rax
|
---|
155 | lock cmpxchg [rcx], ax
|
---|
156 | lock cmpxchg [r15], dl
|
---|
157 | movzx RSI, word [R8]
|
---|
158 | in al, dx
|
---|
159 | in ax, dx
|
---|
160 | in eax, dx
|
---|
161 | mov rbx, [rcx + rax*4 + 17]
|
---|
162 | mov rbx, [rbp + rax*4 + 4]
|
---|
163 | mov rbx, [rbp + rax*4]
|
---|
164 | mov rbx, [ebp + eax*4]
|
---|
165 | int 80h
|
---|
166 | in al, 60h
|
---|
167 | in ax, dx
|
---|
168 | out 64h, eax
|
---|
169 |
|
---|
170 | movss xmm0, xmm14
|
---|
171 | movsd xmm6, xmm1
|
---|
172 |
|
---|
173 | ret
|
---|
174 | ENDPROC TestProc64
|
---|
175 | %endif ; !OS2
|
---|
176 |
|
---|