diff options
| author | hachem <im@hachem.wtf> | 2026-08-31 23:14:26 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-31 23:14:26 +0200 |
| commit | 9dc06d01c2224ee1dbeb11ebee7c8afecfac8b05 (patch) | |
| tree | 110fe30b5b1f228568087a8fe7b0f7e0ca43fbb1 /scripts/run.sh | |
| parent | 5b06b0e4b8effaacd23308d6a6b26c525e7d3af4 (diff) | |
feat: add support for floats through xmm registers
Diffstat (limited to 'scripts/run.sh')
| -rwxr-xr-x | scripts/run.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/run.sh b/scripts/run.sh new file mode 100755 index 0000000..6d71521 --- /dev/null +++ b/scripts/run.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +set -euo pipefail + +root="$(cd "$(dirname "$0")/.." && pwd)" +cd "$root" + +if [ $# -lt 1 ]; then + echo "usage: $(basename "$0") <file.hdass>" >&2 + exit 1 +fi + +file="$1" +name="$(basename "${file%.*}")" + +docker compose up -d >/dev/null + +docker compose exec -T -e SRC="$file" -e NAME="$name" hdass bash -c ' + set -e + cd /hdass + premake5 gmake >/dev/null + make config=debug >/dev/null + ./bin/debug-linux/hdass "$SRC" -o "/tmp/$NAME.asm" + nasm -f elf64 "/tmp/$NAME.asm" -o "/tmp/$NAME.o" + ld -e main "/tmp/$NAME.o" -o "/tmp/$NAME" + set +e + "/tmp/$NAME" + printf "\n[exit %s]\n" "$?" +' </dev/null |
