From f2377d3f44f7584e2bace15b749d04e3a87c4c10 Mon Sep 17 00:00:00 2001 From: Xun Yang <x299yang@uwaterloo.ca> Date: Tue, 31 Mar 2020 17:33:23 -0400 Subject: [PATCH] assemble .s files in the output folder and run the ./main program and prints exit code to stdout --- assemble.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 assemble.sh diff --git a/assemble.sh b/assemble.sh new file mode 100644 index 0000000..42e1abd --- /dev/null +++ b/assemble.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# assemble and link +for filename in ./output/*.s; do + /u/cs444/bin/nasm -O1 -f elf -g -F dwarf $filename +done +ld -melf_i386 -o main output/*.o + +# run main +./main + +# echo the exit code +echo $? -- GitLab