X8664 NASM Assembly Quick Reference ('Cheat Sheet') Here's the full list of ordinary integer x86 registers. The 64 bit registers are shown in red. ARM Assembly Basics Cheatsheet This ARM assembly basics cheatsheet covers registers, instructions, branching, and conditional execution. You can use it as a guideline if you’re starting out with ARM assembly and need a little refresher of the basics.
Jumps
0F82||72jb, jump if below0F83||73jnb, jump if not below0F84||74je, jump if equal0F85||75jne, jump if not equal0F86||76jbe, jump if below or equal0F87||77ja, jump if above0F83jae, jump if above or equal0F86jna, jump if not above0F82jnae, jump if not above or equal0F87jnbe, jump if not below or equal0F8Fjg, jump if greater0F8Ejng, jump if not greater0F8Djge, jump if greater or equal0F8Cjnge, jump if not greater or equal0F8Cjl, jump if less0F8Djnl, jump if not less0F8Ejle, jump if less or equal0F8Fjnle, jump if not less or equalEBjmp direcly toTests
84TestOthers
90nop, no operationThis post is just a little cheat sheet for myself on Intel & AT&T syntax.
A useful table mapping some simple instructions between the two syntaxes linked through from the GCC-Inline-Assembly-HOWTO:
Intel Code | AT&T Code |
---|---|
mov eax,1 | movl $1,%eax |
mov ebx,0ffh | movl $0xff,%ebx |
int 80h | int $0x80 |
mov ebx, eax | movl %eax, %ebx |
mov eax,[ecx] | movl (%ecx),%eax |
mov eax,[ebx+3] | movl 3(%ebx),%eax |
mov eax,[ebx+20h] | movl 0x20(%ebx),%eax |
add eax,[ebx+ecx*2h] | addl (%ebx,%ecx,0x2),%eax |
lea eax,[ebx+ecx] | leal (%ebx,%ecx),%eax |
sub eax,[ebx+ecx*4h-20h] | subl -0x20(%ebx,%ecx,0x4),%eax |
Some important points to note:
Intel X86 Assembly Cheat Sheet
- Source and destinations are flipped in opcodes.
- Intel is dest, src
- AT&T is src, dest
- AT&T decorates registers and immediates
- Registers are prefixed with a “%”
- Immediates are prefixed with a “$”. This applies to variables being passed in from C (when you’re inline).
- Intel decorates memory operands to denote the operand’s size, AT&T uses different mnemonics to accomplish the same.
- Intel syntax to dereference a memory location is “[ ]”. AT&T uses “( )”.