3_test: two examples to show (sum and strncmp)
[calu.git] / 3_test / exectest.sh
index 8bb844b280cdb21e20aec48afb198fe8f3ce19c5..5d1a60b374b9fbf49d9d46706eac0ae77f7a8bdd 100755 (executable)
@@ -30,11 +30,21 @@ runsim() {
        cd ../3b_sim; ./sim -f ../3_test/$ARG2
 }
 
+runasmsim() {
+       if [ "$ARG2" == ""  ]; then
+               echo "runasm: please provide a assembler file"
+               exit 1
+       fi
+       ../3a_asm/dtas < $ARG2 > ${ARG2%.s}.dthex
+       cd ../3b_sim; ./sim -f ../3_test/${ARG2%.s}.dthex
+}
+
 case $1 in
        clean) cleantools;;
        build) buildtools;;
        asm) runasm;;
        sim) runsim;;
+       asmsim) runasmsim;;
        *) echo "first argument must be clean|build|asm <file>|sim <file>"
 esac