First Run in PowerShell (As Admin):
Set-ExecutionPolicy BypassInstall 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.ps1After setup. cd to the working directory with the assembly file and run:
afd <filename.asm> # Replace <filenmae.asm> with your filename.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.exeOR
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 --versionIf they output a version number, then continue.
If not then make sure the binaries are installed properly and added to PATH.
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\""
...
}
...
}Replace <filename> with name of file.
With list file:
nasm <filename>.asm -l <filename>.lst -o <filename>.comWithout list file:
nasm <filename>.asm -o <filename>.comEnsure AFD and the .com Binary are in the directory of command execution.
dosbox -c "mount C ." -c "C: " -c "afd <filename>.com"Replace <filename> with name of file.
With list file:
$ nasm <filename>.asm -l <filename>.lst -o <filename>.comWithout list file:
$ nasm <filename>.asm -o <filename>.comEnsure AFD and the .com Binary are in the directory of command execution.
$ dosbox -c "mount C ." -c "C: " -c "afd <filename>.com"