Computer Architecture Course: IT089IU International University - VNU HCM Date: March 2021 Dr. Le Hai Duong & Dr. Ly Tu Nga Time: 6 hours Trần Minh Duy ITITIU18230
Computer Architecture Course: IT089IU International University - VNU HCM Date: March 2021 Dr. Le Hai Duong & Dr. Ly Tu Nga Time: 6 hours Trần Minh Duy ITITIU18230
Laboratory Session 4
I. Procedure (70pts)
1.2 Modify the previous assembly, create a procedure printHex(int num). This
procedure takes in a number and print it out in hexadecimal. (lab4_1_2.s)
1.3 Modify the previous assembly so that it can print out hexadecimal of any 32-bit
integer input. For example, read in number 546263, print out 0x855D7.
(lab4_1_3.s)
2.1 Write the program as a counting loop that terminates when the first 100 terms of
the series have been computed. Use a register for the current term and a register
for the previous term. Each execution of the loop computes a new current term
and then copies the old current term to the previous term register. Print out the
series. (Use no function) (lab4_2_1.s)
This function print out the Fibonacci series with one input is the number of terms
numOfTerms. (lab4_2_2.s)
2.3 Rewrite the program using recursion. The fib function should compute the nth
term as such: (lab4_2_3.s)
According to the Table above, please draw the flow chart via Computer Architecture to call these
functions: Configure_Timer, Configure_IO, Timer_A_1, Configure_Clock
______________________________________________________________________________
______________________________________________________________________________
_____________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
Please, compare this sample code without using Timer and Interrupt (Sample code of Lab
1)
Reference:
1. https://en.wikibooks.org/wiki/MIPS_Assembly/Pseudoinstructions
2. https://courses.missouristate.edu/KenVollmar/MARS/Help/SyscallHelp.html
3. https://www.assemblylanguagetuts.com/mips-assembly-programming-
tutorials/#MIPS_Data_Types
4. https://en.wikibooks.org/wiki/MIPS_Assembly/Arithmetic_Instructions
5. https://gab.wallawalla.edu/~curt.nelson/cptr280/lecture/mips%20arithmetic
%20instructions.pdf