diff options
| author | manuel <manuel@nc8430.lan> | 2009-05-28 19:22:52 +0200 |
|---|---|---|
| committer | manuel <manuel@nc8430.lan> | 2009-05-28 19:22:52 +0200 |
| commit | f67834dd18859ed333c88360f4141a99dc7db5dd (patch) | |
| tree | f668d395e258ce9601ddde380b85e9369265dedb /ue4/mycpu/test | |
| parent | 064eaaed391835d0e0d057466f6f552e43e79bd8 (diff) | |
| download | ooprog-f67834dd18859ed333c88360f4141a99dc7db5dd.tar.gz ooprog-f67834dd18859ed333c88360f4141a99dc7db5dd.tar.bz2 ooprog-f67834dd18859ed333c88360f4141a99dc7db5dd.zip | |
push for me
Diffstat (limited to 'ue4/mycpu/test')
| -rwxr-xr-x | ue4/mycpu/test/test.sh | 11 | ||||
| -rw-r--r-- | ue4/mycpu/test/test1_args | 1 | ||||
| -rw-r--r-- | ue4/mycpu/test/test2_args | 1 | ||||
| -rw-r--r-- | ue4/mycpu/test/test2_memory | 1 | ||||
| -rw-r--r-- | ue4/mycpu/test/test2_output | 19 | ||||
| -rw-r--r-- | ue4/mycpu/test/test2_program | 13 | ||||
| -rw-r--r-- | ue4/mycpu/test/test3_args | 1 | ||||
| -rw-r--r-- | ue4/mycpu/test/test3_memory | 1 | ||||
| -rw-r--r-- | ue4/mycpu/test/test3_output | 21 | ||||
| -rw-r--r-- | ue4/mycpu/test/test3_program | 13 |
10 files changed, 80 insertions, 2 deletions
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 | |||
| 10 | 10 | ||
| 11 | programfile="$input" | 11 | programfile="$input" |
| 12 | args="-c $programfile" | 12 | args="-c $programfile" |
| 13 | argsfile="${input/_program/_args}" | ||
| 13 | memoryfile="${input/_program/_memory}" | 14 | memoryfile="${input/_program/_memory}" |
| 14 | reffile="${input/_program/_output}" | 15 | reffile="${input/_program/_output}" |
| 15 | if [ -e "$memoryfile" ] | 16 | |
| 17 | if [ ! -e "$argsfile" ] | ||
| 16 | then | 18 | then |
| 17 | args+=" -m $memoryfile" | 19 | echo " ERROR: argsfile $argsfile doesn't exist" |
| 20 | exit 1 | ||
| 18 | fi | 21 | fi |
| 19 | 22 | ||
| 23 | args=$(cat "$argsfile") | ||
| 24 | args=${args/\#program\#/$input} | ||
| 25 | args=${args/\#memory\#/$memoryfile} | ||
| 26 | |||
| 20 | if [ ! -e "$reffile" ] | 27 | if [ ! -e "$reffile" ] |
| 21 | then | 28 | then |
| 22 | echo " ERROR: reference file $reffile doesn't exist" | 29 | 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 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 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 @@ | |||
| 1 | # set R2 = 10 | ||
| 2 | LOAD R2, R1 | ||
| 3 | |||
| 4 | # start of loop | ||
| 5 | label Loop: | ||
| 6 | inc R3 | ||
| 7 | sub R4, R3, R2 | ||
| 8 | test R4 | ||
| 9 | jumpz EndLoop | ||
| 10 | write WDEZ, R3 | ||
| 11 | jumpa Loop | ||
| 12 | |||
| 13 | 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 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 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 @@ | |||
| 1 | # set R2 = 10 | ||
| 2 | LOAD R2, R1 | ||
| 3 | |||
| 4 | # start of loop | ||
| 5 | label Loop: | ||
| 6 | inc R3 | ||
| 7 | sub R4, R3, R2 | ||
| 8 | test R4 | ||
| 9 | jumpz EndLoop | ||
| 10 | write WDEZ, R3 | ||
| 11 | jumpa Loop | ||
| 12 | |||
| 13 | label EndLoop: | ||
