Skip to content

GabriOliv/assembly-nasm-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Some Assembly x86 codes with NASM.


NASM Status Language Status Language Status

NASM Syscall Documentation


Installation

1. Clone the Repository:

(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

Compilation

Use the script .sh
  1. Give Permission

    chmod +x compile_asm.sh
  2. Run the script .sh (without ".asm")

    ./compile_asm Script_Name
  3. Run the Assembly Script .exe

    ./Script_Name.exe
Use the Default Commands
  1. mount
    nasm -f elf64 program.asm
  2. link
    ld program.o -o program
  3. execute
    ./program

List of Scripts

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