From f67834dd18859ed333c88360f4141a99dc7db5dd Mon Sep 17 00:00:00 2001 From: manuel Date: Thu, 28 May 2009 19:22:52 +0200 Subject: push for me --- ue4/mycpu/test/test.sh | 11 +++++++++-- ue4/mycpu/test/test1_args | 1 + ue4/mycpu/test/test2_args | 1 + ue4/mycpu/test/test2_memory | 1 + ue4/mycpu/test/test2_output | 19 +++++++++++++++++++ ue4/mycpu/test/test2_program | 13 +++++++++++++ ue4/mycpu/test/test3_args | 1 + ue4/mycpu/test/test3_memory | 1 + ue4/mycpu/test/test3_output | 21 +++++++++++++++++++++ ue4/mycpu/test/test3_program | 13 +++++++++++++ 10 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 ue4/mycpu/test/test1_args create mode 100644 ue4/mycpu/test/test2_args create mode 100644 ue4/mycpu/test/test2_memory create mode 100644 ue4/mycpu/test/test2_output create mode 100644 ue4/mycpu/test/test2_program create mode 100644 ue4/mycpu/test/test3_args create mode 100644 ue4/mycpu/test/test3_memory create mode 100644 ue4/mycpu/test/test3_output create mode 100644 ue4/mycpu/test/test3_program (limited to 'ue4/mycpu/test') diff --git a/ue4/mycpu/test/test.sh b/ue4/mycpu/test/test.sh index ff1076c..43ddb9a 100755 --- a/ue4/mycpu/test/test.sh +++ b/ue4/mycpu/test/test.sh @@ -10,13 +10,20 @@ do programfile="$input" args="-c $programfile" + argsfile="${input/_program/_args}" memoryfile="${input/_program/_memory}" reffile="${input/_program/_output}" - if [ -e "$memoryfile" ] + + if [ ! -e "$argsfile" ] then - args+=" -m $memoryfile" + echo " ERROR: argsfile $argsfile doesn't exist" + exit 1 fi + args=$(cat "$argsfile") + args=${args/\#program\#/$input} + args=${args/\#memory\#/$memoryfile} + if [ ! -e "$reffile" ] then echo " ERROR: reference file $reffile doesn't exist" diff --git a/ue4/mycpu/test/test1_args b/ue4/mycpu/test/test1_args new file mode 100644 index 0000000..c494f4e --- /dev/null +++ b/ue4/mycpu/test/test1_args @@ -0,0 +1 @@ +-c #program# -m #memory# diff --git a/ue4/mycpu/test/test2_args b/ue4/mycpu/test/test2_args new file mode 100644 index 0000000..1ef5766 --- /dev/null +++ b/ue4/mycpu/test/test2_args @@ -0,0 +1 @@ +-f s -c #program# -m #memory# diff --git a/ue4/mycpu/test/test2_memory b/ue4/mycpu/test/test2_memory new file mode 100644 index 0000000..bd9648e --- /dev/null +++ b/ue4/mycpu/test/test2_memory @@ -0,0 +1 @@ +oooooooooooooooooooo diff --git a/ue4/mycpu/test/test2_output b/ue4/mycpu/test/test2_output new file mode 100644 index 0000000..ac30dc2 --- /dev/null +++ b/ue4/mycpu/test/test2_output @@ -0,0 +1,19 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 diff --git a/ue4/mycpu/test/test2_program b/ue4/mycpu/test/test2_program new file mode 100644 index 0000000..ae5e9d2 --- /dev/null +++ b/ue4/mycpu/test/test2_program @@ -0,0 +1,13 @@ +# set R2 = 10 +LOAD R2, R1 + +# start of loop +label Loop: +inc R3 +sub R4, R3, R2 +test R4 +jumpz EndLoop +write WDEZ, R3 +jumpa Loop + +label EndLoop: diff --git a/ue4/mycpu/test/test3_args b/ue4/mycpu/test/test3_args new file mode 100644 index 0000000..098d137 --- /dev/null +++ b/ue4/mycpu/test/test3_args @@ -0,0 +1 @@ +-f 5 -c #program# -m #memory# diff --git a/ue4/mycpu/test/test3_memory b/ue4/mycpu/test/test3_memory new file mode 100644 index 0000000..fa8f08c --- /dev/null +++ b/ue4/mycpu/test/test3_memory @@ -0,0 +1 @@ +150 diff --git a/ue4/mycpu/test/test3_output b/ue4/mycpu/test/test3_output new file mode 100644 index 0000000..d4de868 --- /dev/null +++ b/ue4/mycpu/test/test3_output @@ -0,0 +1,21 @@ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 diff --git a/ue4/mycpu/test/test3_program b/ue4/mycpu/test/test3_program new file mode 100644 index 0000000..ae5e9d2 --- /dev/null +++ b/ue4/mycpu/test/test3_program @@ -0,0 +1,13 @@ +# set R2 = 10 +LOAD R2, R1 + +# start of loop +label Loop: +inc R3 +sub R4, R3, R2 +test R4 +jumpz EndLoop +write WDEZ, R3 +jumpa Loop + +label EndLoop: -- cgit v1.2.3