Some Risc-V assembly exercises from the discipline Computer Architecture and Organization. Each exercise statement is presented below and the correpondent solution in the file "ex_.asm".
Exercise 1: Read an integer from the keyboard and write it on the console. End the program with the system call.
Exercise 2: Read two integers from the keyboard and write the result of their sum on the console.
Exercise 3: Read a sequence of keyboard integers, add them up and print the result. The first number read indicates the number of integers to be read and added. End the program with the system call.
Exercise 4: Read an integer from the keyboard and determine if it is an odd or even number. Print on the screen "Eh par" or "Eh impar" in response. End the program with the system call.
Exercise 5: Make the lowercase characters in a sentence uppercase. It does not change capital letters, digits or special characters. End the program with the system call.
Exercise 6: Read an integer from the keyboard and print the number of bits in 1 in its binary representation. End the program with the system call.
Exercise 7: Read 3 integers from the keyboard, in order, a, b and c. Calculate and print the result of the expression: a + b*c. End the program with the system call.
Exercise 8: When reading a keyboard string with the system call a7 = 8, the function returns the string with the character new line ('\n') at the end. Make a function that receives the memory address of a string in a0 and replaces the character '\n' with zero, indicating the end of the string.