VirtualBox

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

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

props, export, and fixes.

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