Skip to content

scottgriv/assembly-welcome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Assembly Badge
GitHub Badge Email Badge BuyMeACoffee Badge
Bronze


Assembly Welcome Program

Assembly Welcome Program is a simple program that prints a welcome message to the console.


Table of Contents

Getting Started

This section will guide you through the steps to get the assembly program up and running on your machine.

Prerequisites

Before you begin, ensure you have the following installed:

  • NASM (Netwide Assembler): For assembling the .asm file.
  • A Linux environment: The program is designed to run on Linux.
  • A text editor: To view or modify the source code.

Assembling the Program

  1. Open Terminal: Open your terminal in the directory where your .asm file is located.
  2. Assemble the Code: Use NASM to assemble the .asm file.
  3. Since the file is named welcome.asm, the command will be:
nasm -f elf32 welcome.asm -o myprogram.o

This command creates an object file named myprogram.o.

Linking the Object File

  1. Link the Object File: Next, link the object file to create an executable. The following command links myprogram.o to create an executable named myprogram:
ld -m elf_i386 -s -o myprogram myprogram.o

-m elf_i386 specifies that the program is for 32-bit architecture.

Running the Program

  1. Execute the Program: Run the program by typing:
./myprogram

Upon execution, the program will display the message defined in the .data section of your assembly code.

Troubleshooting

  • If you encounter permission issues while executing, you may need to change the permissions of the executable using chmod +x myprogram.
  • Ensure that the NASM syntax matches the version you are using, as there might be slight differences in syntax across different versions.

Resources

License

This project is released under the terms of The Unlicense, which allows you to use, modify, and distribute the code as you see fit.

  • The Unlicense removes traditional copyright restrictions, giving you the freedom to use the code in any way you choose.
  • For more details, see the LICENSE file in this repository.

Credits

Author: Scott Grivner
Email: scott.grivner@gmail.com
Website: scottgrivner.dev
Reference: Main Branch