1 | ; $Id: tstAsmLock-2.asm 8971 2008-05-20 18:22:41Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; Disassembly testcase - Invalid invariants.
|
---|
4 | ;
|
---|
5 | ; The intention is to check in a binary using the --all-invalid mode
|
---|
6 | ; of tstDisasm-2.
|
---|
7 | ;
|
---|
8 |
|
---|
9 | ;
|
---|
10 | ; Copyright (C) 2008 Sun Microsystems, Inc.
|
---|
11 | ;
|
---|
12 | ; This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
13 | ; available from http://www.virtualbox.org. This file is free software;
|
---|
14 | ; you can redistribute it and/or modify it under the terms of the GNU
|
---|
15 | ; General Public License (GPL) as published by the Free Software
|
---|
16 | ; Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
17 | ; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
18 | ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
19 | ;
|
---|
20 | ; Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
21 | ; Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
22 | ; additional information or have any questions.
|
---|
23 | ;
|
---|
24 |
|
---|
25 | %include "tstAsm.mac"
|
---|
26 | %if TEST_BITS == 64
|
---|
27 | ; The disassembler doesn't do imm32 right for 64-bit stuff, so disable it for now.
|
---|
28 | ; %define WITH_64_BIT_TESTS_IMM32
|
---|
29 | %define WITH_64_BIT_TESTS
|
---|
30 | %endif
|
---|
31 |
|
---|
32 | BITS TEST_BITS
|
---|
33 |
|
---|
34 | ;
|
---|
35 | ; ADC
|
---|
36 | ;
|
---|
37 | ; 14 ib ADC AL, imm8
|
---|
38 | lock adc al, byte 8
|
---|
39 | ; 15 i[wd] ADC [ER]AX, immX
|
---|
40 | lock adc ax, word 16
|
---|
41 | lock adc eax, dword 128
|
---|
42 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
43 | lock adc rax, dword 256
|
---|
44 | lock adc rax, dword 0cc90cc90h
|
---|
45 | %endif
|
---|
46 | ; 80 /2 ib ADC reg/mem8, imm8 - with reg dst
|
---|
47 | lock adc cl, byte 8
|
---|
48 | ; 81 /2 i[wd] ADC reg/memX, immX - with reg dst
|
---|
49 | lock adc cx, word 1000h
|
---|
50 | lock adc ecx, dword 100000h
|
---|
51 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
52 | lock adc rcx, dword 100000h
|
---|
53 | %endif
|
---|
54 | ; 83 /2 ib ADC reg/memX, imm8 - with reg dst
|
---|
55 | lock adc cx, byte 07fh
|
---|
56 | lock adc ecx, byte 07fh
|
---|
57 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
58 | lock adc rcx, byte 07fh
|
---|
59 | %endif
|
---|
60 |
|
---|
61 | ; 10 /r ADC reg/mem8, reg8 - with reg dst
|
---|
62 | lock adc cl, bl
|
---|
63 | ; 11 /r ADC reg/memX, regX - with reg dst
|
---|
64 | lock adc cx, bx
|
---|
65 | lock adc ecx, ebx
|
---|
66 | %ifdef WITH_64_BIT_TESTS
|
---|
67 | lock adc rcx, rbx
|
---|
68 | %endif
|
---|
69 | ; 12 /r ADC reg8, reg/mem8
|
---|
70 | lock adc cl, [0badh]
|
---|
71 | ; 13 /r ADC regX, reg/memX
|
---|
72 | lock adc cx, [0badh]
|
---|
73 | lock adc ecx, [0badh]
|
---|
74 | %ifdef WITH_64_BIT_TESTS
|
---|
75 | lock adc rcx, [0badh]
|
---|
76 | %endif
|
---|
77 |
|
---|
78 | ;
|
---|
79 | ; ADD
|
---|
80 | ;
|
---|
81 | ; 04 ib ADD AL, imm8
|
---|
82 | lock add al, byte 8
|
---|
83 | ; 05 i[wd] ADD [ER]AX, immX
|
---|
84 | lock add ax, word 16
|
---|
85 | lock add eax, dword 128
|
---|
86 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
87 | lock add rax, dword 256
|
---|
88 | lock add rax, dword 0cc90cc90h
|
---|
89 | %endif
|
---|
90 | ; 80 /0 ib ADD reg/mem8, imm8 - with reg dst
|
---|
91 | lock add cl, byte 8
|
---|
92 | ; 81 /0 i[wd] ADD reg/memX, immX - with reg dst
|
---|
93 | lock add cx, word 1000h
|
---|
94 | lock add ecx, dword 100000h
|
---|
95 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
96 | lock add rcx, dword 100000h
|
---|
97 | %endif
|
---|
98 | ; 83 /0 ib ADD reg/memX, imm8 - with reg dst
|
---|
99 | lock add cx, byte 07fh
|
---|
100 | lock add ecx, byte 07fh
|
---|
101 | %ifdef WITH_64_BIT_TESTS
|
---|
102 | lock add rcx, byte 07fh
|
---|
103 | %endif
|
---|
104 |
|
---|
105 | ; 00 /r ADD reg/mem8, reg8 - with reg dst
|
---|
106 | lock add cl, bl
|
---|
107 | ; 01 /r ADD reg/memX, regX - with reg dst
|
---|
108 | lock add cx, bx
|
---|
109 | lock add ecx, ebx
|
---|
110 | %ifdef WITH_64_BIT_TESTS
|
---|
111 | lock add rcx, rbx
|
---|
112 | %endif
|
---|
113 | ; 02 /r ADD reg8, reg/mem8
|
---|
114 | lock add cl, [0badh]
|
---|
115 | ; 03 /r ADD regX, reg/memX
|
---|
116 | lock add cx, [0badh]
|
---|
117 | lock add ecx, [0badh]
|
---|
118 | %ifdef WITH_64_BIT_TESTS
|
---|
119 | lock add rcx, [0badh]
|
---|
120 | %endif
|
---|
121 |
|
---|
122 | ;
|
---|
123 | ; AND
|
---|
124 | ;
|
---|
125 | ; 24 ib AND AL, imm8
|
---|
126 | lock and al, byte 8
|
---|
127 | ; 25 i[wd] AND [ER]AX, immX
|
---|
128 | lock and ax, word 16
|
---|
129 | lock and eax, dword 128
|
---|
130 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
131 | lock and rax, dword 256
|
---|
132 | lock and rax, dword 0cc90cc90h
|
---|
133 | %endif
|
---|
134 | ; 80 /4 ib AND reg/mem8, imm8 - with reg dst
|
---|
135 | lock and cl, byte 8
|
---|
136 | ; 81 /4 i[wd] AND reg/memX, immX - with reg dst
|
---|
137 | lock and cx, word 1000h
|
---|
138 | lock and ecx, dword 100000h
|
---|
139 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
140 | lock and rcx, dword 100000h
|
---|
141 | %endif
|
---|
142 | ; 83 /4 ib AND reg/memX, imm8 - with reg dst
|
---|
143 | lock and cx, byte 07fh
|
---|
144 | lock and ecx, byte 07fh
|
---|
145 | %ifdef WITH_64_BIT_TESTS
|
---|
146 | lock and rcx, byte 07fh
|
---|
147 | %endif
|
---|
148 |
|
---|
149 | ; 20 /r AND reg/mem8, reg8 - with reg dst
|
---|
150 | lock and cl, bl
|
---|
151 | ; 21 /r AND reg/memX, regX - with reg dst
|
---|
152 | lock and cx, bx
|
---|
153 | lock and ecx, ebx
|
---|
154 | %ifdef WITH_64_BIT_TESTS
|
---|
155 | lock and rcx, rbx
|
---|
156 | %endif
|
---|
157 | ; 22 /r AND reg8, reg/mem8
|
---|
158 | lock and cl, [0badh]
|
---|
159 | ; 23 /r AND regX, reg/memX
|
---|
160 | lock and cx, [0badh]
|
---|
161 | lock and ecx, [0badh]
|
---|
162 | %ifdef WITH_64_BIT_TESTS
|
---|
163 | lock and rcx, [0badh]
|
---|
164 | %endif
|
---|
165 |
|
---|
166 | ;
|
---|
167 | ; BTC
|
---|
168 | ;
|
---|
169 | ; 0f bb /r BTC reg/memX, regX (X != 8) - with reg dst
|
---|
170 | lock btc cx, bx
|
---|
171 | lock btc ecx, ebx
|
---|
172 | %ifdef WITH_64_BIT_TESTS
|
---|
173 | lock btc rcx, rbx
|
---|
174 | lock btc r8, rbx
|
---|
175 | lock btc r10, r8
|
---|
176 | %endif
|
---|
177 | ; 0f ba /7 ib BTC reg/memX, imm8 (X != 8) - with reg dst
|
---|
178 | lock btc cx, 15
|
---|
179 | lock btc ecx, 30
|
---|
180 | %ifdef WITH_64_BIT_TESTS
|
---|
181 | lock btc rcx, 60
|
---|
182 | lock btc r8, 61
|
---|
183 | lock btc r10, 3
|
---|
184 | %endif
|
---|
185 |
|
---|
186 | ;
|
---|
187 | ; BTR
|
---|
188 | ;
|
---|
189 | ; 0f b3 /r BTR reg/memX, regX (X != 8) - with reg dst
|
---|
190 | lock btr cx, bx
|
---|
191 | lock btr ecx, ebx
|
---|
192 | %ifdef WITH_64_BIT_TESTS
|
---|
193 | lock btr rcx, rbx
|
---|
194 | lock btr r8, rbx
|
---|
195 | lock btr r10, r8
|
---|
196 | %endif
|
---|
197 | ; 0f ba /6 ib BTR reg/memX, imm8 (X != 8) - with reg dst
|
---|
198 | lock btr cx, 15
|
---|
199 | lock btr ecx, 30
|
---|
200 | %ifdef WITH_64_BIT_TESTS
|
---|
201 | lock btr rcx, 60
|
---|
202 | lock btr r8, 61
|
---|
203 | lock btr r10, 3
|
---|
204 | %endif
|
---|
205 |
|
---|
206 | ;
|
---|
207 | ; BTS
|
---|
208 | ;
|
---|
209 | ; 0f ab /r BTS reg/memX, regX (X != 8) - with reg dst
|
---|
210 | lock bts cx, bx
|
---|
211 | lock bts ecx, ebx
|
---|
212 | %ifdef WITH_64_BIT_TESTS
|
---|
213 | lock bts rcx, rbx
|
---|
214 | lock bts r8, rbx
|
---|
215 | lock bts r10, r8
|
---|
216 | %endif
|
---|
217 | ; 0f ba /5 ib BTS reg/memX, imm8 (X != 8) - with reg dst
|
---|
218 | lock bts cx, 15
|
---|
219 | lock bts ecx, 30
|
---|
220 | %ifdef WITH_64_BIT_TESTS
|
---|
221 | lock bts rcx, 60
|
---|
222 | lock bts r8, 61
|
---|
223 | lock bts r10, 3
|
---|
224 | %endif
|
---|
225 |
|
---|
226 | ; CMPXCHG
|
---|
227 | ; CMPXCHG8B
|
---|
228 | ; CMPXCHG16B
|
---|
229 | ; DEC
|
---|
230 | ; INC
|
---|
231 | ; NEG
|
---|
232 | ; NOT
|
---|
233 | ; OR
|
---|
234 | ; SBB
|
---|
235 | ; SUB
|
---|
236 | ; XADD
|
---|
237 | ; XCHG
|
---|
238 | ; XOR
|
---|
239 |
|
---|
240 |
|
---|