|
EAX
|
Accumulator
|
|
EBX
|
Base
|
|
ECX
|
Counter
|
|
EDX
|
Data
|
|
ESP
|
Stackpointer
|
|
EBP
|
Basepointer
|
|
EIP
|
Instructionpointer
|
|
ESI
|
Source Index
|
|
EDI
|
Destination Index
|
|
ECS
|
Code-Segment
|
|
EDS
|
Data-Segment
|
|
ESS
|
Stack-Segment
|
|
EES
|
Extra-Segment
|
|
-f
|
filesystem
|
|
-g
|
debugginfos
|
|
-o
|
output
|
nasm -f elf32 -g -o filename.o filename.nasm
ld -o filename filename.o
|
EAX
|
Name(EBX, ECX, EDX)
|
|
1
|
exit( int)
|
|
2
|
fork( pointer)
|
|
3
|
read( uint, char*, int)
|
|
4
|
write( uint, char*, int)
|
|
5
|
open( char *, int, int)
|
|
.text
|
Code
|
|
.data
|
initialized Data
|
|
.bss
|
uninitialized Data
|
global _start
.data
msg db "Hello World",0xa
len equ $-msg
.text
_start:
mov eax, 0x4
mov ebx, 0x1
mov ecx, msg
mov edx, len
int 0x80
exit:
mov eax, 0x1
mov ebx, 0x1
int 0x80
int Nr |
call Interrup Nr
|
call label |
jumps to label
|
ret |
returns to call
|
nop |
no operation
|
lea dest,src |
load effective addr. to dest
|
int 0x80 calls the Kernel in Linux
neg op |
two-Complement
|
not op |
invert each bit
|
and dest,source |
dest= dest source
|
or dest,source |
dest=dest source
|
xor dest, surce |
dest = dest XOR source
|
cmp op1,op2 |
Compare op1 with op2
|
test op1,op2 |
bitwise comparison
|
jmp dest |
unconditional Jump
|
je dest |
Jump if equal
|
jne dest |
Jump if not equal
|
jz dest |
Jump if zero
|
jnz dest |
Jump if not zero
|
jg dest |
Jump if greater
|
jge dest |
Jump if greater or equal
|
jl dest |
Jump if less
|
jle dest |
Jump if less or equal
|
ja, jae (above) or jb, jbe (below)
mov dest, source |
Moves Data
|
add dest, value |
Add value to dest
|
sub dest,value |
Subtract value3 from dest*
|
inc dest |
Increment dest
|
dec dest |
Decrement dest
|
mul src |
Multiply EAX and src
|
imul dest, source |
dest = dest * source
|
[label] mnemonic [operands] [;comment]
|
push source
|
Insert Value onto the stack
|
|
pop dest
|
Remove value from stack
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.