VirtualBox

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

Last change on this file since 14751 was 13241, checked in by vboxsync, 16 years ago

Added support for three byte opcodes (not complete; just to test invept & invvpid)

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