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 91MOV AL,FLAT:[0x8877665544332211] 92MOV EAX,FLAT:[0x8877665544332211] 93MOV FLAT:[0x8877665544332211],AL 94MOV FLAT:[0x8877665544332211],EAX 95MOV RAX,FLAT:[0x8877665544332211] 96MOV 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 32bit addressing 116mov symbol, %eax 117 118#arithmetic 119mov symbol(%rax), %eax 120 121#RIP relative 122mov symbol(%rip), %eax 123 124.intel_syntax noprefix 125 126#immediates - various sizes: 127mov al, offset flat:symbol 128mov ax, offset flat:symbol 129mov eax, offset flat:symbol 130mov rax, offset flat:symbol 131 132#parts aren't supported by the parser, yet (and not at all for symbol refs) 133#mov eax, high part symbol 134#mov eax, low part symbol 135 136#addressing modes 137 138#absolute 32bit addressing 139mov eax, [symbol] 140 141#arithmetic 142mov eax, [rax+symbol] 143 144#RIP relative 145mov eax, [rip+symbol] 146 147foo: 148.att_syntax 149#absolute 64bit addressing 150mov 0x8877665544332211,%al 151mov 0x8877665544332211,%ax 152mov 0x8877665544332211,%eax 153mov 0x8877665544332211,%rax 154mov %al,0x8877665544332211 155mov %ax,0x8877665544332211 156mov %eax,0x8877665544332211 157mov %rax,0x8877665544332211 158movb 0x8877665544332211,%al 159movw 0x8877665544332211,%ax 160movl 0x8877665544332211,%eax 161movq 0x8877665544332211,%rax 162movb %al,0x8877665544332211 163movw %ax,0x8877665544332211 164movl %eax,0x8877665544332211 165movq %rax,0x8877665544332211 166 167#absolute signed 32bit addressing 168mov 0xffffffffff332211,%al 169mov 0xffffffffff332211,%ax 170mov 0xffffffffff332211,%eax 171mov 0xffffffffff332211,%rax 172mov %al,0xffffffffff332211 173mov %ax,0xffffffffff332211 174mov %eax,0xffffffffff332211 175mov %rax,0xffffffffff332211 176movb 0xffffffffff332211,%al 177movw 0xffffffffff332211,%ax 178movl 0xffffffffff332211,%eax 179movq 0xffffffffff332211,%rax 180movb %al,0xffffffffff332211 181movw %ax,0xffffffffff332211 182movl %eax,0xffffffffff332211 183movq %rax,0xffffffffff332211 184 185cmpxchg16b (%rax) 186 187.intel_syntax noprefix 188cmpxchg16b oword ptr [rax] 189 190.att_syntax 191 movsx %al, %si 192 movsx %al, %esi 193 movsx %al, %rsi 194 movsx %ax, %esi 195 movsx %ax, %rsi 196 movsx %eax, %rsi 197 movsx (%rax), %edx 198 movsx (%rax), %rdx 199 movsx (%rax), %dx 200 movsbl (%rax), %edx 201 movsbq (%rax), %rdx 202 movsbw (%rax), %dx 203 movswl (%rax), %edx 204 movswq (%rax), %rdx 205 206 movzx %al, %si 207 movzx %al, %esi 208 movzx %al, %rsi 209 movzx %ax, %esi 210 movzx %ax, %rsi 211 movzx (%rax), %edx 212 movzx (%rax), %rdx 213 movzx (%rax), %dx 214 movzb (%rax), %edx 215 movzb (%rax), %rdx 216 movzb (%rax), %dx 217 movzbl (%rax), %edx 218 movzbq (%rax), %rdx 219 movzbw (%rax), %dx 220 movzwl (%rax), %edx 221 movzwq (%rax), %rdx 222 223 .intel_syntax noprefix 224 movsx si,al 225 movsx esi,al 226 movsx rsi,al 227 movsx esi,ax 228 movsx rsi,ax 229 movsx rsi,eax 230 movsx edx,BYTE PTR [rax] 231 movsx rdx,BYTE PTR [rax] 232 movsx dx,BYTE PTR [rax] 233 movsx edx,WORD PTR [rax] 234 movsx rdx,WORD PTR [rax] 235 236 movzx si,al 237 movzx esi,al 238 movzx rsi,al 239 movzx esi,ax 240 movzx rsi,ax 241 movzx edx,BYTE PTR [rax] 242 movzx rdx,BYTE PTR [rax] 243 movzx dx,BYTE PTR [rax] 244 movzx edx,WORD PTR [rax] 245 movzx rdx,WORD PTR [rax] 246 247 movq xmm1,QWORD PTR [rsp] 248 movq xmm1,[rsp] 249 movq QWORD PTR [rsp],xmm1 250 movq [rsp],xmm1 251 252.att_syntax 253 fnstsw 254 fnstsw %ax 255 fstsw 256 fstsw %ax 257 258 .intel_syntax noprefix 259 fnstsw 260 fnstsw ax 261 fstsw 262 fstsw ax 263 264.att_syntax 265movsx (%rax),%ax 266movsx (%rax),%eax 267movsx (%rax),%rax 268movsxb (%rax), %dx 269movsxb (%rax), %edx 270movsxb (%rax), %rdx 271movsxw (%rax), %edx 272movsxw (%rax), %rdx 273movsxl (%rax), %rdx 274movsxd (%rax),%rax 275movzx (%rax),%ax 276movzx (%rax),%eax 277movzx (%rax),%rax 278movzxb (%rax), %dx 279movzxb (%rax), %edx 280movzxb (%rax), %rdx 281movzxw (%rax), %edx 282movzxw (%rax), %rdx 283 284movnti %eax, (%rax) 285movntil %eax, (%rax) 286movnti %rax, (%rax) 287movntiq %rax, (%rax) 288 289.intel_syntax noprefix 290 291movsx ax, BYTE PTR [rax] 292movsx eax, BYTE PTR [rax] 293movsx eax, WORD PTR [rax] 294movsx rax, WORD PTR [rax] 295movsx rax, DWORD PTR [rax] 296movsxd rax, [rax] 297movzx ax, BYTE PTR [rax] 298movzx eax, BYTE PTR [rax] 299movzx eax, WORD PTR [rax] 300movzx rax, WORD PTR [rax] 301 302movnti dword ptr [rax], eax 303movnti qword ptr [rax], rax 304