Skip to content

Instantly share code, notes, and snippets.

@ianklatzco
Last active June 16, 2016 21:14
Show Gist options
  • Save ianklatzco/930f05a220305df89054da20cd615e01 to your computer and use it in GitHub Desktop.
Save ianklatzco/930f05a220305df89054da20cd615e01 to your computer and use it in GitHub Desktop.
test if lab2 for ECE220 works. download em into the directory containing your lab2.obj, chmod +x both of them, run "hexGenerator.sh > hex" and "test.sh > test" and then "diff test hex". if you get no output, you're golden.
#!/bin/bash
max=65535
for((i=0;i<=max;i++))
do
printf "%.4X\n" $i
done
#!/bin/bash
max=65535
for((i=0;i<=max;i++))
do
x=$(printf "%.4X\n" $i)
printf "r R5 $x\nc" | lc3sim lab2 | grep "(lc3sim) $x" | cut -d " " -f 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment