Skip to content

Commit

Permalink
Move requirements from test to stub file
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Nov 8, 2023
1 parent 6858ff9 commit 19c718c
Show file tree
Hide file tree
Showing 47 changed files with 151 additions and 170 deletions.
6 changes: 6 additions & 0 deletions exercises/practice/atbash-cipher/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# atbash_cipher must:
# - be named atbash_cipher and declared as global
# - read input string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write a zero-terminated string representing the return value to address given in a1
7 changes: 0 additions & 7 deletions exercises/practice/atbash-cipher/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
# s3 - char byte of input
# s4 - char byte of output
# s5 - copy of output location
#
# atbash_cipher must:
# - be named atbash_cipher and declared as global
# - read input string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write a zero-terminated string representing the return value to address given in a1

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/binary/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# binary_convert must:
# - be named binary_convert and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0
7 changes: 0 additions & 7 deletions exercises/practice/binary/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# s2 - address of expected output word
# s3 - char byte
# s4 - output word
#
# binary_convert must:
# - be named binary_convert and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/difference-of-squares/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# difference_of_squares must:
# - be named difference_of_squares and declared as global
# - read input integer from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it wants to use s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0
7 changes: 0 additions & 7 deletions exercises/practice/difference-of-squares/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# s2 - address of expected output word
# s3 - input word
# s4 - output word
#
# difference_of_squares must:
# - be named difference_of_squares and declared as global
# - read input integer from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it wants to use s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0

.data

Expand Down
7 changes: 7 additions & 0 deletions exercises/practice/grains/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# square must:
# - be named square and declared as global
# - read input integer from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it wants to use s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write low word of integer result to v0
# - write high word of integer result to v1
8 changes: 0 additions & 8 deletions exercises/practice/grains/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@
# s4 - input word
# s5 - low output word
# s6 - high output word
#
# square must:
# - be named square and declared as global
# - read input integer from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it wants to use s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write low word of integer result to v0
# - write high word of integer result to v1

.data

Expand Down
7 changes: 7 additions & 0 deletions exercises/practice/hamming/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# hamming_distance must:
# - be named hamming_distance and declared as global
# - read input address of first string from a0
# - read input address of second string from a1
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0
8 changes: 0 additions & 8 deletions exercises/practice/hamming/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
# s3 - address of expected output word
# s4 - char byte
# s5 - output word
#
# hamming_distance must:
# - be named hamming_distance and declared as global
# - read input address of first string from a0
# - read input address of second string from a1
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0

.data

Expand Down
3 changes: 3 additions & 0 deletions exercises/practice/hello-world/impl.mips
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Implement the 'hello' function, which must:
# - write address of string result to v0

.globl hello

.data
Expand Down
6 changes: 0 additions & 6 deletions exercises/practice/hello-world/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
# Test hello with some examples
#
# s1 - address of expected output word
#
# hello must:
# - be named hello and declared as global
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it wants to use s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write address of string result to v0

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/hexadecimal/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# hex_convert must:
# - be named hex_convert and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0
7 changes: 0 additions & 7 deletions exercises/practice/hexadecimal/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# s2 - address of expected output word
# s3 - char byte
# s4 - output word
#
# hex_convert must:
# - be named hex_convert and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/isbn-verifier/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# is_valid must:
# - be named is_valid and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write boolean result to v0
7 changes: 0 additions & 7 deletions exercises/practice/isbn-verifier/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# s2 - address of expected output word
# s3 - char byte
# s4 - output word
#
# is_valid must:
# - be named is_valid and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write boolean result to v0

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/isogram/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# is_isogram must:
# - be named is_isogram and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write boolean result to v0
7 changes: 0 additions & 7 deletions exercises/practice/isogram/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# s2 - address of expected output word
# s3 - char byte
# s4 - output word
#
# is_isogram must:
# - be named is_isogram and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write boolean result to v0

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/leap/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# is_leap_year must:
# - be named is_leap_year and declared as global
# - read input integer from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it wants to use s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write boolean result to v0
7 changes: 0 additions & 7 deletions exercises/practice/leap/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# s2 - address of expected output word
# s3 - input word
# s4 - output word
#
# is_leap_year must:
# - be named is_leap_year and declared as global
# - read input integer from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it wants to use s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write boolean result to v0

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/luhn/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# valid must:
# - be named valid and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write boolean result to v0
7 changes: 0 additions & 7 deletions exercises/practice/luhn/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# s2 - address of expected output word
# s3 - char byte
# s4 - output word
#
# valid must:
# - be named valid and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write boolean result to v0

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/nth-prime/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# nth_prime must:
# - be named nth_prime and declared as global
# - read prime index from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0
7 changes: 0 additions & 7 deletions exercises/practice/nth-prime/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# s2 - address of expected output word
# s3 - char byte
# s4 - output word
#
# nth_prime must:
# - be named nth_prime and declared as global
# - read prime index from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0

.data

Expand Down
7 changes: 7 additions & 0 deletions exercises/practice/nucleotide-count/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# nucleotide_counts must:
# - be named nucleotide_counts and declared as global
# - read input string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write counts for A,C,G,T to the word array with address given in a1
# - write -1 values to the array if the input is invalid
8 changes: 0 additions & 8 deletions exercises/practice/nucleotide-count/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
# s5 - copy of output location
# t0 - actual output word
# t1 - expected output word
#
# nucleotide_counts must:
# - be named nucleotide_counts and declared as global
# - read input string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write counts for A,C,G,T to the word array with address given in a1
# - write -1 values to the array if the input is invalid

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/octal/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# octal_convert must:
# - be named octal_convert and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0
7 changes: 0 additions & 7 deletions exercises/practice/octal/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# s2 - address of expected output word
# s3 - char byte
# s4 - output word
#
# octal_convert must:
# - be named octal_convert and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/pop-count/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# egg_count must:
# - be named egg_count and declared as global
# - read input integer from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it wants to use s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0
7 changes: 0 additions & 7 deletions exercises/practice/pop-count/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
# s2 - address of expected output word
# s3 - input word
# s4 - output word
#
# egg_count must:
# - be named egg_count and declared as global
# - read input integer from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it wants to use s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/raindrops/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# raindrops must:
# - be named raindrops and declared as global
# - read input value from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write a zero-terminated string representing the return value to address given in a1
7 changes: 0 additions & 7 deletions exercises/practice/raindrops/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@
# s3 - char byte of input
# s4 - char byte of output
# s5 - copy of output location
#
# raindrops must:
# - be named raindrops and declared as global
# - read input value from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write a zero-terminated string representing the return value to address given in a1

.data

Expand Down
8 changes: 8 additions & 0 deletions exercises/practice/resistor-color-duo/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# value must:
# - be named value and declared as global
# - read address of first input string from a0
# - read address of second input string from a1
# - read address of (possibly empty) third input string from a2
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0
9 changes: 0 additions & 9 deletions exercises/practice/resistor-color-duo/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@
# s4 - address of expected output word
# s5 - actual output word
# s6 - expected output word
#
# value must:
# - be named value and declared as global
# - read address of first input string from a0
# - read address of second input string from a1
# - read address of (possibly empty) third input string from a2
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0

.data

Expand Down
6 changes: 6 additions & 0 deletions exercises/practice/resistor-color/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# color_code must:
# - be named color_code and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write integer result to v0
6 changes: 6 additions & 0 deletions exercises/practice/rna-transcription/impl.mips
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# transcribe_rna must:
# - be named transcribe_rna and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write a zero-terminated string representing the return value to address given in a1
7 changes: 0 additions & 7 deletions exercises/practice/rna-transcription/runner.mips
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
# s4 - char byte of output
# s5 - counter for clearing output
# s6 - allocated output buffer
#
# transcribe_rna must:
# - be named transcribe_rna and declared as global
# - read input address of string from a0
# - follow the convention of using the t0-9 registers for temporary storage
# - (if it uses s0-7 then it is responsible for pushing existing values to the stack then popping them back off before returning)
# - write a zero-terminated string representing the return value to address given in a1

.data

Expand Down
Loading

0 comments on commit 19c718c

Please sign in to comment.