Skip to content

Ctrl-Zack/assembly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

assembly

Notes

mov eax, 1
mov ebx, 1
int 80h

calling linux system call:
eax -> 1 = sys_exit
ebx -> 1 = exit status

in windows it is equivalent to

extern ExitProcess

call ExitProcess

compile it using:

nasm -f win64 $*.asm -o $*.obj
gcc -nostdlib $*.obj -lkernel32 -o $*.exe


Linux:

  • Compile
nasm -f elf -o bin/$*.o src/$*.asm
ld -m elf_i386 -o bin/$* bin/$*.o
  • Standard C Functions
nasm -f elf -o $*.o $*.asm
gcc -no-pie -m32 $*.o -o $*
  • calling C Functions
nasm -f elf -o $*.o $*.asm
gcc -no-pie -m32 $*.o {c_filename}.c -o $*

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published