From b31e9b04279f2d721ec8e7dd826a1dc7e351d91a Mon Sep 17 00:00:00 2001 From: czjstmax Date: Wed, 14 Jan 2026 22:45:56 +0100 Subject: updated `.vimrc`; added random nasm util script i made idk Signed-off-by: czjstmax --- nas.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 nas.sh (limited to 'nas.sh') diff --git a/nas.sh b/nas.sh new file mode 100755 index 0000000..ac67013 --- /dev/null +++ b/nas.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +if [[ $# -lt 1 ]]; then # nas + printf "usage: nas FILEi [FILEo]\n" + printf "(!) if FILEo not specified, FILEi will be used.\n" + exit 1 +elif [[ $# -ge 2 ]]; then # nas FILEi FILEo | nas ^-h(elp)?$ || nas ^--help$ + if [[ "$1" =~ ^-h(elp)?$ || "$1" =~ ^--help$ ]]; then + # usage # ================> nas ^-h(elp)?$ || nas ^--help$ + printf "usage: nas FILEi [FILEo]\n" + printf "(!) if FILEo not specified, FILEi will be used.\n" + exit 0 + else # ================> nas FILEi FILEo + # assemble + printf ":> compiling \"%s\" (output=\"%s\")\n" "$1" "$2" + nasm -felf64 $1 -o $1.o && ld $1.o -o $2 && rm $1.o + exit 0 + fi +else + # assemble # ================> nas FILEi + printf "(!) warning: FILEo not specified. using FILEi (\"%s\") as output FILE\n" "$1" + printf ":> compiling \"%s\" (output=\"%s\")\n" "$1" "$1" + nasm -felf64 $1 -o $1.o && ld $1.o -o $1 && rm $1.o + exit 0 +fi -- cgit v1.3.1