1 | ; $Id: tstAsmLock-1.asm 106061 2024-09-16 14:03:52Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; Disassembly testcase - Valid lock sequences and related instructions.
|
---|
4 | ;
|
---|
5 | ; This is a build test, that means it will be assembled, disassembled,
|
---|
6 | ; then the disassembly output will be assembled and the new binary will
|
---|
7 | ; compared with the original.
|
---|
8 | ;
|
---|
9 |
|
---|
10 | ;
|
---|
11 | ; Copyright (C) 2008-2024 Oracle and/or its affiliates.
|
---|
12 | ;
|
---|
13 | ; This file is part of VirtualBox base platform packages, as
|
---|
14 | ; available from https://www.virtualbox.org.
|
---|
15 | ;
|
---|
16 | ; This program is free software; you can redistribute it and/or
|
---|
17 | ; modify it under the terms of the GNU General Public License
|
---|
18 | ; as published by the Free Software Foundation, in version 3 of the
|
---|
19 | ; License.
|
---|
20 | ;
|
---|
21 | ; This program is distributed in the hope that it will be useful, but
|
---|
22 | ; WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
23 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
24 | ; General Public License for more details.
|
---|
25 | ;
|
---|
26 | ; You should have received a copy of the GNU General Public License
|
---|
27 | ; along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
28 | ;
|
---|
29 | ; SPDX-License-Identifier: GPL-3.0-only
|
---|
30 | ;
|
---|
31 |
|
---|
32 | %include "tstAsm.mac"
|
---|
33 | %if TEST_BITS == 64
|
---|
34 |
|
---|
35 | ; The disassembler doesn't do imm32 right for 64-bit stuff, so disable it for now.
|
---|
36 | ; %define WITH_64_BIT_TESTS_IMM32
|
---|
37 |
|
---|
38 | ; The cmpxchg16b/8b stuff isn't handled correctly in 64-bit mode. In the 8b case
|
---|
39 | ; it could be both yasm and the vbox disassembler. Have to check docs/gas/nasm.
|
---|
40 | ; %define WITH_64_BIT_TESTS_CMPXCHG16B
|
---|
41 |
|
---|
42 | ; Seems there are some issues with the byte, word and dword variants of r8-15.
|
---|
43 | ; Again, this could be yasm issues too...
|
---|
44 | ; %define WITH_64_BIT_TESTS_BORKED_REGS
|
---|
45 |
|
---|
46 | %define WITH_64_BIT_TESTS
|
---|
47 | %endif
|
---|
48 |
|
---|
49 | BITS TEST_BITS
|
---|
50 |
|
---|
51 | ;
|
---|
52 | ; ADC
|
---|
53 | ;
|
---|
54 | ; 80 /2 ib ADC reg/mem8, imm8 - sans reg dst
|
---|
55 | lock adc byte [1000h], byte 8
|
---|
56 | lock adc byte [xBX], byte 8
|
---|
57 | lock adc byte [xDI], byte 8
|
---|
58 | ; 81 /2 i[wd] ADC reg/memX, immX - sans reg dst
|
---|
59 | lock adc word [1000h], word 090cch
|
---|
60 | lock adc word [xBX], word 090cch
|
---|
61 | lock adc word [xDI], word 090cch
|
---|
62 | lock adc dword [1000h], dword 0cc90cc90h
|
---|
63 | lock adc dword [xBX], dword 0cc90cc90h
|
---|
64 | lock adc dword [xDI], dword 0cc90cc90h
|
---|
65 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
66 | lock adc qword [1000h], dword 0cc90cc90h
|
---|
67 | lock adc qword [rbx], dword 0cc90cc90h
|
---|
68 | lock adc qword [rdi], dword 0cc90cc90h
|
---|
69 | lock adc qword [r9], dword 0cc90cc90h
|
---|
70 | %endif
|
---|
71 | ; 83 /2 ib ADC reg/memX, imm8 - sans reg dst
|
---|
72 | lock adc word [1000h], byte 07fh
|
---|
73 | lock adc word [xBX], byte 07fh
|
---|
74 | lock adc word [xDI], byte 07fh
|
---|
75 | lock adc dword [1000h], byte 07fh
|
---|
76 | lock adc dword [xBX], byte 07fh
|
---|
77 | lock adc dword [xDI], byte 07fh
|
---|
78 | %ifdef WITH_64_BIT_TESTS
|
---|
79 | lock adc qword [1000h], byte 07fh
|
---|
80 | lock adc qword [rbx], byte 07fh
|
---|
81 | lock adc qword [rdi], byte 07fh
|
---|
82 | lock adc qword [r10], byte 07fh
|
---|
83 | %endif
|
---|
84 |
|
---|
85 | ; 10 /r ADC reg/mem8, reg8 - sans reg dst
|
---|
86 | lock adc byte [1000h], bl
|
---|
87 | lock adc byte [xBX], bl
|
---|
88 | lock adc byte [xSI], bl
|
---|
89 | ; 11 /r ADC reg/memX, regX - sans reg dst
|
---|
90 | lock adc word [1000h], bx
|
---|
91 | lock adc word [xBX], bx
|
---|
92 | lock adc word [xSI], bx
|
---|
93 | lock adc dword [1000h], ebx
|
---|
94 | lock adc dword [xBX], ebx
|
---|
95 | lock adc dword [xSI], ebx
|
---|
96 | %ifdef WITH_64_BIT_TESTS
|
---|
97 | lock adc qword [1000h], rbx
|
---|
98 | lock adc qword [rbx], rbx
|
---|
99 | lock adc qword [rsi], rbx
|
---|
100 | lock adc qword [r11], rbx
|
---|
101 | %endif
|
---|
102 |
|
---|
103 | ;
|
---|
104 | ; ADD
|
---|
105 | ;
|
---|
106 | ; 80 /0 ib ADD reg/mem8, imm8 - sans reg dst
|
---|
107 | lock add byte [1000h], byte 8
|
---|
108 | lock add byte [xBX], byte 8
|
---|
109 | lock add byte [xDI], byte 8
|
---|
110 | ; 81 /0 i[wd] ADD reg/memX, immX - sans reg dst
|
---|
111 | lock add word [1000h], word 090cch
|
---|
112 | lock add word [xBX], word 090cch
|
---|
113 | lock add word [xDI], word 090cch
|
---|
114 | lock add dword [1000h], dword 0cc90cc90h
|
---|
115 | lock add dword [xBX], dword 0cc90cc90h
|
---|
116 | lock add dword [xDI], dword 0cc90cc90h
|
---|
117 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
118 | lock add qword [1000h], dword 0cc90cc90h
|
---|
119 | lock add qword [rbx], dword 0cc90cc90h
|
---|
120 | lock add qword [rdi], dword 0cc90cc90h
|
---|
121 | lock add qword [r9], dword 0cc90cc90h
|
---|
122 | %endif
|
---|
123 | ; 83 /0 ib ADD reg/memX, imm8 - sans reg dst
|
---|
124 | lock add word [1000h], byte 07fh
|
---|
125 | lock add word [xBX], byte 07fh
|
---|
126 | lock add word [xDI], byte 07fh
|
---|
127 | lock add dword [1000h], byte 07fh
|
---|
128 | lock add dword [xBX], byte 07fh
|
---|
129 | lock add dword [xDI], byte 07fh
|
---|
130 | %ifdef WITH_64_BIT_TESTS
|
---|
131 | lock add qword [1000h], byte 07fh
|
---|
132 | lock add qword [rbx], byte 07fh
|
---|
133 | lock add qword [rdi], byte 07fh
|
---|
134 | lock add qword [r10], byte 07fh
|
---|
135 | %endif
|
---|
136 |
|
---|
137 | ; 00 /r ADD reg/mem8, reg8 - sans reg dst
|
---|
138 | lock add byte [1000h], bl
|
---|
139 | lock add byte [xBX], bl
|
---|
140 | lock add byte [xSI], bl
|
---|
141 | ; 01 /r ADD reg/memX, regX - sans reg dst
|
---|
142 | lock add word [1000h], bx
|
---|
143 | lock add word [xBX], bx
|
---|
144 | lock add word [xSI], bx
|
---|
145 | lock add dword [1000h], ebx
|
---|
146 | lock add dword [xBX], ebx
|
---|
147 | lock add dword [xSI], ebx
|
---|
148 | %ifdef WITH_64_BIT_TESTS
|
---|
149 | lock add qword [1000h], rbx
|
---|
150 | lock add qword [rbx], rbx
|
---|
151 | lock add qword [rsi], rbx
|
---|
152 | lock add qword [r11], rbx
|
---|
153 | %endif
|
---|
154 |
|
---|
155 | ;
|
---|
156 | ; AND
|
---|
157 | ;
|
---|
158 | ; 80 /4 ib AND reg/mem8, imm8 - sans reg dst
|
---|
159 | lock and byte [1000h], byte 8
|
---|
160 | lock and byte [xBX], byte 8
|
---|
161 | lock and byte [xDI], byte 8
|
---|
162 | ; 81 /4 i[wd] AND reg/memX, immX - sans reg dst
|
---|
163 | lock and word [1000h], word 090cch
|
---|
164 | lock and word [xBX], word 090cch
|
---|
165 | lock and word [xDI], word 090cch
|
---|
166 | lock and dword [1000h], dword 0cc90cc90h
|
---|
167 | lock and dword [xBX], dword 0cc90cc90h
|
---|
168 | lock and dword [xDI], dword 0cc90cc90h
|
---|
169 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
170 | lock and qword [1000h], dword 0cc90cc90h
|
---|
171 | lock and qword [rbx], dword 0cc90cc90h
|
---|
172 | lock and qword [rdi], dword 0cc90cc90h
|
---|
173 | lock and qword [r9], dword 0cc90cc90h
|
---|
174 | %endif
|
---|
175 | ; 83 /4 ib AND reg/memX, imm8 - sans reg dst
|
---|
176 | lock and word [1000h], byte 07fh
|
---|
177 | lock and word [xBX], byte 07fh
|
---|
178 | lock and word [xDI], byte 07fh
|
---|
179 | lock and dword [1000h], byte 07fh
|
---|
180 | lock and dword [xBX], byte 07fh
|
---|
181 | lock and dword [xDI], byte 07fh
|
---|
182 | %ifdef WITH_64_BIT_TESTS
|
---|
183 | lock and qword [1000h], byte 07fh
|
---|
184 | lock and qword [rbx], byte 07fh
|
---|
185 | lock and qword [rdi], byte 07fh
|
---|
186 | lock and qword [r10], byte 07fh
|
---|
187 | %endif
|
---|
188 |
|
---|
189 | ; 20 /r AND reg/mem8, reg8 - sans reg dst
|
---|
190 | lock and byte [1000h], bl
|
---|
191 | lock and byte [xBX], bl
|
---|
192 | lock and byte [xSI], bl
|
---|
193 | ; 21 /r AND reg/memX, regX - sans reg dst
|
---|
194 | lock and word [1000h], bx
|
---|
195 | lock and word [xBX], bx
|
---|
196 | lock and word [xSI], bx
|
---|
197 | lock and dword [1000h], ebx
|
---|
198 | lock and dword [xBX], ebx
|
---|
199 | lock and dword [xSI], ebx
|
---|
200 | %ifdef WITH_64_BIT_TESTS
|
---|
201 | lock and qword [1000h], rbx
|
---|
202 | lock and qword [rbx], rbx
|
---|
203 | lock and qword [rsi], rbx
|
---|
204 | lock and qword [r11], rbx
|
---|
205 | %endif
|
---|
206 |
|
---|
207 | ;
|
---|
208 | ; BTC
|
---|
209 | ;
|
---|
210 | ; 0f bb /r BTC reg/memX, regX (X != 8) - sans reg dst
|
---|
211 | lock btc word [20cch], bx
|
---|
212 | lock btc word [xBX], bx
|
---|
213 | lock btc word [xDI], bx
|
---|
214 | lock btc dword [20cch], ebx
|
---|
215 | lock btc dword [xBX], ebx
|
---|
216 | lock btc dword [xDI], ebx
|
---|
217 | %ifdef WITH_64_BIT_TESTS
|
---|
218 | lock btc qword [20cch], rbx
|
---|
219 | lock btc qword [rdx], rbx
|
---|
220 | lock btc qword [rdi], r10
|
---|
221 | lock btc qword [r8], r12
|
---|
222 | %endif
|
---|
223 | ; 0f ba /7 ib BTC reg/memX, imm8 (X != 8) - sans reg dst
|
---|
224 | lock btc word [20cch], 15
|
---|
225 | lock btc word [xBX], 15
|
---|
226 | lock btc word [xDI], 15
|
---|
227 | lock btc dword [20cch], 30
|
---|
228 | lock btc dword [xBX], 30
|
---|
229 | lock btc dword [xDI], 30
|
---|
230 | %ifdef WITH_64_BIT_TESTS
|
---|
231 | lock btc qword [20cch], 60
|
---|
232 | lock btc qword [rdx], 60
|
---|
233 | lock btc qword [rdi], 60
|
---|
234 | lock btc qword [r9], 60
|
---|
235 | lock btc qword [r12], 60
|
---|
236 | %endif
|
---|
237 |
|
---|
238 | ;
|
---|
239 | ; BTR
|
---|
240 | ;
|
---|
241 | ; 0f b3 /r BTR reg/memX, regX (X != 8) - sans reg dst
|
---|
242 | lock btr word [20cch], bx
|
---|
243 | lock btr word [xBX], bx
|
---|
244 | lock btr word [xDI], bx
|
---|
245 | lock btr dword [20cch], ebx
|
---|
246 | lock btr dword [xBX], ebx
|
---|
247 | lock btr dword [xDI], ebx
|
---|
248 | %ifdef WITH_64_BIT_TESTS
|
---|
249 | lock btr qword [20cch], rbx
|
---|
250 | lock btr qword [rdx], rbx
|
---|
251 | lock btr qword [rdi], r10
|
---|
252 | lock btr qword [r8], r12
|
---|
253 | %endif
|
---|
254 | ; 0f ba /6 ib BTR reg/memX, imm8 (X != 8) - sans reg dst
|
---|
255 | lock btr word [20cch], 15
|
---|
256 | lock btr word [xBX], 15
|
---|
257 | lock btr word [xDI], 15
|
---|
258 | lock btr dword [20cch], 30
|
---|
259 | lock btr dword [xBX], 30
|
---|
260 | lock btr dword [xDI], 30
|
---|
261 | %ifdef WITH_64_BIT_TESTS
|
---|
262 | lock btr qword [20cch], 60
|
---|
263 | lock btr qword [rdx], 60
|
---|
264 | lock btr qword [rdi], 60
|
---|
265 | lock btr qword [r9], 60
|
---|
266 | lock btr qword [r12], 60
|
---|
267 | %endif
|
---|
268 |
|
---|
269 | ;
|
---|
270 | ; BTS
|
---|
271 | ;
|
---|
272 | ; 0f ab /r BTS reg/memX, regX (X != 8) - sans reg dst
|
---|
273 | lock bts word [20cch], bx
|
---|
274 | lock bts word [xBX], bx
|
---|
275 | lock bts word [xDI], bx
|
---|
276 | lock bts dword [20cch], ebx
|
---|
277 | lock bts dword [xBX], ebx
|
---|
278 | lock bts dword [xDI], ebx
|
---|
279 | %if TEST_BITS == 64
|
---|
280 | lock bts qword [20cch], rbx
|
---|
281 | lock bts qword [rdx], rbx
|
---|
282 | lock bts qword [rdi], r10
|
---|
283 | lock bts qword [r8], r12
|
---|
284 | %endif
|
---|
285 | ; 0f ba /5 ib BTS reg/memX, imm8 (X != 8) - sans reg dst
|
---|
286 | lock bts word [20cch], 15
|
---|
287 | lock bts word [xBX], 15
|
---|
288 | lock bts word [xDI], 15
|
---|
289 | lock bts dword [20cch], 30
|
---|
290 | lock bts dword [xBX], 30
|
---|
291 | lock bts dword [xDI], 30
|
---|
292 | %if TEST_BITS == 64
|
---|
293 | lock bts qword [20cch], 60
|
---|
294 | lock bts qword [rdx], 60
|
---|
295 | lock bts qword [rdi], 60
|
---|
296 | lock bts qword [r9], 60
|
---|
297 | lock bts qword [r12], 60
|
---|
298 | %endif
|
---|
299 |
|
---|
300 | ;
|
---|
301 | ; CMPXCHG
|
---|
302 | ;
|
---|
303 | ; 0f b0 /r CMPXCHG reg8/mem8, regX - with reg dst
|
---|
304 | lock cmpxchg byte [30cch], cl
|
---|
305 | lock cmpxchg byte [xBX], cl
|
---|
306 | lock cmpxchg byte [xSI], cl
|
---|
307 | ; 0f b1 /r CMPXCHG regX/memX, regX - with reg dst
|
---|
308 | lock cmpxchg word [30cch], cx
|
---|
309 | lock cmpxchg word [xBX], cx
|
---|
310 | lock cmpxchg word [xSI], cx
|
---|
311 | lock cmpxchg dword [30cch], ecx
|
---|
312 | lock cmpxchg dword [xBX], ecx
|
---|
313 | lock cmpxchg dword [xSI], ecx
|
---|
314 | %ifdef WITH_64_BIT_TESTS
|
---|
315 | lock cmpxchg qword [30cch], rcx
|
---|
316 | lock cmpxchg qword [xBX], rcx
|
---|
317 | lock cmpxchg qword [xSI], rcx
|
---|
318 | lock cmpxchg qword [rdi], r8
|
---|
319 | lock cmpxchg qword [r12], r9
|
---|
320 | %endif
|
---|
321 |
|
---|
322 | ;
|
---|
323 | ; CMPXCHG8B
|
---|
324 | ; CMPXCHG16B
|
---|
325 | ;
|
---|
326 | ;; @todo get back to cmpxchg8b and cmpxchg16b.
|
---|
327 | lock cmpxchg8b qword [1000h]
|
---|
328 | lock cmpxchg8b qword [xDI]
|
---|
329 | lock cmpxchg8b qword [xDI+xBX]
|
---|
330 | %ifdef WITH_64_BIT_TESTS_CMPXCHG16B
|
---|
331 | lock cmpxchg16b [1000h]
|
---|
332 | lock cmpxchg16b [xDI]
|
---|
333 | lock cmpxchg16b [xDI+xBX]
|
---|
334 | %endif
|
---|
335 |
|
---|
336 | ;
|
---|
337 | ; DEC
|
---|
338 | ;
|
---|
339 | ; fe /1 DEC reg8/mem8 - sans reg dst
|
---|
340 | lock dec byte [40cch]
|
---|
341 | lock dec byte [xBX]
|
---|
342 | lock dec byte [xSI]
|
---|
343 | ; ff /1 DEC regX/memX - sans reg dst
|
---|
344 | lock dec word [40cch]
|
---|
345 | lock dec word [xBX]
|
---|
346 | lock dec word [xSI]
|
---|
347 | lock dec dword [40cch]
|
---|
348 | lock dec dword [xBX]
|
---|
349 | lock dec dword [xSI]
|
---|
350 | %ifdef WITH_64_BIT_TESTS
|
---|
351 | lock dec qword [40cch]
|
---|
352 | lock dec qword [xBX]
|
---|
353 | lock dec qword [xSI]
|
---|
354 | lock dec qword [r8]
|
---|
355 | lock dec qword [r12]
|
---|
356 | %endif
|
---|
357 |
|
---|
358 | ;
|
---|
359 | ; INC
|
---|
360 | ;
|
---|
361 | ; fe /0 INC reg8/mem8 - sans reg dst
|
---|
362 | lock inc byte [40cch]
|
---|
363 | lock inc byte [xBX]
|
---|
364 | lock inc byte [xSI]
|
---|
365 | ; ff /0 INC regX/memX - sans reg dst
|
---|
366 | lock inc word [40cch]
|
---|
367 | lock inc word [xBX]
|
---|
368 | lock inc word [xSI]
|
---|
369 | lock inc dword [40cch]
|
---|
370 | lock inc dword [xBX]
|
---|
371 | lock inc dword [xSI]
|
---|
372 | %ifdef WITH_64_BIT_TESTS
|
---|
373 | lock inc qword [40cch]
|
---|
374 | lock inc qword [xBX]
|
---|
375 | lock inc qword [xSI]
|
---|
376 | lock inc qword [r8]
|
---|
377 | lock inc qword [r12]
|
---|
378 | %endif
|
---|
379 |
|
---|
380 | ;
|
---|
381 | ; NEG
|
---|
382 | ;
|
---|
383 | ; f6 /3 NEG reg8/mem8 - sans reg dst
|
---|
384 | lock neg byte [40cch]
|
---|
385 | lock neg byte [xBX]
|
---|
386 | lock neg byte [xSI]
|
---|
387 | ; f7 /3 NEG regX/memX - sans reg dst
|
---|
388 | lock neg word [40cch]
|
---|
389 | lock neg word [xBX]
|
---|
390 | lock neg word [xSI]
|
---|
391 | lock neg dword [40cch]
|
---|
392 | lock neg dword [xBX]
|
---|
393 | lock neg dword [xSI]
|
---|
394 | %ifdef WITH_64_BIT_TESTS
|
---|
395 | lock neg qword [40cch]
|
---|
396 | lock neg qword [xBX]
|
---|
397 | lock neg qword [xSI]
|
---|
398 | lock neg qword [r8]
|
---|
399 | lock neg qword [r12]
|
---|
400 | %endif
|
---|
401 |
|
---|
402 | ;
|
---|
403 | ; NOT
|
---|
404 | ;
|
---|
405 | ; f6 /2 NOT reg8/mem8 - sans reg dst
|
---|
406 | lock not byte [40cch]
|
---|
407 | lock not byte [xBX]
|
---|
408 | lock not byte [xSI]
|
---|
409 | ; f7 /2 NOT regX/memX - sans reg dst
|
---|
410 | lock not word [40cch]
|
---|
411 | lock not word [xBX]
|
---|
412 | lock not word [xSI]
|
---|
413 | lock not dword [40cch]
|
---|
414 | lock not dword [xBX]
|
---|
415 | lock not dword [xSI]
|
---|
416 | %ifdef WITH_64_BIT_TESTS
|
---|
417 | lock not qword [40cch]
|
---|
418 | lock not qword [xBX]
|
---|
419 | lock not qword [xSI]
|
---|
420 | lock not qword [r8]
|
---|
421 | lock not qword [r12]
|
---|
422 | %endif
|
---|
423 |
|
---|
424 | ;
|
---|
425 | ; OR
|
---|
426 | ;
|
---|
427 | ; 80 /1 ib OR reg/mem8, imm8 - sans reg dst
|
---|
428 | lock or byte [1000h], byte 8
|
---|
429 | lock or byte [xBX], byte 8
|
---|
430 | lock or byte [xDI], byte 8
|
---|
431 | ; 81 /1 i[wd] OR reg/memX, immX - sans reg dst
|
---|
432 | lock or word [1000h], word 090cch
|
---|
433 | lock or word [xBX], word 090cch
|
---|
434 | lock or word [xDI], word 090cch
|
---|
435 | lock or dword [1000h], dword 0cc90cc90h
|
---|
436 | lock or dword [xBX], dword 0cc90cc90h
|
---|
437 | lock or dword [xDI], dword 0cc90cc90h
|
---|
438 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
439 | lock or qword [1000h], dword 0cc90cc90h
|
---|
440 | lock or qword [rbx], dword 0cc90cc90h
|
---|
441 | lock or qword [rdi], dword 0cc90cc90h
|
---|
442 | lock or qword [r9], dword 0cc90cc90h
|
---|
443 | %endif
|
---|
444 | ; 83 /1 ib OR reg/memX, imm8 - sans reg dst
|
---|
445 | lock or word [1000h], byte 07fh
|
---|
446 | lock or word [xBX], byte 07fh
|
---|
447 | lock or word [xDI], byte 07fh
|
---|
448 | lock or dword [1000h], byte 07fh
|
---|
449 | lock or dword [xBX], byte 07fh
|
---|
450 | lock or dword [xDI], byte 07fh
|
---|
451 | %ifdef WITH_64_BIT_TESTS
|
---|
452 | lock or qword [1000h], byte 07fh
|
---|
453 | lock or qword [rbx], byte 07fh
|
---|
454 | lock or qword [rdi], byte 07fh
|
---|
455 | lock or qword [r10], byte 07fh
|
---|
456 | %endif
|
---|
457 |
|
---|
458 | ; 08 /r OR reg/mem8, reg8 - sans reg dst
|
---|
459 | lock or byte [1000h], bl
|
---|
460 | lock or byte [xBX], bl
|
---|
461 | lock or byte [xSI], bl
|
---|
462 | ; 09 /r OR reg/memX, regX - sans reg dst
|
---|
463 | lock or word [1000h], bx
|
---|
464 | lock or word [xBX], bx
|
---|
465 | lock or word [xSI], bx
|
---|
466 | lock or dword [1000h], ebx
|
---|
467 | lock or dword [xBX], ebx
|
---|
468 | lock or dword [xSI], ebx
|
---|
469 | %ifdef WITH_64_BIT_TESTS
|
---|
470 | lock or qword [1000h], rbx
|
---|
471 | lock or qword [rbx], rbx
|
---|
472 | lock or qword [rsi], rbx
|
---|
473 | lock or qword [r11], rbx
|
---|
474 | %endif
|
---|
475 |
|
---|
476 | ;
|
---|
477 | ; SBB
|
---|
478 | ;
|
---|
479 | ; 80 /3 ib SBB reg/mem8, imm8 - sans reg dst
|
---|
480 | lock sbb byte [1000h], byte 8
|
---|
481 | lock sbb byte [xBX], byte 8
|
---|
482 | lock sbb byte [xDI], byte 8
|
---|
483 | ; 81 /3 i[wd] SBB reg/memX, immX - sans reg dst
|
---|
484 | lock sbb word [1000h], word 090cch
|
---|
485 | lock sbb word [xBX], word 090cch
|
---|
486 | lock sbb word [xDI], word 090cch
|
---|
487 | lock sbb dword [1000h], dword 0cc90cc90h
|
---|
488 | lock sbb dword [xBX], dword 0cc90cc90h
|
---|
489 | lock sbb dword [xDI], dword 0cc90cc90h
|
---|
490 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
491 | lock sbb qword [1000h], dword 0cc90cc90h
|
---|
492 | lock sbb qword [rbx], dword 0cc90cc90h
|
---|
493 | lock sbb qword [rdi], dword 0cc90cc90h
|
---|
494 | lock sbb qword [r9], dword 0cc90cc90h
|
---|
495 | %endif
|
---|
496 | ; 83 /3 ib SBB reg/memX, imm8 - sans reg dst
|
---|
497 | lock sbb word [1000h], byte 07fh
|
---|
498 | lock sbb word [xBX], byte 07fh
|
---|
499 | lock sbb word [xDI], byte 07fh
|
---|
500 | lock sbb dword [1000h], byte 07fh
|
---|
501 | lock sbb dword [xBX], byte 07fh
|
---|
502 | lock sbb dword [xDI], byte 07fh
|
---|
503 | %ifdef WITH_64_BIT_TESTS
|
---|
504 | lock sbb qword [1000h], byte 07fh
|
---|
505 | lock sbb qword [rbx], byte 07fh
|
---|
506 | lock sbb qword [rdi], byte 07fh
|
---|
507 | lock sbb qword [r10], byte 07fh
|
---|
508 | %endif
|
---|
509 |
|
---|
510 | ; 18 /r SBB reg/mem8, reg8 - sans reg dst
|
---|
511 | lock sbb byte [1000h], bl
|
---|
512 | lock sbb byte [xBX], bl
|
---|
513 | lock sbb byte [xSI], bl
|
---|
514 | ; 19 /r SBB reg/memX, regX - sans reg dst
|
---|
515 | lock sbb word [1000h], bx
|
---|
516 | lock sbb word [xBX], bx
|
---|
517 | lock sbb word [xSI], bx
|
---|
518 | lock sbb dword [1000h], ebx
|
---|
519 | lock sbb dword [xBX], ebx
|
---|
520 | lock sbb dword [xSI], ebx
|
---|
521 | %ifdef WITH_64_BIT_TESTS
|
---|
522 | lock sbb qword [1000h], rbx
|
---|
523 | lock sbb qword [rbx], rbx
|
---|
524 | lock sbb qword [rsi], rbx
|
---|
525 | lock sbb qword [r11], rbx
|
---|
526 | %endif
|
---|
527 |
|
---|
528 | ;
|
---|
529 | ; SUB
|
---|
530 | ;
|
---|
531 | ; 80 /5 ib SUB reg/mem8, imm8 - sans reg dst
|
---|
532 | lock sub byte [1000h], byte 8
|
---|
533 | lock sub byte [xBX], byte 8
|
---|
534 | lock sub byte [xDI], byte 8
|
---|
535 | ; 81 /5 i[wd] SUB reg/memX, immX - sans reg dst
|
---|
536 | lock sub word [1000h], word 090cch
|
---|
537 | lock sub word [xBX], word 090cch
|
---|
538 | lock sub word [xDI], word 090cch
|
---|
539 | lock sub dword [1000h], dword 0cc90cc90h
|
---|
540 | lock sub dword [xBX], dword 0cc90cc90h
|
---|
541 | lock sub dword [xDI], dword 0cc90cc90h
|
---|
542 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
543 | lock sub qword [1000h], dword 0cc90cc90h
|
---|
544 | lock sub qword [rbx], dword 0cc90cc90h
|
---|
545 | lock sub qword [rdi], dword 0cc90cc90h
|
---|
546 | lock sub qword [r9], dword 0cc90cc90h
|
---|
547 | %endif
|
---|
548 | ; 83 /5 ib SUB reg/memX, imm8 - sans reg dst
|
---|
549 | lock sub word [1000h], byte 07fh
|
---|
550 | lock sub word [xBX], byte 07fh
|
---|
551 | lock sub word [xDI], byte 07fh
|
---|
552 | lock sub dword [1000h], byte 07fh
|
---|
553 | lock sub dword [xBX], byte 07fh
|
---|
554 | lock sub dword [xDI], byte 07fh
|
---|
555 | %ifdef WITH_64_BIT_TESTS
|
---|
556 | lock sub qword [1000h], byte 07fh
|
---|
557 | lock sub qword [rbx], byte 07fh
|
---|
558 | lock sub qword [rdi], byte 07fh
|
---|
559 | lock sub qword [r10], byte 07fh
|
---|
560 | %endif
|
---|
561 |
|
---|
562 | ; 28 /r SUB reg/mem8, reg8 - sans reg dst
|
---|
563 | lock sub byte [1000h], bl
|
---|
564 | lock sub byte [xBX], bl
|
---|
565 | lock sub byte [xSI], bl
|
---|
566 | ; 29 /r SUB reg/memX, regX - sans reg dst
|
---|
567 | lock sub word [1000h], bx
|
---|
568 | lock sub word [xBX], bx
|
---|
569 | lock sub word [xSI], bx
|
---|
570 | lock sub dword [1000h], ebx
|
---|
571 | lock sub dword [xBX], ebx
|
---|
572 | lock sub dword [xSI], ebx
|
---|
573 | %ifdef WITH_64_BIT_TESTS
|
---|
574 | lock sub qword [1000h], rbx
|
---|
575 | lock sub qword [rbx], rbx
|
---|
576 | lock sub qword [rsi], rbx
|
---|
577 | lock sub qword [r11], rbx
|
---|
578 | %endif
|
---|
579 |
|
---|
580 | ;
|
---|
581 | ; XADD
|
---|
582 | ;
|
---|
583 | ; 0f c0 /r XADD reg/mem8, reg8 - sans reg dst
|
---|
584 | lock xadd byte [1000h], bl
|
---|
585 | lock xadd byte [xBX], bl
|
---|
586 | lock xadd byte [xDI], bl
|
---|
587 | ; 0f c1 /r XADD reg/memX, immX - sans reg dst
|
---|
588 | lock xadd word [1000h], cx
|
---|
589 | lock xadd word [xBX], cx
|
---|
590 | lock xadd word [xDI], cx
|
---|
591 | lock xadd dword [1000h], edx
|
---|
592 | lock xadd dword [xBX], edx
|
---|
593 | lock xadd dword [xDI], edx
|
---|
594 | %ifdef WITH_64_BIT_TESTS
|
---|
595 | lock xadd qword [1000h], rbx
|
---|
596 | lock xadd qword [xBX], rbx
|
---|
597 | lock xadd qword [xDI], rbx
|
---|
598 | lock xadd qword [r8], rbx
|
---|
599 | lock xadd qword [r12], r8
|
---|
600 | %endif
|
---|
601 |
|
---|
602 | ;
|
---|
603 | ; XCHG
|
---|
604 | ;
|
---|
605 | ; Note: The operands can be switched around but the
|
---|
606 | ; encoding is the same.
|
---|
607 | ;
|
---|
608 | ; 86 /r XCHG reg/mem8, imm8 - sans reg dst
|
---|
609 | lock xchg byte [80cch], bl
|
---|
610 | lock xchg byte [xBX], bl
|
---|
611 | lock xchg byte [xSI], bl
|
---|
612 | %ifdef WITH_64_BIT_TESTS_BORKED_REGS
|
---|
613 | lock xchg byte [rsi], r15b ; turns into r15l which yasm doesn't grok
|
---|
614 | lock xchg byte [r8], r15b ; ditto
|
---|
615 | %endif
|
---|
616 | ; 87 /r XCHG reg/memX, immX - sans reg dst
|
---|
617 | lock xchg word [80cch], bx
|
---|
618 | lock xchg word [xBX], bx
|
---|
619 | lock xchg word [xSI], bx
|
---|
620 | lock xchg dword [80cch], ebx
|
---|
621 | lock xchg dword [xBX], ebx
|
---|
622 | lock xchg dword [xSI], ebx
|
---|
623 | %ifdef WITH_64_BIT_TESTS
|
---|
624 | lock xchg qword [80cch], rbx
|
---|
625 | lock xchg qword [xBX], rbx
|
---|
626 | lock xchg qword [xSI], rbx
|
---|
627 | lock xchg qword [xSI], r15
|
---|
628 | %ifdef WITH_64_BIT_TESTS_BORKED_REGS
|
---|
629 | lock xchg dword [xSI], r15d ; turns into rdi
|
---|
630 | lock xchg word [xSI], r15w ; turns into rdi
|
---|
631 | %endif
|
---|
632 | %endif
|
---|
633 |
|
---|
634 | ;
|
---|
635 | ; XOR
|
---|
636 | ;
|
---|
637 | ; 80 /6 ib XOR reg/mem8, imm8 - sans reg dst
|
---|
638 | lock xor byte [1000h], byte 8
|
---|
639 | lock xor byte [xBX], byte 8
|
---|
640 | lock xor byte [xDI], byte 8
|
---|
641 | ; 81 /6 i[wd] XOR reg/memX, immX - sans reg dst
|
---|
642 | lock xor word [1000h], word 090cch
|
---|
643 | lock xor word [xBX], word 090cch
|
---|
644 | lock xor word [xDI], word 090cch
|
---|
645 | lock xor dword [1000h], dword 0cc90cc90h
|
---|
646 | lock xor dword [xBX], dword 0cc90cc90h
|
---|
647 | lock xor dword [xDI], dword 0cc90cc90h
|
---|
648 | %ifdef WITH_64_BIT_TESTS_IMM32
|
---|
649 | lock xor qword [1000h], dword 0cc90cc90h
|
---|
650 | lock xor qword [rbx], dword 0cc90cc90h
|
---|
651 | lock xor qword [rdi], dword 0cc90cc90h
|
---|
652 | lock xor qword [r9], dword 0cc90cc90h
|
---|
653 | %endif
|
---|
654 | ; 83 /6 ib XOR reg/memX, imm8 - sans reg dst
|
---|
655 | lock xor word [1000h], byte 07fh
|
---|
656 | lock xor word [xBX], byte 07fh
|
---|
657 | lock xor word [xDI], byte 07fh
|
---|
658 | lock xor dword [1000h], byte 07fh
|
---|
659 | lock xor dword [xBX], byte 07fh
|
---|
660 | lock xor dword [xDI], byte 07fh
|
---|
661 | %ifdef WITH_64_BIT_TESTS
|
---|
662 | lock xor qword [1000h], byte 07fh
|
---|
663 | lock xor qword [rbx], byte 07fh
|
---|
664 | lock xor qword [rdi], byte 07fh
|
---|
665 | lock xor qword [r10], byte 07fh
|
---|
666 | %endif
|
---|
667 |
|
---|
668 | ; 30 /r XOR reg/mem8, reg8 - sans reg dst
|
---|
669 | lock xor byte [1000h], bl
|
---|
670 | lock xor byte [xBX], bl
|
---|
671 | lock xor byte [xSI], bl
|
---|
672 | ; 31 /r XOR reg/memX, regX - sans reg dst
|
---|
673 | lock xor word [1000h], bx
|
---|
674 | lock xor word [xBX], bx
|
---|
675 | lock xor word [xSI], bx
|
---|
676 | lock xor dword [1000h], ebx
|
---|
677 | lock xor dword [xBX], ebx
|
---|
678 | lock xor dword [xSI], ebx
|
---|
679 | %ifdef WITH_64_BIT_TESTS
|
---|
680 | lock xor qword [1000h], rbx
|
---|
681 | lock xor qword [rbx], rbx
|
---|
682 | lock xor qword [rsi], rbx
|
---|
683 | lock xor qword [r11], rbx
|
---|
684 | %endif
|
---|
685 |
|
---|