1 cmpxchg
%bl
,%cl
(al
=22 bl
=44 cl
=33)
2 al
!=cl so al should equal cl
(Result al
=33 bl
=44 cl
=33)
3 cmpxchg
%bl
,%cl
(al
=77 bl
=55 cl
=55)
4 al
==cl so cl should equal bl
(Result al
=55 bl
=55 cl
=55)
5 cmpxchg
%bx
,%cx
(ax
=2222 bx
=4444 cx
=3333)
6 ax
!=cx so ax should equal cx
(Result ax
=3333 bx
=4444 cx
=3333)
7 cmpxchg
%bx
,%cx
(ax
=7777 bx
=5555 cx
=5555)
8 ax
==cx so cx should equal bx
(Result ax
=5555 bx
=5555 cx
=5555)
9 cmpxchg
%ebx
,%ecx
(eax
=22222222 ebx
=44444444 ecx
=33333333)
10 eax
!=ecx so eax should equal ecx
(Result eax
=33333333 ebx
=44444444 ecx
=33333333)
11 cmpxchg
%ebx
,%ecx
(eax
=77777777 ebx
=55555555 ecx
=55555555)
12 eax
==ecx so ecx should equal ebx
(Result eax
=55555555 ebx
=55555555 ecx
=55555555)
13 cmpxchg
%rbx
,%rcx
(rax
=222222222 rbx
=444444444 rcx
=333333333)
14 rax
!=rcx so rax should equal rcx
(Result rax
=333333333 rbx
=444444444 rcx
=333333333)
15 cmpxchg
%rbx
,%rcx
(rax
=777777777 rbx
=555555555 rcx
=555555555)
16 rax
==rcx so ecx should equal rbx
(Result rax
=555555555 rbx
=555555555 rcx
=555555555)