1.text
2.intel_syntax noprefix
3# REX prefix and addressing modes.
4add edx,ecx
5add edx,r9d
6add r10d,ecx
7add rdx,rcx
8add r10,r9
9add r8d,eax
10add r8w,ax
11add r8,rax
12add eax,0x44332211
13add rax,0xfffffffff4332211
14add ax,0x4433
15add rax,0x44332211
16add dl,cl
17add bh,dh
18add dil,sil
19add r15b,sil
20add dil,r14b
21add r15b,r14b
22PUSH RAX
23PUSH R8
24POP R9
25ADD AL,0x11
26ADD AH,0x11
27ADD SPL,0x11
28ADD R8B,0x11
29ADD R12B,0x11
30MOV RAX,CR0
31MOV R8,CR0
32MOV RAX,CR8
33MOV CR8,RAX
34REP MOVSQ #[RSI],[RDI]
35REP MOVSW #[RSI,[RDI]
36REP MOVSQ #[RSI],[RDI]
37MOV AL, 0x11
38MOV AH, 0x11
39MOV SPL, 0x11
40MOV R12B, 0x11
41MOV EAX,0x11223344
42MOV R8D,0x11223344
43MOV RAX,0x1122334455667788
44MOV R8,0x1122334455667788
45add eax,[rax]
46ADD EAX,[R8]
47ADD R8D,[R8]
48ADD RAX,[R8]
49ADD EAX,[0x22222222+RIP]
50ADD EAX,[RBP+0x00]
51ADD EAX,FLAT:[0x22222222]
52ADD EAX,[R13+0]
53ADD EAX,[RAX+RAX*4]
54ADD EAX,[R8+RAX*4]
55ADD R8D,[R8+RAX*4]
56ADD EAX,[R8+R8*4]
57ADD [RCX+R8*4],R8D
58ADD EDX,[RAX+RAX*8]
59ADD EDX,[RAX+RCX*8]
60ADD EDX,[RAX+RDX*8]
61ADD EDX,[RAX+RBX*8]
62ADD EDX,[RAX]
63ADD EDX,[RAX+RBP*8]
64ADD EDX,[RAX+RSI*8]
65ADD EDX,[RAX+RDI*8]
66ADD EDX,[RAX+R8*8]
67ADD EDX,[RAX+R9*8]
68ADD EDX,[RAX+R10*8]
69ADD EDX,[RAX+R11*8]
70ADD EDX,[RAX+R12*8]
71ADD EDX,[RAX+R13*8]
72ADD EDX,[RAX+R14*8]
73ADD EDX,[RAX+R15*8]
74ADD ECX,0x11
75ADD DWORD PTR [RAX],0x11
76ADD QWORD PTR [RAX],0x11
77ADD DWORD PTR [R8],0x11
78ADD DWORD PTR [RCX+RAX*4],0x11
79ADD DWORD PTR [R9+RAX*4],0x11
80ADD DWORD PTR [RCX+R8*4],0x11
81ADD DWORD PTR [0x22222222+RIP],0x33
82ADD QWORD PTR [RIP+0x22222222],0x33
83ADD DWORD PTR [RIP+0x22222222],0x33333333
84ADD QWORD PTR [RIP+0x22222222],0x33333333
85ADD DWORD PTR [RAX*8+0x22222222],0x33
86ADD DWORD PTR [RAX+0x22222222],0x33
87ADD DWORD PTR [RAX+0x22222222],0x33
88ADD DWORD PTR [R8+RBP*8],0x33
89ADD DWORD PTR FLAT:[0x22222222],0x33
90#new instructions
91MOVABS AL,FLAT:[0x8877665544332211]
92MOVABS EAX,FLAT:[0x8877665544332211]
93MOVABS FLAT:[0x8877665544332211],AL
94MOVABS FLAT:[0x8877665544332211],EAX
95MOVABS RAX,FLAT:[0x8877665544332211]
96MOVABS FLAT:[0x8877665544332211],RAX
97cqo
98cdqe
99movsx rax, eax
100movsx rax, ax
101movsx rax, al
102bar:
103.att_syntax
104#testcase for symbol references.
105
106#immediates - various sizes:
107
108mov $symbol, %al
109mov $symbol, %ax
110mov $symbol, %eax
111mov $symbol, %rax
112
113#addressing modes:
114
115#absolute 64bit addressing
116movabs symbol, %eax
117
118#absolute 32bit addressing
119mov symbol, %eax
120
121#arithmetic
122mov symbol(%rax), %eax
123
124#RIP relative
125mov symbol(%rip), %eax
126
127.intel_syntax noprefix
128
129#immediates - various sizes:
130mov al, offset flat:symbol
131mov ax, offset flat:symbol
132mov eax, offset flat:symbol
133mov rax, offset flat:symbol
134
135#parts aren't supported by the parser, yet (and not at all for symbol refs)
136#mov eax, high part symbol
137#mov eax, low part symbol
138
139#addressing modes
140
141#absolute 64bit addressing
142movabs eax, [symbol]
143
144#absolute 32bit addressing
145mov eax, [symbol]
146
147#arithmetic
148mov eax, [rax+symbol]
149
150#RIP relative
151mov eax, [rip+symbol]
152
153foo:
154.att_syntax
155#absolute 64bit addressing
156mov 0x8877665544332211,%al
157mov 0x8877665544332211,%ax
158mov 0x8877665544332211,%eax
159mov 0x8877665544332211,%rax
160mov %al,0x8877665544332211
161mov %ax,0x8877665544332211
162mov %eax,0x8877665544332211
163mov %rax,0x8877665544332211
164movb 0x8877665544332211,%al
165movw 0x8877665544332211,%ax
166movl 0x8877665544332211,%eax
167movq 0x8877665544332211,%rax
168movb %al,0x8877665544332211
169movw %ax,0x8877665544332211
170movl %eax,0x8877665544332211
171movq %rax,0x8877665544332211
172
173#absolute signed 32bit addressing
174mov 0xffffffffff332211,%al
175mov 0xffffffffff332211,%ax
176mov 0xffffffffff332211,%eax
177mov 0xffffffffff332211,%rax
178mov %al,0xffffffffff332211
179mov %ax,0xffffffffff332211
180mov %eax,0xffffffffff332211
181mov %rax,0xffffffffff332211
182movb 0xffffffffff332211,%al
183movw 0xffffffffff332211,%ax
184movl 0xffffffffff332211,%eax
185movq 0xffffffffff332211,%rax
186movb %al,0xffffffffff332211
187movw %ax,0xffffffffff332211
188movl %eax,0xffffffffff332211
189movq %rax,0xffffffffff332211
190
191cmpxchg16b (%rax)
192
193.intel_syntax noprefix
194cmpxchg16b oword ptr [rax]
195
196.att_syntax
197	movsx	%al, %si
198	movsx	%al, %esi
199	movsx	%al, %rsi
200	movsx	%ax, %esi
201	movsx	%ax, %rsi
202	movsx	%eax, %rsi
203	movsx	(%rax), %edx
204	movsx	(%rax), %rdx
205	movsx	(%rax), %dx
206	movsbl	(%rax), %edx
207	movsbq	(%rax), %rdx
208	movsbw	(%rax), %dx
209	movswl	(%rax), %edx
210	movswq	(%rax), %rdx
211
212	movzx	%al, %si
213	movzx	%al, %esi
214	movzx	%al, %rsi
215	movzx	%ax, %esi
216	movzx	%ax, %rsi
217	movzx	(%rax), %edx
218	movzx	(%rax), %rdx
219	movzx	(%rax), %dx
220	movzb	(%rax), %edx
221	movzb	(%rax), %rdx
222	movzb	(%rax), %dx
223	movzbl	(%rax), %edx
224	movzbq	(%rax), %rdx
225	movzbw	(%rax), %dx
226	movzwl	(%rax), %edx
227	movzwq	(%rax), %rdx
228
229	.intel_syntax noprefix
230	movsx	si,al
231	movsx	esi,al
232	movsx	rsi,al
233	movsx	esi,ax
234	movsx	rsi,ax
235	movsx	rsi,eax
236	movsx	edx,BYTE PTR [rax]
237	movsx	rdx,BYTE PTR [rax]
238	movsx	dx,BYTE PTR [rax]
239	movsx	edx,WORD PTR [rax]
240	movsx	rdx,WORD PTR [rax]
241
242	movzx	si,al
243	movzx	esi,al
244	movzx	rsi,al
245	movzx	esi,ax
246	movzx	rsi,ax
247	movzx	edx,BYTE PTR [rax]
248	movzx	rdx,BYTE PTR [rax]
249	movzx	dx,BYTE PTR [rax]
250	movzx	edx,WORD PTR [rax]
251	movzx	rdx,WORD PTR [rax]
252
253	movq	xmm1,QWORD PTR [rsp]
254	movq	xmm1,[rsp]
255	movq	QWORD PTR [rsp],xmm1
256	movq	[rsp],xmm1
257
258.att_syntax
259	fnstsw
260	fnstsw	%ax
261	fstsw
262	fstsw	%ax
263
264	.intel_syntax noprefix
265	fnstsw
266	fnstsw	ax
267	fstsw
268	fstsw	ax
269
270.att_syntax
271movsx (%rax),%ax
272movsx (%rax),%eax
273movsx (%rax),%rax
274movsxb	(%rax), %dx
275movsxb	(%rax), %edx
276movsxb	(%rax), %rdx
277movsxw	(%rax), %edx
278movsxw	(%rax), %rdx
279movsxl	(%rax), %rdx
280movsxd (%rax),%rax
281movzx (%rax),%ax
282movzx (%rax),%eax
283movzx (%rax),%rax
284movzxb	(%rax), %dx
285movzxb	(%rax), %edx
286movzxb	(%rax), %rdx
287movzxw	(%rax), %edx
288movzxw	(%rax), %rdx
289
290movnti %eax, (%rax)
291movntil %eax, (%rax)
292movnti %rax, (%rax)
293movntiq %rax, (%rax)
294
295.intel_syntax noprefix
296
297movsx ax, BYTE PTR [rax]
298movsx eax, BYTE PTR [rax]
299movsx eax, WORD PTR [rax]
300movsx rax, WORD PTR [rax]
301movsx rax, DWORD PTR [rax]
302movsxd rax, [rax]
303movzx ax, BYTE PTR [rax]
304movzx eax, BYTE PTR [rax]
305movzx eax, WORD PTR [rax]
306movzx rax, WORD PTR [rax]
307
308movnti dword ptr [rax], eax
309movnti qword ptr [rax], rax
310