Computer Organization Laboratory Lab #6 Solution

$35.00 $24.00

Objective: In this lab you will familiarize the basics of MIPS assembly programming using the QtSpim simulator.   Problem: Illustrate the following using QtSpim:   (1) Data transfer operations:   a) Load all the temporary registers t0 to t9 with 4-bit hex value 0xF and saved registers s0 to s7 with the 4 bit hex…

You’ll get a: . zip file solution

 

 
Categorys:

Description

5/5 – (2 votes)

Objective:

In this lab you will familiarize the basics of MIPS assembly programming using the QtSpim simulator.

 

Problem:

Illustrate the following using QtSpim:

 

(1) Data transfer operations:

 

  1. a) Load all the temporary registers t0 to t9 with 4-bit hex value 0xF and saved registers s0 to s7 with the 4 bit hex value 0x Move data in t6 to s4 and s7 to t5
  2. b) Load all the temporary registers t0 to t9 with 16-bit hex value 0xFFFF and saved registers s0 to s7 with the 16 bit hex value 0xAAA
  3. c) Load all the temporary registers t0 to t9 with 32-bit hex value 0xFFFFFFFF and saved registers s0 to s7 with the 32 bit hex value 0xAAAAAAA
  4. d) Load all the temporary registers t0 to t9 and saved registers s0 to s7 with the 36 bit hex value 0x
  5. e) Explain your observations in each of the above 4 case

 

(2) Storage of data in the data segment using ascii/asciiz:

 

Store 4 strings as indicated below. Load the address of each string into registers t0, t1, t2, t3 respectively. Run step by step and note how each string is getting stored and explain the changes occuring in the data segment:

str1: .ascii “123456789abcedef” str2: .ascii “123456789ABCDEF” str3: .asciiz “123456789abcedef” str4: .asciiz “123456789ABCDEF”

 

(3) Load and store a word, a half word and a byte:

 

Store the strings as indicated below: str1: .ascii “123456789abcedef” str2: .ascii “123456789ABCDEF”

  1. a) Load the first 3 bytes of str1 into t0, t1, t2 and store the values in registers t3, t4, t5 into last 3 bytes of str2.
  2. b) Load the first 2 half words of str2 into t6, t7 and store the value in the register t8 into last halfword of str1.
  3. c) Load the last word of str2 into t9 and store the value in the register s1 into the last word of

 

(4) Illustrate the use of syscall codes for the following operations:

 

  1. a) Exiting a program
  2. b) Printing an integer and a string:

 

  1. c) Store your roll number as memory wor Then display it on the Console. The display should be like:

My roll number is : <Your roll number>

 

(5) Reading and printing an integer and string:

 

Read your name and roll number during run time and then display the same on the Console. There should be prompts for entering the name and roll number. i.e. The display should be like:

Please enter your name: <Enter your name>

Please enter your roll no.: <Enter your roll number> Your name is : <Your name should be displayed here>

Your roll number is : < Your roll number should be displayed here>

Indicate the changes that you see in in data segment.

 

(6) Reading and printing a floating point number

 

Read a floating point number during run time and then display the same on the

Console. i.e. The display should be like:

Please enter a floating point number : <Enter the number> You have entered : <The number should be displayed here>

 

 

 

Post-lab:

Submit a post-lab report with your verified outputs. The report should include your well commented code snippets, snapshots of the changes observed in the registers, data segments with proper explanation. Your submissions should be clear and concise.