Skip to content

Latest commit

 

History

History
149 lines (105 loc) · 3.36 KB

README.md

File metadata and controls

149 lines (105 loc) · 3.36 KB

Contents

Easy Installation

Windows - Easy Installation

First Run in PowerShell (As Admin):

Set-ExecutionPolicy Bypass

Install winget, if not installed already.

Run in PowerShell (Non Admin):

curl "https://raw.githubusercontent.com/AbdullahBRashid/Assembly-Tools/main/afd-setup.ps1" -o ./afd-setup.ps1
powershell ./afd-setup.ps1

After setup. cd to the working directory with the assembly file and run:

afd <filename.asm> # Replace <filenmae.asm> with your filename.

Prerequisites

Download AFD and copy it to $HOME to follow easily.

OR

Run in terminal:

curl "https://raw.githubusercontent.com/AbdullahBRashid/Assembly-Tools/main/afd.exe" -o $HOME/afd.exe

OR

Run in terminal:

# PATH to AFD
# Add the downloaded AFD Path.
set PathName = 
if (PathName != "") {
    copy PathName $HOME
} else {
    echo "Please fix the PathName variable correctly."
}

Download Netwide Assembler (NASM), and add it to PATH.
Download DosBox, and add it to PATH.

Note: As of writing this DosBox SourceForge page is not functioning.
Softonic seems to be providing a valid download. Download at your own risk.

Reopen terminal and run:

$ nasm --version
$ dosbox --version

If they output a version number, then continue.
If not then make sure the binaries are installed properly and added to PATH.

Usages

VS Code - Code Runner

Command for: Copy AFD, Compile using NASM and Run with AFD in DosBox

AFD Binary should be in Home Directory of User. To change: (Replace copy $HOME/afd.exe to copy <path-to-afd>).

Download Code Runner Extension in VS Code.

Copy the below snippet in settings.json file.

{
    ...
    "code-runner.executorMapByFileExtension": {
        ...
        ".asm": "copy $HOME/afd.exe && nasm $fileName -l $fileNameWithoutExt.lst -o $fileNameWithoutExt.com && dosbox -c \"mount C .\" -c \"C:\" -c \"afd $fileNameWithoutExt.com\""
        ...
    }
    ...
}

Windows Shell

Replace <filename> with name of file.

Compiling

With list file:

nasm <filename>.asm -l <filename>.lst -o <filename>.com

Without list file:

nasm <filename>.asm -o <filename>.com

Running AFD with DosBox

Ensure AFD and the .com Binary are in the directory of command execution.

dosbox -c "mount C ." -c "C: " -c "afd <filename>.com"

Linux Shell

Replace <filename> with name of file.

Compiling

With list file:

$ nasm <filename>.asm -l <filename>.lst -o <filename>.com

Without list file:

$ nasm <filename>.asm -o <filename>.com

Running AFD with DosBox

Ensure AFD and the .com Binary are in the directory of command execution.

$ dosbox -c "mount C ." -c "C: " -c "afd <filename>.com"