VirtualBox

source: vbox/trunk/src/VBox/Disassembler/testcase/tstAsmLock-1.asm@ 8966

Last change on this file since 8966 was 8966, checked in by vboxsync, 17 years ago

ADC tests.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 16.1 KB
Line 
1; $Id: tstAsmLock-1.asm 8966 2008-05-20 16:48:02Z 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 Sun Microsystems, Inc.
12;
13; This file is part of VirtualBox Open Source Edition (OSE), as
14; available from http://www.virtualbox.org. This file is free software;
15; you can redistribute it and/or modify it under the terms of the GNU
16; General Public License (GPL) as published by the Free Software
17; Foundation, in version 2 as it comes in the "COPYING" file of the
18; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
19; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
20;
21; Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
22; Clara, CA 95054 USA or visit http://www.sun.com if you need
23; additional information or have any questions.
24;
25
26%include "tstAsm.mac"
27
28 BITS TEST_BITS
29
30; The disassembler doesn't do imm32 right for 64-bit stuff, so disable it for now.
31;%if TEST_BITS == 64
32; %define WITH_64_BIT_TESTS
33;%endif
34
35 ; ADC
36 ; 80 /2 ib ADC reg/mem8, imm8 - sans reg dst
37 lock adc byte [1000h], byte 8
38 lock adc byte [xBX], byte 8
39 lock adc byte [xDI], byte 8
40 ; 81 /2 i[wd] ADC reg/memX, immX - sans reg dst
41 lock adc word [1000h], word 090cch
42 lock adc word [xBX], word 090cch
43 lock adc word [xDI], word 090cch
44 lock adc dword [1000h], dword 0cc90cc90h
45 lock adc dword [xBX], dword 0cc90cc90h
46 lock adc dword [xDI], dword 0cc90cc90h
47%ifdef WITH_64_BIT_TESTS
48 lock adc qword [1000h], dword 0cc90cc90h
49 lock adc qword [rbx], dword 0cc90cc90h
50 lock adc qword [rdi], dword 0cc90cc90h
51 lock adc qword [r9], dword 0cc90cc90h
52%endif
53 ; 83 /2 ib ADC reg/memX, imm8 - sans reg dst
54 lock adc word [1000h], byte 07fh
55 lock adc word [xBX], byte 07fh
56 lock adc word [xDI], byte 07fh
57 lock adc dword [1000h], byte 07fh
58 lock adc dword [xBX], byte 07fh
59 lock adc dword [xDI], byte 07fh
60%ifdef WITH_64_BIT_TESTS
61 lock adc qword [1000h], byte 07fh
62 lock adc qword [rbx], byte 07fh
63 lock adc qword [rdi], byte 07fh
64 lock adc qword [r10], byte 07fh
65%endif
66
67 ; 10 /r ADC reg/mem8, reg8 - sans reg dst
68 lock adc byte [1000h], bl
69 lock adc byte [xBX], bl
70 lock adc byte [xSI], bl
71 ; 11 /r ADC reg/memX, regX - sans reg dst
72 lock adc word [1000h], bx
73 lock adc word [xBX], bx
74 lock adc word [xSI], bx
75 lock adc dword [1000h], ebx
76 lock adc dword [xBX], ebx
77 lock adc dword [xSI], ebx
78%ifdef WITH_64_BIT_TESTS
79 lock adc qword [1000h], rbx
80 lock adc qword [rbx], rbx
81 lock adc qword [rsi], rbx
82 lock adc qword [r11], rbx
83%endif
84
85 ; ADD
86 ; AND
87 ; BTC
88 ; BTR
89 ; BTS
90 ; CMPXCHG
91 ; CMPXCHG8B
92 ; CMPXCHG16B
93 ; DEC
94 ; INC
95 ; NEG
96 ; NOT
97 ; OR
98 ; SBB
99 ; SUB
100 ; XADD
101
102%if 1
103 ; XCHG
104 lock xchg [eax], eax
105 lock xchg [ebx], eax
106 lock xchg [ecx], eax
107 lock xchg [edx], eax
108 lock xchg [esp], eax
109 lock xchg [ebp], eax
110 lock xchg [esi], eax
111 lock xchg [edi], eax
112 lock xchg [eax], ebx
113 lock xchg [ebx], ebx
114 lock xchg [ecx], ebx
115 lock xchg [edx], ebx
116 lock xchg [esp], ebx
117 lock xchg [ebp], ebx
118 lock xchg [esi], ebx
119 lock xchg [edi], ebx
120 lock xchg [eax], ecx
121 lock xchg [ebx], ecx
122 lock xchg [ecx], ecx
123 lock xchg [edx], ecx
124 lock xchg [esp], ecx
125 lock xchg [ebp], ecx
126 lock xchg [esi], ecx
127 lock xchg [edi], ecx
128 lock xchg [eax], edx
129 lock xchg [ebx], edx
130 lock xchg [ecx], edx
131 lock xchg [edx], edx
132 lock xchg [esp], edx
133 lock xchg [ebp], edx
134 lock xchg [esi], edx
135 lock xchg [edi], edx
136 lock xchg [eax], esp
137 lock xchg [ebx], esp
138 lock xchg [ecx], esp
139 lock xchg [edx], esp
140 lock xchg [esp], esp
141 lock xchg [ebp], esp
142 lock xchg [esi], esp
143 lock xchg [edi], esp
144 lock xchg [eax], ebp
145 lock xchg [ebx], ebp
146 lock xchg [ecx], ebp
147 lock xchg [edx], ebp
148 lock xchg [esp], ebp
149 lock xchg [ebp], ebp
150 lock xchg [esi], ebp
151 lock xchg [edi], ebp
152 lock xchg [eax], esi
153 lock xchg [ebx], esi
154 lock xchg [ecx], esi
155 lock xchg [edx], esi
156 lock xchg [esp], esi
157 lock xchg [ebp], esi
158 lock xchg [esi], esi
159 lock xchg [edi], esi
160 lock xchg [eax], edi
161 lock xchg [ebx], edi
162 lock xchg [ecx], edi
163 lock xchg [edx], edi
164 lock xchg [esp], edi
165 lock xchg [ebp], edi
166 lock xchg [esi], edi
167 lock xchg [edi], edi
168
169 lock xchg [10], eax
170 lock xchg [10], ebx
171 lock xchg [10], ecx
172 lock xchg [10], edx
173 lock xchg [10], esp
174 lock xchg [10], ebp
175 lock xchg [10], esi
176 lock xchg [10], edi
177
178 lock xchg [10000], eax
179 lock xchg [10000], ebx
180 lock xchg [10000], ecx
181 lock xchg [10000], edx
182 lock xchg [10000], esp
183 lock xchg [10000], ebp
184 lock xchg [10000], esi
185 lock xchg [10000], edi
186
187 xchg [eax], eax
188 xchg [ebx], eax
189 xchg [ecx], eax
190 xchg [edx], eax
191 xchg [esp], eax
192 xchg [ebp], eax
193 xchg [esi], eax
194 xchg [edi], eax
195 xchg [eax], ebx
196 xchg [ebx], ebx
197 xchg [ecx], ebx
198 xchg [edx], ebx
199 xchg [esp], ebx
200 xchg [ebp], ebx
201 xchg [esi], ebx
202 xchg [edi], ebx
203 xchg [eax], ecx
204 xchg [ebx], ecx
205 xchg [ecx], ecx
206 xchg [edx], ecx
207 xchg [esp], ecx
208 xchg [ebp], ecx
209 xchg [esi], ecx
210 xchg [edi], ecx
211 xchg [eax], edx
212 xchg [ebx], edx
213 xchg [ecx], edx
214 xchg [edx], edx
215 xchg [esp], edx
216 xchg [ebp], edx
217 xchg [esi], edx
218 xchg [edi], edx
219 xchg [eax], esp
220 xchg [ebx], esp
221 xchg [ecx], esp
222 xchg [edx], esp
223 xchg [esp], esp
224 xchg [ebp], esp
225 xchg [esi], esp
226 xchg [edi], esp
227 xchg [eax], ebp
228 xchg [ebx], ebp
229 xchg [ecx], ebp
230 xchg [edx], ebp
231 xchg [esp], ebp
232 xchg [ebp], ebp
233 xchg [esi], ebp
234 xchg [edi], ebp
235 xchg [eax], esi
236 xchg [ebx], esi
237 xchg [ecx], esi
238 xchg [edx], esi
239 xchg [esp], esi
240 xchg [ebp], esi
241 xchg [esi], esi
242 xchg [edi], esi
243 xchg [eax], edi
244 xchg [ebx], edi
245 xchg [ecx], edi
246 xchg [edx], edi
247 xchg [esp], edi
248 xchg [ebp], edi
249 xchg [esi], edi
250 xchg [edi], edi
251
252 nop
253 xchg ebx, eax
254 xchg ecx, eax
255 xchg edx, eax
256 xchg esp, eax
257 xchg ebp, eax
258 xchg esi, eax
259 xchg edi, eax
260 xchg eax, ebx
261 xchg ebx, ebx
262 xchg ecx, ebx
263 xchg edx, ebx
264 xchg esp, ebx
265 xchg ebp, ebx
266 xchg esi, ebx
267 xchg edi, ebx
268 xchg eax, ecx
269 xchg ebx, ecx
270 xchg ecx, ecx
271 xchg edx, ecx
272 xchg esp, ecx
273 xchg ebp, ecx
274 xchg esi, ecx
275 xchg edi, ecx
276 xchg eax, edx
277 xchg ebx, edx
278 xchg ecx, edx
279 xchg edx, edx
280 xchg esp, edx
281 xchg ebp, edx
282 xchg esi, edx
283 xchg edi, edx
284 xchg eax, esp
285 xchg ebx, esp
286 xchg ecx, esp
287 xchg edx, esp
288 xchg esp, esp
289 xchg ebp, esp
290 xchg esi, esp
291 xchg edi, esp
292 xchg eax, ebp
293 xchg ebx, ebp
294 xchg ecx, ebp
295 xchg edx, ebp
296 xchg esp, ebp
297 xchg ebp, ebp
298 xchg esi, ebp
299 xchg edi, ebp
300 xchg eax, esi
301 xchg ebx, esi
302 xchg ecx, esi
303 xchg edx, esi
304 xchg esp, esi
305 xchg ebp, esi
306 xchg esi, esi
307 xchg edi, esi
308 xchg eax, edi
309 xchg ebx, edi
310 xchg ecx, edi
311 xchg edx, edi
312 xchg esp, edi
313 xchg ebp, edi
314 xchg esi, edi
315 xchg edi, edi
316
317 ; XOR
318 lock xor [1011], eax
319 lock xor [1011], ebx
320 lock xor [1011], ecx
321 lock xor [1011], edx
322 lock xor [1011], esp
323 lock xor [1011], ebp
324 lock xor [1011], esi
325 lock xor [1011], edi
326
327 lock xor [1011], ax
328 lock xor [1011], bx
329 lock xor [1011], cx
330 lock xor [1011], dx
331 lock xor [1011], sp
332 lock xor [1011], bp
333 lock xor [1011], si
334 lock xor [1011], di
335
336 lock xor byte [11], 10
337 lock xor word [11], 10433
338 lock xor dword [11], 10433
339
340 lock xor byte [eax], 1
341 lock xor byte [ebx], 2
342 lock xor byte [ecx], 3
343 lock xor byte [edx], 4
344 lock xor byte [esp], 5
345 lock xor byte [ebp], 6
346 lock xor byte [esi], 7
347 lock xor byte [edi], 8
348
349 lock xor word [eax], 11234
350 lock xor word [ebx], 21234
351 lock xor word [ecx], 31234
352 lock xor word [edx], 41234
353 lock xor word [esp], 51234
354 lock xor word [ebp], 61234
355 lock xor word [esi], 17234
356 lock xor word [edi], 18234
357
358 lock xor dword [eax], 1011234
359 lock xor dword [ebx], 1021234
360 lock xor dword [ecx], 1031234
361 lock xor dword [edx], 1041234
362 lock xor dword [esp], 1051234
363 lock xor dword [ebp], 1061234
364 lock xor dword [esi], 1071234
365 lock xor dword [edi], 1081234
366
367 lock xor [eax], eax
368 lock xor [eax], ebx
369 lock xor [eax], ecx
370 lock xor [eax], edx
371 lock xor [eax], esp
372 lock xor [eax], ebp
373 lock xor [eax], esi
374 lock xor [eax], edi
375 lock xor [ebx], eax
376 lock xor [ebx], ebx
377 lock xor [ebx], ecx
378 lock xor [ebx], edx
379 lock xor [ebx], esp
380 lock xor [ebx], ebp
381 lock xor [ebx], esi
382 lock xor [ebx], edi
383 lock xor [ecx], eax
384 lock xor [ecx], ebx
385 lock xor [ecx], ecx
386 lock xor [ecx], edx
387 lock xor [ecx], esp
388 lock xor [ecx], ebp
389 lock xor [ecx], esi
390 lock xor [ecx], edi
391 lock xor [edx], eax
392 lock xor [edx], ebx
393 lock xor [edx], ecx
394 lock xor [edx], edx
395 lock xor [edx], esp
396 lock xor [edx], ebp
397 lock xor [edx], esi
398 lock xor [edx], edi
399 lock xor [esp], eax
400 lock xor [esp], ebx
401 lock xor [esp], ecx
402 lock xor [esp], edx
403 lock xor [esp], esp
404 lock xor [esp], ebp
405 lock xor [esp], esi
406 lock xor [esp], edi
407 lock xor [ebp], eax
408 lock xor [ebp], ebx
409 lock xor [ebp], ecx
410 lock xor [ebp], edx
411 lock xor [ebp], esp
412 lock xor [ebp], ebp
413 lock xor [ebp], esi
414 lock xor [ebp], edi
415 lock xor [esi], eax
416 lock xor [esi], ebx
417 lock xor [esi], ecx
418 lock xor [esi], edx
419 lock xor [esi], esp
420 lock xor [esi], ebp
421 lock xor [esi], esi
422 lock xor [esi], edi
423 lock xor [edi], eax
424 lock xor [edi], ebx
425 lock xor [edi], ecx
426 lock xor [edi], edx
427 lock xor [edi], esp
428 lock xor [edi], ebp
429 lock xor [edi], esi
430 lock xor [edi], edi
431
432 lock xor [eax], ax
433 lock xor [eax], bx
434 lock xor [eax], cx
435 lock xor [eax], dx
436 lock xor [eax], sp
437 lock xor [eax], bp
438 lock xor [eax], si
439 lock xor [eax], di
440 lock xor [ebx], ax
441 lock xor [ebx], bx
442 lock xor [ebx], cx
443 lock xor [ebx], dx
444 lock xor [ebx], sp
445 lock xor [ebx], bp
446 lock xor [ebx], si
447 lock xor [ebx], di
448 lock xor [ecx], ax
449 lock xor [ecx], bx
450 lock xor [ecx], cx
451 lock xor [ecx], dx
452 lock xor [ecx], sp
453 lock xor [ecx], bp
454 lock xor [ecx], si
455 lock xor [ecx], di
456 lock xor [edx], ax
457 lock xor [edx], bx
458 lock xor [edx], cx
459 lock xor [edx], dx
460 lock xor [edx], sp
461 lock xor [edx], bp
462 lock xor [edx], si
463 lock xor [edx], di
464 lock xor [esp], ax
465 lock xor [esp], bx
466 lock xor [esp], cx
467 lock xor [esp], dx
468 lock xor [esp], sp
469 lock xor [esp], bp
470 lock xor [esp], si
471 lock xor [esp], di
472 lock xor [ebp], ax
473 lock xor [ebp], bx
474 lock xor [ebp], cx
475 lock xor [ebp], dx
476 lock xor [ebp], sp
477 lock xor [ebp], bp
478 lock xor [ebp], si
479 lock xor [ebp], di
480 lock xor [esi], ax
481 lock xor [esi], bx
482 lock xor [esi], cx
483 lock xor [esi], dx
484 lock xor [esi], sp
485 lock xor [esi], bp
486 lock xor [esi], si
487 lock xor [esi], di
488 lock xor [edi], ax
489 lock xor [edi], bx
490 lock xor [edi], cx
491 lock xor [edi], dx
492 lock xor [edi], sp
493 lock xor [edi], bp
494 lock xor [edi], si
495 lock xor [edi], di
496
497 lock xor [eax], al
498 lock xor [eax], ah
499 lock xor [eax], bl
500 lock xor [eax], bh
501 lock xor [eax], cl
502 lock xor [eax], ch
503 lock xor [eax], dl
504 lock xor [eax], dh
505 lock xor [ebx], al
506 lock xor [ebx], ah
507 lock xor [ebx], bl
508 lock xor [ebx], bh
509 lock xor [ebx], cl
510 lock xor [ebx], ch
511 lock xor [ebx], dl
512 lock xor [ebx], dh
513 lock xor [ecx], al
514 lock xor [ecx], ah
515 lock xor [ecx], bl
516 lock xor [ecx], bh
517 lock xor [ecx], cl
518 lock xor [ecx], ch
519 lock xor [ecx], dl
520 lock xor [ecx], dh
521 lock xor [edx], al
522 lock xor [edx], ah
523 lock xor [edx], bl
524 lock xor [edx], bh
525 lock xor [edx], cl
526 lock xor [edx], ch
527 lock xor [edx], dl
528 lock xor [edx], dh
529 lock xor [esp], al
530 lock xor [esp], ah
531 lock xor [esp], bl
532 lock xor [esp], bh
533 lock xor [esp], cl
534 lock xor [esp], ch
535 lock xor [esp], dl
536 lock xor [esp], dh
537 lock xor [ebp], al
538 lock xor [ebp], ah
539 lock xor [ebp], bl
540 lock xor [ebp], bh
541 lock xor [ebp], cl
542 lock xor [ebp], ch
543 lock xor [ebp], dl
544 lock xor [ebp], dh
545 lock xor [esi], al
546 lock xor [esi], ah
547 lock xor [esi], bl
548 lock xor [esi], bh
549 lock xor [esi], cl
550 lock xor [esi], ch
551 lock xor [esi], dl
552 lock xor [esi], dh
553 lock xor [edi], al
554 lock xor [edi], ah
555 lock xor [edi], bl
556 lock xor [edi], bh
557 lock xor [edi], cl
558 lock xor [edi], ch
559 lock xor [edi], dl
560 lock xor [edi], dh
561
562 xor [1011], eax
563 xor [1011], ebx
564 xor [1011], ecx
565 xor [1011], edx
566 xor [1011], esp
567 xor [1011], ebp
568 xor [1011], esi
569 xor [1011], edi
570
571 xor [1011], ax
572 xor [1011], bx
573 xor [1011], cx
574 xor [1011], dx
575 xor [1011], sp
576 xor [1011], bp
577 xor [1011], si
578 xor [1011], di
579
580 xor byte [11], 10
581 xor word [11], 10433
582 xor dword [11], 10433
583
584 xor byte [eax], 1
585 xor byte [ebx], 2
586 xor byte [ecx], 3
587 xor byte [edx], 4
588 xor byte [esp], 5
589 xor byte [ebp], 6
590 xor byte [esi], 7
591 xor byte [edi], 8
592
593 xor word [eax], 11234
594 xor word [ebx], 21234
595 xor word [ecx], 31234
596 xor word [edx], 41234
597 xor word [esp], 51234
598 xor word [ebp], 61234
599 xor word [esi], 17234
600 xor word [edi], 18234
601
602 xor dword [eax], 1011234
603 xor dword [ebx], 1021234
604 xor dword [ecx], 1031234
605 xor dword [edx], 1041234
606 xor dword [esp], 1051234
607 xor dword [ebp], 1061234
608 xor dword [esi], 1071234
609 xor dword [edi], 1081234
610
611 xor [eax], eax
612 xor [eax], ebx
613 xor [eax], ecx
614 xor [eax], edx
615 xor [eax], esp
616 xor [eax], ebp
617 xor [eax], esi
618 xor [eax], edi
619 xor [ebx], eax
620 xor [ebx], ebx
621 xor [ebx], ecx
622 xor [ebx], edx
623 xor [ebx], esp
624 xor [ebx], ebp
625 xor [ebx], esi
626 xor [ebx], edi
627 xor [ecx], eax
628 xor [ecx], ebx
629 xor [ecx], ecx
630 xor [ecx], edx
631 xor [ecx], esp
632 xor [ecx], ebp
633 xor [ecx], esi
634 xor [ecx], edi
635 xor [edx], eax
636 xor [edx], ebx
637 xor [edx], ecx
638 xor [edx], edx
639 xor [edx], esp
640 xor [edx], ebp
641 xor [edx], esi
642 xor [edx], edi
643 xor [esp], eax
644 xor [esp], ebx
645 xor [esp], ecx
646 xor [esp], edx
647 xor [esp], esp
648 xor [esp], ebp
649 xor [esp], esi
650 xor [esp], edi
651 xor [ebp], eax
652 xor [ebp], ebx
653 xor [ebp], ecx
654 xor [ebp], edx
655 xor [ebp], esp
656 xor [ebp], ebp
657 xor [ebp], esi
658 xor [ebp], edi
659 xor [esi], eax
660 xor [esi], ebx
661 xor [esi], ecx
662 xor [esi], edx
663 xor [esi], esp
664 xor [esi], ebp
665 xor [esi], esi
666 xor [esi], edi
667 xor [edi], eax
668 xor [edi], ebx
669 xor [edi], ecx
670 xor [edi], edx
671 xor [edi], esp
672 xor [edi], ebp
673 xor [edi], esi
674 xor [edi], edi
675
676 xor eax, eax
677 xor eax, ebx
678 xor eax, ecx
679 xor eax, edx
680 xor eax, esp
681 xor eax, ebp
682 xor eax, esi
683 xor eax, edi
684 xor ebx, eax
685 xor ebx, ebx
686 xor ebx, ecx
687 xor ebx, edx
688 xor ebx, esp
689 xor ebx, ebp
690 xor ebx, esi
691 xor ebx, edi
692 xor ecx, eax
693 xor ecx, ebx
694 xor ecx, ecx
695 xor ecx, edx
696 xor ecx, esp
697 xor ecx, ebp
698 xor ecx, esi
699 xor ecx, edi
700 xor edx, eax
701 xor edx, ebx
702 xor edx, ecx
703 xor edx, edx
704 xor edx, esp
705 xor edx, ebp
706 xor edx, esi
707 xor edx, edi
708 xor esp, eax
709 xor esp, ebx
710 xor esp, ecx
711 xor esp, edx
712 xor esp, esp
713 xor esp, ebp
714 xor esp, esi
715 xor esp, edi
716 xor ebp, eax
717 xor ebp, ebx
718 xor ebp, ecx
719 xor ebp, edx
720 xor ebp, esp
721 xor ebp, ebp
722 xor ebp, esi
723 xor ebp, edi
724 xor esi, eax
725 xor esi, ebx
726 xor esi, ecx
727 xor esi, edx
728 xor esi, esp
729 xor esi, ebp
730 xor esi, esi
731 xor esi, edi
732 xor edi, eax
733 xor edi, ebx
734 xor edi, ecx
735 xor edi, edx
736 xor edi, esp
737 xor edi, ebp
738 xor edi, esi
739 xor edi, edi
740%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