summaryrefslogtreecommitdiff
path: root/test/xchg.asm
blob: 9c826dd9421fa786098f2349019f596c238ede86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
;Testname=unoptimized; Arguments=-fbin -oxchg.bin -O0; Files=stdout stderr xchg.bin
;Testname=optimized;   Arguments=-fbin -oxchg.bin -Ox; Files=stdout stderr xchg.bin

%macro x 2
	xchg %1,%2
	xchg %2,%1
%endmacro

	bits 16
	
	x ax,ax
	x ax,cx
	x ax,dx
	x ax,bx
	x ax,sp
	x ax,bp
	x ax,si
	x ax,di
	x eax,eax
	x eax,ecx
	x eax,edx
	x eax,ebx
	x eax,esp
	x eax,ebp
	x eax,esi
	x eax,edi

	bits 32
	
	x ax,ax
	x ax,cx
	x ax,dx
	x ax,bx
	x ax,sp
	x ax,bp
	x ax,si
	x ax,di
	x eax,eax
	x eax,ecx
	x eax,edx
	x eax,ebx
	x eax,esp
	x eax,ebp
	x eax,esi
	x eax,edi

	bits 64
	
	x ax,ax
	x ax,cx
	x ax,dx
	x ax,bx
	x ax,sp
	x ax,bp
	x ax,si
	x ax,di
	x ax,r8w
	x ax,r9w
	x ax,r10w
	x ax,r11w
	x ax,r12w
	x ax,r13w
	x ax,r14w
	x ax,r15w
	x eax,eax
	x eax,ecx
	x eax,edx
	x eax,ebx
	x eax,esp
	x eax,ebp
	x eax,esi
	x eax,edi
	x eax,r8d
	x eax,r9d
	x eax,r10d
	x eax,r11d
	x eax,r12d
	x eax,r13d
	x eax,r14d
	x eax,r15d
	x rax,rax
	x rax,rcx
	x rax,rdx
	x rax,rbx
	x rax,rsp
	x rax,rbp
	x rax,rsi
	x rax,rdi
	x rax,r8
	x rax,r9
	x rax,r10
	x rax,r11
	x rax,r12
	x rax,r13
	x rax,r14
	x rax,r15