Last active
November 23, 2022 16:48
-
-
Save massihm/58e2ae3a0a33aed77456fca4ff290bdb to your computer and use it in GitHub Desktop.
assembly lib requirements for linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo add-apt-repository universe | |
sudo apt install -y libc6 libncurses5 libstdc++6 zlib1g zlib1g-dev libc6-dev-i386 g++ nasm gdb | |
sudo apt install libx32gcc-<version>-dev | |
// if you use ubunto Xenial(16.04LTS), use version 4.8 or 5 (replace <version> with 4.8 or 5) | |
// else if Bionic (18.04LTS), use version 8 | |
// and for Focal (20.04LTS), use version 10 | |
nano file.asm | |
///////////////Code//////////// | |
section .data | |
hello: db 'hello World!',10; | |
len: equ $-hello; | |
section .text | |
global main | |
main: | |
mov eax,4; | |
mov ebx,1; | |
mov ecx,hello; | |
mov edx,len; | |
int 80h; | |
mov eax,1; | |
mov ebx,0; | |
int 80h; | |
///////////////////////////// | |
nasm -f elf file.asm | |
gcc -m32 file.o | |
./file.out |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment