Skip to content

A preconfigured development environment for x86/x64 NASM assembly programming on Windows, featuring NASM and GoLink.

License

Notifications You must be signed in to change notification settings

tis-starlight/NASM-Starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NASM-Starter

A preconfigured development environment for x86/x64 NASM Assembly programming on Windows.

Note

The repository includes unmodified executables from the official sources, placed in tools\ for convenience:

If you prefer to download them directly from the official sources, visit NASM and GoLink and replace the files in tools\ as needed.

Tip

For an in-depth guide on assembly language and environment setup, check out my website.

Getting Started

  1. Clone or Download the Repository

    • Clone the repository using Git:

      git clone https://github.com/tis-starlight/NASM-Starter.git
    • Alternatively, download it as a ZIP file and extract it.

  2. Write Your Code

    • Place your assembly source files in the appropriate directory based on the target architecture:
      • src\x86\ for 32-bit programs
      • src\x64\ for 64-bit programs
    • Ensure the source files have the .asm extension.
  3. Build the Program

    When running commands from the root directory, you must specify the relative path, such as tools\nasm or scripts\build_x86.bat. However, if you navigate to the appropriate directory first, you can run the command directly, like nasm or build_x86.bat.

    • Using Scripts (automated assembly, linking, and execution):

      # For x86 (32-bit)
      scripts\build_x86.bat {filename_without_extension}
      
      # For x64 (64-bit)
      scripts\build_x64.bat {filename_without_extension}

      You can modify the build scripts as needed. Use clean.bat to remove build artifacts.

    • Manual Build Process:

      # x64 (64-bit) - Assemble, Link, and Run
      tools\nasm -f win64 src\x64\hello64.asm -o obj\x64\hello64.obj
      tools\golink /entry:_start /console obj\x64\hello64.obj /fo bin\x64\hello64.exe kernel32.dll
      bin\x64\hello64.exe
      
      # x86 (32-bit) - Assemble, Link, and Run
      tools\nasm -f win32 src\x86\hello32.asm -o obj\x86\hello32.obj
      tools\golink /entry:_start /console obj\x86\hello32.obj /fo bin\x86\hello32.exe kernel32.dll
      bin\x86\hello32.exe

Repository Structure

NASM-Starter/
├── .vscode/
│   ├── settings.json
│   └── extensions.json
├── src/
│   ├── x86/             # 32-bit code
│   └── x64/             # 64-bit code
├── obj/
│   ├── x86/             # 32-bit objects
│   └── x64/             # 64-bit objects
├── bin/
│   ├── x86/             # 32-bit binaries
│   └── x64/             # 64-bit binaries
├── tools/
│   ├── nasm.exe
│   └── GoLink.exe
├── scripts/
│   ├── build_x86.bat    # 32-bit build
│   ├── build_x64.bat    # 64-bit build
│   └── clean.bat
├── .editorconfig
├── .gitattributes
├── .gitignore
├── LICENSE
└── README.md

About

A preconfigured development environment for x86/x64 NASM assembly programming on Windows, featuring NASM and GoLink.

Topics

Resources

License

Stars

Watchers

Forks