(or Download and Extract a zip HERE)
git clone https://github.com/GabriOliv/assembly-nasm-codes.git
2. Install NASM:
- If in Ubuntu 18.04:
sudo apt update sudo apt install nasm
-
Give Permission
chmod +x compile_asm.sh
-
Run the script .sh (without ".asm")
./compile_asm Script_Name
-
Run the Assembly Script .exe
./Script_Name.exe
- mount
nasm -f elf64 program.asm
- link
ld program.o -o program
- execute
./program
Listing of Scripts in this Repository
Scripts (.asm) | Description | Programming |
---|---|---|
001_Nothing | Simple Script | Simple System Call (mov, int) |
002_Output_Msg | Static Text Output | Use of static section (section .data) |
003_Input_Msg | Return user input on the screen | Text Entry Using Buffers (section .bss) |
004_Jump_Flag | Return Even or Odd | Compare (cmp), Jump (jmp) and Labels |
005_Subroutines | Return Even or Odd | Subroutine call (call) |
006_Macro_Intern | Return Even or Odd | Macro inside the same file (% macro) |
007_0_Macro_Extern | Return Even or Odd | Macro call external to the file (% include) |
007_1_Macro_Lib | Macro Library | Macro Library called by the Script "007_0_Macro_Extern" |
008_Input_Validation | Sum of Two Numbers | Input Validation using Stack (push, pop) |
009_Open_File | Return File Contents | Syscall 5 (open) |
010_Write_File | Save user input inside the File | Syscall 8 (creat) |
011_Copy_File | Copy data from one file to another | --- |
012_Uppercase | Uppercase Input Text | Using Macros in Library |
013_Lowercase | LowerCase Input Text | Using Macros in Library |
014_Change_Letter_Case | Input Text in Upper and Lower Case | Include from Macro |