From 19c718c616e1c853d8942ad0fc6c3dd9d7c4443a Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 8 Nov 2023 19:44:41 +0100 Subject: [PATCH] Move requirements from test to stub file --- exercises/practice/atbash-cipher/impl.mips | 6 ++++++ exercises/practice/atbash-cipher/runner.mips | 7 ------- exercises/practice/binary/impl.mips | 6 ++++++ exercises/practice/binary/runner.mips | 7 ------- exercises/practice/difference-of-squares/impl.mips | 6 ++++++ exercises/practice/difference-of-squares/runner.mips | 7 ------- exercises/practice/grains/impl.mips | 7 +++++++ exercises/practice/grains/runner.mips | 8 -------- exercises/practice/hamming/impl.mips | 7 +++++++ exercises/practice/hamming/runner.mips | 8 -------- exercises/practice/hello-world/impl.mips | 3 +++ exercises/practice/hello-world/runner.mips | 6 ------ exercises/practice/hexadecimal/impl.mips | 6 ++++++ exercises/practice/hexadecimal/runner.mips | 7 ------- exercises/practice/isbn-verifier/impl.mips | 6 ++++++ exercises/practice/isbn-verifier/runner.mips | 7 ------- exercises/practice/isogram/impl.mips | 6 ++++++ exercises/practice/isogram/runner.mips | 7 ------- exercises/practice/leap/impl.mips | 6 ++++++ exercises/practice/leap/runner.mips | 7 ------- exercises/practice/luhn/impl.mips | 6 ++++++ exercises/practice/luhn/runner.mips | 7 ------- exercises/practice/nth-prime/impl.mips | 6 ++++++ exercises/practice/nth-prime/runner.mips | 7 ------- exercises/practice/nucleotide-count/impl.mips | 7 +++++++ exercises/practice/nucleotide-count/runner.mips | 8 -------- exercises/practice/octal/impl.mips | 6 ++++++ exercises/practice/octal/runner.mips | 7 ------- exercises/practice/pop-count/impl.mips | 6 ++++++ exercises/practice/pop-count/runner.mips | 7 ------- exercises/practice/raindrops/impl.mips | 6 ++++++ exercises/practice/raindrops/runner.mips | 7 ------- exercises/practice/resistor-color-duo/impl.mips | 8 ++++++++ exercises/practice/resistor-color-duo/runner.mips | 9 --------- exercises/practice/resistor-color/impl.mips | 6 ++++++ exercises/practice/rna-transcription/impl.mips | 6 ++++++ exercises/practice/rna-transcription/runner.mips | 7 ------- exercises/practice/rotational-cipher/impl.mips | 7 +++++++ exercises/practice/rotational-cipher/runner.mips | 8 -------- exercises/practice/scrabble-score/impl.mips | 6 ++++++ exercises/practice/scrabble-score/runner.mips | 7 ------- exercises/practice/square-root/impl.mips | 6 ++++++ exercises/practice/square-root/runner.mips | 7 ------- exercises/practice/triangle/impl.mips | 10 ++++++++++ exercises/practice/triangle/runner.mips | 11 ----------- exercises/practice/trinary/impl.mips | 6 ++++++ exercises/practice/trinary/runner.mips | 7 ------- 47 files changed, 151 insertions(+), 170 deletions(-) diff --git a/exercises/practice/atbash-cipher/impl.mips b/exercises/practice/atbash-cipher/impl.mips index e69de29..da4d178 100644 --- a/exercises/practice/atbash-cipher/impl.mips +++ b/exercises/practice/atbash-cipher/impl.mips @@ -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 diff --git a/exercises/practice/atbash-cipher/runner.mips b/exercises/practice/atbash-cipher/runner.mips index 22cfb5d..a473bb9 100644 --- a/exercises/practice/atbash-cipher/runner.mips +++ b/exercises/practice/atbash-cipher/runner.mips @@ -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 diff --git a/exercises/practice/binary/impl.mips b/exercises/practice/binary/impl.mips index e69de29..554446e 100644 --- a/exercises/practice/binary/impl.mips +++ b/exercises/practice/binary/impl.mips @@ -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 diff --git a/exercises/practice/binary/runner.mips b/exercises/practice/binary/runner.mips index 471ff2b..982b246 100644 --- a/exercises/practice/binary/runner.mips +++ b/exercises/practice/binary/runner.mips @@ -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 diff --git a/exercises/practice/difference-of-squares/impl.mips b/exercises/practice/difference-of-squares/impl.mips index e69de29..ccc9239 100644 --- a/exercises/practice/difference-of-squares/impl.mips +++ b/exercises/practice/difference-of-squares/impl.mips @@ -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 diff --git a/exercises/practice/difference-of-squares/runner.mips b/exercises/practice/difference-of-squares/runner.mips index 81aabe8..d1f14e9 100644 --- a/exercises/practice/difference-of-squares/runner.mips +++ b/exercises/practice/difference-of-squares/runner.mips @@ -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 diff --git a/exercises/practice/grains/impl.mips b/exercises/practice/grains/impl.mips index e69de29..f39dcdd 100644 --- a/exercises/practice/grains/impl.mips +++ b/exercises/practice/grains/impl.mips @@ -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 \ No newline at end of file diff --git a/exercises/practice/grains/runner.mips b/exercises/practice/grains/runner.mips index db91680..18d0dd2 100644 --- a/exercises/practice/grains/runner.mips +++ b/exercises/practice/grains/runner.mips @@ -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 diff --git a/exercises/practice/hamming/impl.mips b/exercises/practice/hamming/impl.mips index e69de29..7b89b8d 100644 --- a/exercises/practice/hamming/impl.mips +++ b/exercises/practice/hamming/impl.mips @@ -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 diff --git a/exercises/practice/hamming/runner.mips b/exercises/practice/hamming/runner.mips index 2c504ec..0a360c7 100644 --- a/exercises/practice/hamming/runner.mips +++ b/exercises/practice/hamming/runner.mips @@ -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 diff --git a/exercises/practice/hello-world/impl.mips b/exercises/practice/hello-world/impl.mips index 9b25045..d232bec 100644 --- a/exercises/practice/hello-world/impl.mips +++ b/exercises/practice/hello-world/impl.mips @@ -1,3 +1,6 @@ +# Implement the 'hello' function, which must: +# - write address of string result to v0 + .globl hello .data diff --git a/exercises/practice/hello-world/runner.mips b/exercises/practice/hello-world/runner.mips index e730463..10d52c2 100644 --- a/exercises/practice/hello-world/runner.mips +++ b/exercises/practice/hello-world/runner.mips @@ -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 diff --git a/exercises/practice/hexadecimal/impl.mips b/exercises/practice/hexadecimal/impl.mips index e69de29..420a1c3 100644 --- a/exercises/practice/hexadecimal/impl.mips +++ b/exercises/practice/hexadecimal/impl.mips @@ -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 diff --git a/exercises/practice/hexadecimal/runner.mips b/exercises/practice/hexadecimal/runner.mips index 8ddf3dd..e4ad8bf 100644 --- a/exercises/practice/hexadecimal/runner.mips +++ b/exercises/practice/hexadecimal/runner.mips @@ -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 diff --git a/exercises/practice/isbn-verifier/impl.mips b/exercises/practice/isbn-verifier/impl.mips index e69de29..526c900 100644 --- a/exercises/practice/isbn-verifier/impl.mips +++ b/exercises/practice/isbn-verifier/impl.mips @@ -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 diff --git a/exercises/practice/isbn-verifier/runner.mips b/exercises/practice/isbn-verifier/runner.mips index e8f6fbc..62ba7ef 100644 --- a/exercises/practice/isbn-verifier/runner.mips +++ b/exercises/practice/isbn-verifier/runner.mips @@ -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 diff --git a/exercises/practice/isogram/impl.mips b/exercises/practice/isogram/impl.mips index e69de29..349b69b 100644 --- a/exercises/practice/isogram/impl.mips +++ b/exercises/practice/isogram/impl.mips @@ -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 diff --git a/exercises/practice/isogram/runner.mips b/exercises/practice/isogram/runner.mips index 76a692e..1c4739a 100644 --- a/exercises/practice/isogram/runner.mips +++ b/exercises/practice/isogram/runner.mips @@ -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 diff --git a/exercises/practice/leap/impl.mips b/exercises/practice/leap/impl.mips index e69de29..6919428 100644 --- a/exercises/practice/leap/impl.mips +++ b/exercises/practice/leap/impl.mips @@ -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 diff --git a/exercises/practice/leap/runner.mips b/exercises/practice/leap/runner.mips index 1b5a78b..c090bea 100644 --- a/exercises/practice/leap/runner.mips +++ b/exercises/practice/leap/runner.mips @@ -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 diff --git a/exercises/practice/luhn/impl.mips b/exercises/practice/luhn/impl.mips index e69de29..faa072b 100644 --- a/exercises/practice/luhn/impl.mips +++ b/exercises/practice/luhn/impl.mips @@ -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 diff --git a/exercises/practice/luhn/runner.mips b/exercises/practice/luhn/runner.mips index 60ff90a..471bbe1 100644 --- a/exercises/practice/luhn/runner.mips +++ b/exercises/practice/luhn/runner.mips @@ -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 diff --git a/exercises/practice/nth-prime/impl.mips b/exercises/practice/nth-prime/impl.mips index e69de29..4a285cd 100644 --- a/exercises/practice/nth-prime/impl.mips +++ b/exercises/practice/nth-prime/impl.mips @@ -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 diff --git a/exercises/practice/nth-prime/runner.mips b/exercises/practice/nth-prime/runner.mips index ba248c6..68f3b79 100644 --- a/exercises/practice/nth-prime/runner.mips +++ b/exercises/practice/nth-prime/runner.mips @@ -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 diff --git a/exercises/practice/nucleotide-count/impl.mips b/exercises/practice/nucleotide-count/impl.mips index e69de29..4544385 100644 --- a/exercises/practice/nucleotide-count/impl.mips +++ b/exercises/practice/nucleotide-count/impl.mips @@ -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 diff --git a/exercises/practice/nucleotide-count/runner.mips b/exercises/practice/nucleotide-count/runner.mips index 8fe599b..10f9e8b 100644 --- a/exercises/practice/nucleotide-count/runner.mips +++ b/exercises/practice/nucleotide-count/runner.mips @@ -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 diff --git a/exercises/practice/octal/impl.mips b/exercises/practice/octal/impl.mips index e69de29..1109972 100644 --- a/exercises/practice/octal/impl.mips +++ b/exercises/practice/octal/impl.mips @@ -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 diff --git a/exercises/practice/octal/runner.mips b/exercises/practice/octal/runner.mips index 952768a..b74e89f 100644 --- a/exercises/practice/octal/runner.mips +++ b/exercises/practice/octal/runner.mips @@ -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 diff --git a/exercises/practice/pop-count/impl.mips b/exercises/practice/pop-count/impl.mips index e69de29..70f8670 100644 --- a/exercises/practice/pop-count/impl.mips +++ b/exercises/practice/pop-count/impl.mips @@ -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 diff --git a/exercises/practice/pop-count/runner.mips b/exercises/practice/pop-count/runner.mips index 6e4435d..ad4ce03 100644 --- a/exercises/practice/pop-count/runner.mips +++ b/exercises/practice/pop-count/runner.mips @@ -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 diff --git a/exercises/practice/raindrops/impl.mips b/exercises/practice/raindrops/impl.mips index e69de29..d6eafed 100644 --- a/exercises/practice/raindrops/impl.mips +++ b/exercises/practice/raindrops/impl.mips @@ -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 diff --git a/exercises/practice/raindrops/runner.mips b/exercises/practice/raindrops/runner.mips index 3d0932c..b293917 100644 --- a/exercises/practice/raindrops/runner.mips +++ b/exercises/practice/raindrops/runner.mips @@ -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 diff --git a/exercises/practice/resistor-color-duo/impl.mips b/exercises/practice/resistor-color-duo/impl.mips index e69de29..209dc2b 100644 --- a/exercises/practice/resistor-color-duo/impl.mips +++ b/exercises/practice/resistor-color-duo/impl.mips @@ -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 diff --git a/exercises/practice/resistor-color-duo/runner.mips b/exercises/practice/resistor-color-duo/runner.mips index ef85e33..8e7504f 100644 --- a/exercises/practice/resistor-color-duo/runner.mips +++ b/exercises/practice/resistor-color-duo/runner.mips @@ -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 diff --git a/exercises/practice/resistor-color/impl.mips b/exercises/practice/resistor-color/impl.mips index e69de29..df691b8 100644 --- a/exercises/practice/resistor-color/impl.mips +++ b/exercises/practice/resistor-color/impl.mips @@ -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 diff --git a/exercises/practice/rna-transcription/impl.mips b/exercises/practice/rna-transcription/impl.mips index e69de29..5acdc25 100644 --- a/exercises/practice/rna-transcription/impl.mips +++ b/exercises/practice/rna-transcription/impl.mips @@ -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 \ No newline at end of file diff --git a/exercises/practice/rna-transcription/runner.mips b/exercises/practice/rna-transcription/runner.mips index 9c13baa..9d7f246 100644 --- a/exercises/practice/rna-transcription/runner.mips +++ b/exercises/practice/rna-transcription/runner.mips @@ -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 diff --git a/exercises/practice/rotational-cipher/impl.mips b/exercises/practice/rotational-cipher/impl.mips index e69de29..fdca587 100644 --- a/exercises/practice/rotational-cipher/impl.mips +++ b/exercises/practice/rotational-cipher/impl.mips @@ -0,0 +1,7 @@ +# rotate must: +# - be named rotate and declared as global +# - read input string from a0 +# - read shift key 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 a zero-terminated string representing the return value to address given in a2 diff --git a/exercises/practice/rotational-cipher/runner.mips b/exercises/practice/rotational-cipher/runner.mips index dc08799..00efdba 100644 --- a/exercises/practice/rotational-cipher/runner.mips +++ b/exercises/practice/rotational-cipher/runner.mips @@ -12,14 +12,6 @@ # s5 - char byte of actual output # s6 - copy of output location # s7 - copy of address of expected output -# -# rotate must: -# - be named rotate and declared as global -# - read input string from a0 -# - read shift key 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 a zero-terminated string representing the return value to address given in a2 .data diff --git a/exercises/practice/scrabble-score/impl.mips b/exercises/practice/scrabble-score/impl.mips index e69de29..c998c44 100644 --- a/exercises/practice/scrabble-score/impl.mips +++ b/exercises/practice/scrabble-score/impl.mips @@ -0,0 +1,6 @@ +# scrabble_score must: +# - be named scrabble_score 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 diff --git a/exercises/practice/scrabble-score/runner.mips b/exercises/practice/scrabble-score/runner.mips index d8384df..1c1b0ae 100644 --- a/exercises/practice/scrabble-score/runner.mips +++ b/exercises/practice/scrabble-score/runner.mips @@ -6,13 +6,6 @@ # s2 - address of expected output word # s3 - char byte # s4 - output word -# -# scrabble_score must: -# - be named scrabble_score 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 diff --git a/exercises/practice/square-root/impl.mips b/exercises/practice/square-root/impl.mips index e69de29..4b28c13 100644 --- a/exercises/practice/square-root/impl.mips +++ b/exercises/practice/square-root/impl.mips @@ -0,0 +1,6 @@ +# square_root must: +# - be named square_root and declared as global +# - read radicand 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 diff --git a/exercises/practice/square-root/runner.mips b/exercises/practice/square-root/runner.mips index fcd1c97..5169f5d 100644 --- a/exercises/practice/square-root/runner.mips +++ b/exercises/practice/square-root/runner.mips @@ -5,13 +5,6 @@ # s1 - address of input word # s2 - address of expected output word # s4 - output word -# -# square_root must: -# - be named square_root and declared as global -# - read radicand 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 diff --git a/exercises/practice/triangle/impl.mips b/exercises/practice/triangle/impl.mips index e69de29..fe6d94b 100644 --- a/exercises/practice/triangle/impl.mips +++ b/exercises/practice/triangle/impl.mips @@ -0,0 +1,10 @@ +# triangle must: +# - be named triangle and declared as global +# - read input integers from a0, a1 and a2 +# - 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 result to v0 as: +# 0 - scalene +# 1 - isoceles +# 2 - equilateral +# 3 - invalid triangle diff --git a/exercises/practice/triangle/runner.mips b/exercises/practice/triangle/runner.mips index 692797a..1ff1d17 100644 --- a/exercises/practice/triangle/runner.mips +++ b/exercises/practice/triangle/runner.mips @@ -7,17 +7,6 @@ # s3 - address of side 3 # s4 - address of expected output # s5 - value of expected output -# -# triangle must: -# - be named triangle and declared as global -# - read input integers from a0, a1 and a2 -# - 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 result to v0 as: -# 0 - scalene -# 1 - isoceles -# 2 - equilateral -# 3 - invalid triangle .data diff --git a/exercises/practice/trinary/impl.mips b/exercises/practice/trinary/impl.mips index e69de29..faa7555 100644 --- a/exercises/practice/trinary/impl.mips +++ b/exercises/practice/trinary/impl.mips @@ -0,0 +1,6 @@ +# trinary_convert must: +# - be named trinary_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 diff --git a/exercises/practice/trinary/runner.mips b/exercises/practice/trinary/runner.mips index e0792ef..cac2824 100644 --- a/exercises/practice/trinary/runner.mips +++ b/exercises/practice/trinary/runner.mips @@ -6,13 +6,6 @@ # s2 - address of expected output word # s3 - char byte # s4 - output word -# -# trinary_convert must: -# - be named trinary_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