File: xchg.asm

package info (click to toggle)
nasm 3.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,660 kB
  • sloc: ansic: 129,101; asm: 40,471; perl: 8,238; sh: 4,146; makefile: 1,281; xml: 726; python: 582; lisp: 578; sed: 11
file content (151 lines) | stat: -rw-r--r-- 1,673 bytes parent folder | download | duplicates (2)
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
;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
	xchg %2,%2
	xchg %2,MEM
	xchg MEM,%2
%endmacro

	bits 16
%define MEM [bx]
	x al,al
	x al,cl
	x al,dl
	x al,bl
	x al,ah
	x al,ch
	x al,dh
	x al,bh
	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 bx,dx
	x cx,dx
	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 ebx,edx
	x ecx,edx

	bits 32
%define MEM [ebx]
	align 64
	x al,al
	x al,cl
	x al,dl
	x al,bl
	x al,ah
	x al,ch
	x al,dh
	x al,bh
	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 bx,dx
	x cx,dx
	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 ebx,edx
	x ecx,edx

	bits 64
%define MEM [rbx]
	align 64
	x al,al
	x al,cl
	x al,dl
	x al,bl
	x al,ah
	x al,ch
	x al,dh
	x al,bh
	x al,spl
	x al,bpl
	x al,sil
	x al,dil
	x al,r8b
	x al,r9b
	x al,r10b
	x al,r11b
	x al,r12b
	x al,r13b
	x al,r14b
	x al,r15b
	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 bx,dx
	x cx,dx
	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 ebx,edx
	x ecx,edx
	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
	x rbx,rdx
	x rcx,rdx