Skip to content

Instantly share code, notes, and snippets.

@AndrewBelt
Created January 11, 2014 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewBelt/8367532 to your computer and use it in GitHub Desktop.
Save AndrewBelt/8367532 to your computer and use it in GitHub Desktop.
This is a shell script that runs your NASM assembly like a scripting language. Now you can finally script in assembly!
#!/bin/sh
NASMFLAGS="-f elf64"
LDFLAGS=
path=/tmp/$(basename $1).$(date +%N)
nasm $NASMFLAGS -o $path.o $1
if [ "$?" == "0" ]; then
ld $LDFLAGS -o $path $path.o
if [ "$?" == "0" ]; then
$path
fi
fi
rm -f $path $path.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment