VirtualBox

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

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

Wrote up the makefile bits or the dissassembler test 'framework' and hacked together a yasmification of the DIS output sufficient to make the current tests work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 14.3 KB
Line 
1; $Id: tstAsmLock-1.asm 8937 2008-05-20 00:52:26Z 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 BITS TEST_BITS
27
28 ; ADC
29
30 ; ADD
31 ; AND
32 ; BTC
33 ; BTR
34 ; BTS
35 ; CMPXCHG
36 ; CMPXCHG8B
37 ; CMPXCHG16B
38 ; DEC
39 ; INC
40 ; NEG
41 ; NOT
42 ; OR
43 ; SBB
44 ; SUB
45 ; XADD
46
47 ; XCHG
48 lock xchg [eax], eax
49 lock xchg [ebx], eax
50 lock xchg [ecx], eax
51 lock xchg [edx], eax
52 lock xchg [esp], eax
53 lock xchg [ebp], eax
54 lock xchg [esi], eax
55 lock xchg [edi], eax
56 lock xchg [eax], ebx
57 lock xchg [ebx], ebx
58 lock xchg [ecx], ebx
59 lock xchg [edx], ebx
60 lock xchg [esp], ebx
61 lock xchg [ebp], ebx
62 lock xchg [esi], ebx
63 lock xchg [edi], ebx
64 lock xchg [eax], ecx
65 lock xchg [ebx], ecx
66 lock xchg [ecx], ecx
67 lock xchg [edx], ecx
68 lock xchg [esp], ecx
69 lock xchg [ebp], ecx
70 lock xchg [esi], ecx
71 lock xchg [edi], ecx
72 lock xchg [eax], edx
73 lock xchg [ebx], edx
74 lock xchg [ecx], edx
75 lock xchg [edx], edx
76 lock xchg [esp], edx
77 lock xchg [ebp], edx
78 lock xchg [esi], edx
79 lock xchg [edi], edx
80 lock xchg [eax], esp
81 lock xchg [ebx], esp
82 lock xchg [ecx], esp
83 lock xchg [edx], esp
84 lock xchg [esp], esp
85 lock xchg [ebp], esp
86 lock xchg [esi], esp
87 lock xchg [edi], esp
88 lock xchg [eax], ebp
89 lock xchg [ebx], ebp
90 lock xchg [ecx], ebp
91 lock xchg [edx], ebp
92 lock xchg [esp], ebp
93 lock xchg [ebp], ebp
94 lock xchg [esi], ebp
95 lock xchg [edi], ebp
96 lock xchg [eax], esi
97 lock xchg [ebx], esi
98 lock xchg [ecx], esi
99 lock xchg [edx], esi
100 lock xchg [esp], esi
101 lock xchg [ebp], esi
102 lock xchg [esi], esi
103 lock xchg [edi], esi
104 lock xchg [eax], edi
105 lock xchg [ebx], edi
106 lock xchg [ecx], edi
107 lock xchg [edx], edi
108 lock xchg [esp], edi
109 lock xchg [ebp], edi
110 lock xchg [esi], edi
111 lock xchg [edi], edi
112
113 lock xchg [10], eax
114 lock xchg [10], ebx
115 lock xchg [10], ecx
116 lock xchg [10], edx
117 lock xchg [10], esp
118 lock xchg [10], ebp
119 lock xchg [10], esi
120 lock xchg [10], edi
121
122 lock xchg [10000], eax
123 lock xchg [10000], ebx
124 lock xchg [10000], ecx
125 lock xchg [10000], edx
126 lock xchg [10000], esp
127 lock xchg [10000], ebp
128 lock xchg [10000], esi
129 lock xchg [10000], edi
130
131 xchg [eax], eax
132 xchg [ebx], eax
133 xchg [ecx], eax
134 xchg [edx], eax
135 xchg [esp], eax
136 xchg [ebp], eax
137 xchg [esi], eax
138 xchg [edi], eax
139 xchg [eax], ebx
140 xchg [ebx], ebx
141 xchg [ecx], ebx
142 xchg [edx], ebx
143 xchg [esp], ebx
144 xchg [ebp], ebx
145 xchg [esi], ebx
146 xchg [edi], ebx
147 xchg [eax], ecx
148 xchg [ebx], ecx
149 xchg [ecx], ecx
150 xchg [edx], ecx
151 xchg [esp], ecx
152 xchg [ebp], ecx
153 xchg [esi], ecx
154 xchg [edi], ecx
155 xchg [eax], edx
156 xchg [ebx], edx
157 xchg [ecx], edx
158 xchg [edx], edx
159 xchg [esp], edx
160 xchg [ebp], edx
161 xchg [esi], edx
162 xchg [edi], edx
163 xchg [eax], esp
164 xchg [ebx], esp
165 xchg [ecx], esp
166 xchg [edx], esp
167 xchg [esp], esp
168 xchg [ebp], esp
169 xchg [esi], esp
170 xchg [edi], esp
171 xchg [eax], ebp
172 xchg [ebx], ebp
173 xchg [ecx], ebp
174 xchg [edx], ebp
175 xchg [esp], ebp
176 xchg [ebp], ebp
177 xchg [esi], ebp
178 xchg [edi], ebp
179 xchg [eax], esi
180 xchg [ebx], esi
181 xchg [ecx], esi
182 xchg [edx], esi
183 xchg [esp], esi
184 xchg [ebp], esi
185 xchg [esi], esi
186 xchg [edi], esi
187 xchg [eax], edi
188 xchg [ebx], edi
189 xchg [ecx], edi
190 xchg [edx], edi
191 xchg [esp], edi
192 xchg [ebp], edi
193 xchg [esi], edi
194 xchg [edi], edi
195
196 nop
197 xchg ebx, eax
198 xchg ecx, eax
199 xchg edx, eax
200 xchg esp, eax
201 xchg ebp, eax
202 xchg esi, eax
203 xchg edi, eax
204 xchg eax, ebx
205 xchg ebx, ebx
206 xchg ecx, ebx
207 xchg edx, ebx
208 xchg esp, ebx
209 xchg ebp, ebx
210 xchg esi, ebx
211 xchg edi, ebx
212 xchg eax, ecx
213 xchg ebx, ecx
214 xchg ecx, ecx
215 xchg edx, ecx
216 xchg esp, ecx
217 xchg ebp, ecx
218 xchg esi, ecx
219 xchg edi, ecx
220 xchg eax, edx
221 xchg ebx, edx
222 xchg ecx, edx
223 xchg edx, edx
224 xchg esp, edx
225 xchg ebp, edx
226 xchg esi, edx
227 xchg edi, edx
228 xchg eax, esp
229 xchg ebx, esp
230 xchg ecx, esp
231 xchg edx, esp
232 xchg esp, esp
233 xchg ebp, esp
234 xchg esi, esp
235 xchg edi, esp
236 xchg eax, ebp
237 xchg ebx, ebp
238 xchg ecx, ebp
239 xchg edx, ebp
240 xchg esp, ebp
241 xchg ebp, ebp
242 xchg esi, ebp
243 xchg edi, ebp
244 xchg eax, esi
245 xchg ebx, esi
246 xchg ecx, esi
247 xchg edx, esi
248 xchg esp, esi
249 xchg ebp, esi
250 xchg esi, esi
251 xchg edi, esi
252 xchg eax, edi
253 xchg ebx, edi
254 xchg ecx, edi
255 xchg edx, edi
256 xchg esp, edi
257 xchg ebp, edi
258 xchg esi, edi
259 xchg edi, edi
260
261 ; XOR
262 lock xor [1011], eax
263 lock xor [1011], ebx
264 lock xor [1011], ecx
265 lock xor [1011], edx
266 lock xor [1011], esp
267 lock xor [1011], ebp
268 lock xor [1011], esi
269 lock xor [1011], edi
270
271 lock xor [1011], ax
272 lock xor [1011], bx
273 lock xor [1011], cx
274 lock xor [1011], dx
275 lock xor [1011], sp
276 lock xor [1011], bp
277 lock xor [1011], si
278 lock xor [1011], di
279
280 lock xor byte [11], 10
281 lock xor word [11], 10433
282 lock xor dword [11], 10433
283
284 lock xor byte [eax], 1
285 lock xor byte [ebx], 2
286 lock xor byte [ecx], 3
287 lock xor byte [edx], 4
288 lock xor byte [esp], 5
289 lock xor byte [ebp], 6
290 lock xor byte [esi], 7
291 lock xor byte [edi], 8
292
293 lock xor word [eax], 11234
294 lock xor word [ebx], 21234
295 lock xor word [ecx], 31234
296 lock xor word [edx], 41234
297 lock xor word [esp], 51234
298 lock xor word [ebp], 61234
299 lock xor word [esi], 17234
300 lock xor word [edi], 18234
301
302 lock xor dword [eax], 1011234
303 lock xor dword [ebx], 1021234
304 lock xor dword [ecx], 1031234
305 lock xor dword [edx], 1041234
306 lock xor dword [esp], 1051234
307 lock xor dword [ebp], 1061234
308 lock xor dword [esi], 1071234
309 lock xor dword [edi], 1081234
310
311 lock xor [eax], eax
312 lock xor [eax], ebx
313 lock xor [eax], ecx
314 lock xor [eax], edx
315 lock xor [eax], esp
316 lock xor [eax], ebp
317 lock xor [eax], esi
318 lock xor [eax], edi
319 lock xor [ebx], eax
320 lock xor [ebx], ebx
321 lock xor [ebx], ecx
322 lock xor [ebx], edx
323 lock xor [ebx], esp
324 lock xor [ebx], ebp
325 lock xor [ebx], esi
326 lock xor [ebx], edi
327 lock xor [ecx], eax
328 lock xor [ecx], ebx
329 lock xor [ecx], ecx
330 lock xor [ecx], edx
331 lock xor [ecx], esp
332 lock xor [ecx], ebp
333 lock xor [ecx], esi
334 lock xor [ecx], edi
335 lock xor [edx], eax
336 lock xor [edx], ebx
337 lock xor [edx], ecx
338 lock xor [edx], edx
339 lock xor [edx], esp
340 lock xor [edx], ebp
341 lock xor [edx], esi
342 lock xor [edx], edi
343 lock xor [esp], eax
344 lock xor [esp], ebx
345 lock xor [esp], ecx
346 lock xor [esp], edx
347 lock xor [esp], esp
348 lock xor [esp], ebp
349 lock xor [esp], esi
350 lock xor [esp], edi
351 lock xor [ebp], eax
352 lock xor [ebp], ebx
353 lock xor [ebp], ecx
354 lock xor [ebp], edx
355 lock xor [ebp], esp
356 lock xor [ebp], ebp
357 lock xor [ebp], esi
358 lock xor [ebp], edi
359 lock xor [esi], eax
360 lock xor [esi], ebx
361 lock xor [esi], ecx
362 lock xor [esi], edx
363 lock xor [esi], esp
364 lock xor [esi], ebp
365 lock xor [esi], esi
366 lock xor [esi], edi
367 lock xor [edi], eax
368 lock xor [edi], ebx
369 lock xor [edi], ecx
370 lock xor [edi], edx
371 lock xor [edi], esp
372 lock xor [edi], ebp
373 lock xor [edi], esi
374 lock xor [edi], edi
375
376 lock xor [eax], ax
377 lock xor [eax], bx
378 lock xor [eax], cx
379 lock xor [eax], dx
380 lock xor [eax], sp
381 lock xor [eax], bp
382 lock xor [eax], si
383 lock xor [eax], di
384 lock xor [ebx], ax
385 lock xor [ebx], bx
386 lock xor [ebx], cx
387 lock xor [ebx], dx
388 lock xor [ebx], sp
389 lock xor [ebx], bp
390 lock xor [ebx], si
391 lock xor [ebx], di
392 lock xor [ecx], ax
393 lock xor [ecx], bx
394 lock xor [ecx], cx
395 lock xor [ecx], dx
396 lock xor [ecx], sp
397 lock xor [ecx], bp
398 lock xor [ecx], si
399 lock xor [ecx], di
400 lock xor [edx], ax
401 lock xor [edx], bx
402 lock xor [edx], cx
403 lock xor [edx], dx
404 lock xor [edx], sp
405 lock xor [edx], bp
406 lock xor [edx], si
407 lock xor [edx], di
408 lock xor [esp], ax
409 lock xor [esp], bx
410 lock xor [esp], cx
411 lock xor [esp], dx
412 lock xor [esp], sp
413 lock xor [esp], bp
414 lock xor [esp], si
415 lock xor [esp], di
416 lock xor [ebp], ax
417 lock xor [ebp], bx
418 lock xor [ebp], cx
419 lock xor [ebp], dx
420 lock xor [ebp], sp
421 lock xor [ebp], bp
422 lock xor [ebp], si
423 lock xor [ebp], di
424 lock xor [esi], ax
425 lock xor [esi], bx
426 lock xor [esi], cx
427 lock xor [esi], dx
428 lock xor [esi], sp
429 lock xor [esi], bp
430 lock xor [esi], si
431 lock xor [esi], di
432 lock xor [edi], ax
433 lock xor [edi], bx
434 lock xor [edi], cx
435 lock xor [edi], dx
436 lock xor [edi], sp
437 lock xor [edi], bp
438 lock xor [edi], si
439 lock xor [edi], di
440
441 lock xor [eax], al
442 lock xor [eax], ah
443 lock xor [eax], bl
444 lock xor [eax], bh
445 lock xor [eax], cl
446 lock xor [eax], ch
447 lock xor [eax], dl
448 lock xor [eax], dh
449 lock xor [ebx], al
450 lock xor [ebx], ah
451 lock xor [ebx], bl
452 lock xor [ebx], bh
453 lock xor [ebx], cl
454 lock xor [ebx], ch
455 lock xor [ebx], dl
456 lock xor [ebx], dh
457 lock xor [ecx], al
458 lock xor [ecx], ah
459 lock xor [ecx], bl
460 lock xor [ecx], bh
461 lock xor [ecx], cl
462 lock xor [ecx], ch
463 lock xor [ecx], dl
464 lock xor [ecx], dh
465 lock xor [edx], al
466 lock xor [edx], ah
467 lock xor [edx], bl
468 lock xor [edx], bh
469 lock xor [edx], cl
470 lock xor [edx], ch
471 lock xor [edx], dl
472 lock xor [edx], dh
473 lock xor [esp], al
474 lock xor [esp], ah
475 lock xor [esp], bl
476 lock xor [esp], bh
477 lock xor [esp], cl
478 lock xor [esp], ch
479 lock xor [esp], dl
480 lock xor [esp], dh
481 lock xor [ebp], al
482 lock xor [ebp], ah
483 lock xor [ebp], bl
484 lock xor [ebp], bh
485 lock xor [ebp], cl
486 lock xor [ebp], ch
487 lock xor [ebp], dl
488 lock xor [ebp], dh
489 lock xor [esi], al
490 lock xor [esi], ah
491 lock xor [esi], bl
492 lock xor [esi], bh
493 lock xor [esi], cl
494 lock xor [esi], ch
495 lock xor [esi], dl
496 lock xor [esi], dh
497 lock xor [edi], al
498 lock xor [edi], ah
499 lock xor [edi], bl
500 lock xor [edi], bh
501 lock xor [edi], cl
502 lock xor [edi], ch
503 lock xor [edi], dl
504 lock xor [edi], dh
505
506 xor [1011], eax
507 xor [1011], ebx
508 xor [1011], ecx
509 xor [1011], edx
510 xor [1011], esp
511 xor [1011], ebp
512 xor [1011], esi
513 xor [1011], edi
514
515 xor [1011], ax
516 xor [1011], bx
517 xor [1011], cx
518 xor [1011], dx
519 xor [1011], sp
520 xor [1011], bp
521 xor [1011], si
522 xor [1011], di
523
524 xor byte [11], 10
525 xor word [11], 10433
526 xor dword [11], 10433
527
528 xor byte [eax], 1
529 xor byte [ebx], 2
530 xor byte [ecx], 3
531 xor byte [edx], 4
532 xor byte [esp], 5
533 xor byte [ebp], 6
534 xor byte [esi], 7
535 xor byte [edi], 8
536
537 xor word [eax], 11234
538 xor word [ebx], 21234
539 xor word [ecx], 31234
540 xor word [edx], 41234
541 xor word [esp], 51234
542 xor word [ebp], 61234
543 xor word [esi], 17234
544 xor word [edi], 18234
545
546 xor dword [eax], 1011234
547 xor dword [ebx], 1021234
548 xor dword [ecx], 1031234
549 xor dword [edx], 1041234
550 xor dword [esp], 1051234
551 xor dword [ebp], 1061234
552 xor dword [esi], 1071234
553 xor dword [edi], 1081234
554
555 xor [eax], eax
556 xor [eax], ebx
557 xor [eax], ecx
558 xor [eax], edx
559 xor [eax], esp
560 xor [eax], ebp
561 xor [eax], esi
562 xor [eax], edi
563 xor [ebx], eax
564 xor [ebx], ebx
565 xor [ebx], ecx
566 xor [ebx], edx
567 xor [ebx], esp
568 xor [ebx], ebp
569 xor [ebx], esi
570 xor [ebx], edi
571 xor [ecx], eax
572 xor [ecx], ebx
573 xor [ecx], ecx
574 xor [ecx], edx
575 xor [ecx], esp
576 xor [ecx], ebp
577 xor [ecx], esi
578 xor [ecx], edi
579 xor [edx], eax
580 xor [edx], ebx
581 xor [edx], ecx
582 xor [edx], edx
583 xor [edx], esp
584 xor [edx], ebp
585 xor [edx], esi
586 xor [edx], edi
587 xor [esp], eax
588 xor [esp], ebx
589 xor [esp], ecx
590 xor [esp], edx
591 xor [esp], esp
592 xor [esp], ebp
593 xor [esp], esi
594 xor [esp], edi
595 xor [ebp], eax
596 xor [ebp], ebx
597 xor [ebp], ecx
598 xor [ebp], edx
599 xor [ebp], esp
600 xor [ebp], ebp
601 xor [ebp], esi
602 xor [ebp], edi
603 xor [esi], eax
604 xor [esi], ebx
605 xor [esi], ecx
606 xor [esi], edx
607 xor [esi], esp
608 xor [esi], ebp
609 xor [esi], esi
610 xor [esi], edi
611 xor [edi], eax
612 xor [edi], ebx
613 xor [edi], ecx
614 xor [edi], edx
615 xor [edi], esp
616 xor [edi], ebp
617 xor [edi], esi
618 xor [edi], edi
619
620 xor eax, eax
621 xor eax, ebx
622 xor eax, ecx
623 xor eax, edx
624 xor eax, esp
625 xor eax, ebp
626 xor eax, esi
627 xor eax, edi
628 xor ebx, eax
629 xor ebx, ebx
630 xor ebx, ecx
631 xor ebx, edx
632 xor ebx, esp
633 xor ebx, ebp
634 xor ebx, esi
635 xor ebx, edi
636 xor ecx, eax
637 xor ecx, ebx
638 xor ecx, ecx
639 xor ecx, edx
640 xor ecx, esp
641 xor ecx, ebp
642 xor ecx, esi
643 xor ecx, edi
644 xor edx, eax
645 xor edx, ebx
646 xor edx, ecx
647 xor edx, edx
648 xor edx, esp
649 xor edx, ebp
650 xor edx, esi
651 xor edx, edi
652 xor esp, eax
653 xor esp, ebx
654 xor esp, ecx
655 xor esp, edx
656 xor esp, esp
657 xor esp, ebp
658 xor esp, esi
659 xor esp, edi
660 xor ebp, eax
661 xor ebp, ebx
662 xor ebp, ecx
663 xor ebp, edx
664 xor ebp, esp
665 xor ebp, ebp
666 xor ebp, esi
667 xor ebp, edi
668 xor esi, eax
669 xor esi, ebx
670 xor esi, ecx
671 xor esi, edx
672 xor esi, esp
673 xor esi, ebp
674 xor esi, esi
675 xor esi, edi
676 xor edi, eax
677 xor edi, ebx
678 xor edi, ecx
679 xor edi, edx
680 xor edi, esp
681 xor edi, ebp
682 xor edi, esi
683 xor edi, edi
684
685
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette