For this lab, you will write an ARM assembly function which will take a character string, and convert it to uppercase. This function will take the character string as its only argument.
It should modify the characters in place, so that after the function is done, the letter characters at that memory address have been changed to capital ones.
You should use the C standard library toupper function to achieve this. This function takes one argument — a character — and returns a character which is the upper case version of the one it was passed. If the character passed in was not a lower case letter, then toupper returns it unchanged. Call this just with bl toupper.
Your function should loop over all of the characters in the array, calling toupper on each of them, and storing them back. When you hit the 0 character, the function should return.
Because we are calling a function from ours, we will have to be very careful of the calling convention so that we can return back, and not overwrite any registers we are not allowed to!
wget https://ianfinlayson.net/class/cpsc305/labs/uppercase.tar.gz tar xvf uppercase.tar.gz cd uppercase
gbacc uppercase.s main.c
When you are done, your program should produce the following output:
When you are done, please submit the assembly code under the assignment in Canvas.
Copyright © 2024 Ian Finlayson | Licensed under a Creative Commons BY-NC-SA 4.0 License.