Skip to content

Instantly share code, notes, and snippets.

@alexander-hanel
Created July 4, 2018 02:01
Show Gist options
  • Save alexander-hanel/0f9e0b99182f736b17b7924c8105fc0a to your computer and use it in GitHub Desktop.
Save alexander-hanel/0f9e0b99182f736b17b7924c8105fc0a to your computer and use it in GitHub Desktop.
compile asm using nasm and execute it
#!/bin/bash
INPUT=$1
name=${INPUT%.*}
ncmd=$(printf "nasm -f elf64 %s" "$INPUT")
eval $ncmd
ll=$(printf "ld %s.o -o %s" "$name" "$name")
eval $ll
tt=$(printf "chmod +x %s" "$name")
xx=$(printf "./%s" "$name")
eval $xx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment