diff --git a/build.sh b/build.sh deleted file mode 100755 index efabb8c..0000000 --- a/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -set -euo pipefail - -BUILD_DIR="build" -SRC_DIR="src" -mkdir -p "$BUILD_DIR" - -echo "==> Compiling Zig files to shared libraries..." - -for asmfile in "$SRC_DIR"/*.s; do - [ -f "$asmfile" ] || continue - name=$(basename "$asmfile" .s) - echo " compiling $asmfile -> $BUILD_DIR/$name.o" - as "$asmfile" -o $BUILD_DIR/$name.o -done - -echo "==> Done. Libraries in $BUILD_DIR/" -ls -la "$BUILD_DIR"/ diff --git a/src/exit.s b/src/exit.s index 6de5f94..357ad16 100644 --- a/src/exit.s +++ b/src/exit.s @@ -1,7 +1,3 @@ -.intel_syntax noprefix -.global exit -.text - exit: - mov rax, 60 + mov rax, 60 syscall diff --git a/src/fopen.s b/src/fopen.s index 73ebfa0..e12d909 100644 --- a/src/fopen.s +++ b/src/fopen.s @@ -1,8 +1,4 @@ -.intel_syntax noprefix -.global fopen -.text - fopen: - mov rax, 2 + mov rax, 2 syscall ret diff --git a/src/lib.az b/src/lib.az index 520d507..003612a 100644 --- a/src/lib.az +++ b/src/lib.az @@ -1,4 +1,3 @@ - enum FD Stdin Stdout @@ -12,16 +11,12 @@ enum FMODE NoCreate Create -@link("./sdk/build/exit.o") +@link("./sdk/src/exit.s") op exit(const int val): void -@link("./sdk/build/write.o") +@link("./sdk/src/write.s") op write(FD fd,const str val,const int size): void -@link("./sdk/build/fopen.o") +@link("./sdk/src/fopen.s") op fopen(const str val, FLAG flag, FMODE mode): File - -@link("./sdk/build/read.o") -op read(File file, const int size): str - diff --git a/src/write.s b/src/write.s index 290a8cf..7c2a7b6 100644 --- a/src/write.s +++ b/src/write.s @@ -1,10 +1,4 @@ -.intel_syntax noprefix -.global write -.text - write: - mov rax, 1 + mov rax, 1 syscall ret - -