summary refs log tree commit diff
path: root/home/.local/bin/nasd
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xhome/.local/bin/nasd14
1 files changed, 14 insertions, 0 deletions
diff --git a/home/.local/bin/nasd b/home/.local/bin/nasd
new file mode 100755
index 00000000..60241395
--- /dev/null
+++ b/home/.local/bin/nasd
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -eu
+
+dir=$(mktemp -d)
+trap 'rm -r "$dir"' EXIT
+
+echo 'bits 64' >"${dir}/input"
+for ins; do
+	printf '%s\n' "$ins" >>"${dir}/input"
+done
+[ $# -eq 0 ] && cat >>"${dir}/input"
+
+nasm -o "${dir}/output" "${dir}/input"
+ndisasm -b 64 "${dir}/output"