Department of Electrical, Electronics and Computer Systems
College of Engineering and Technology
University of Sargodha
Computer Architecture Lab (EE-217)
Semester / Session: 3rd / Fall2022
Mid-Term Exam: Fall-2023
Date: 15 - 12 - 2023
Time Allowed: _1.5_ hour Total Marks = 20
Section A: Multiple Choice Questions Marks 05 CLO:
1) MIPS assembly language instruction set size is .
a) 23 bit b) 32 bit c) 24 bit d) 3 byte e) None of these
2) Service Code 10 in system call is used to .
a) Print Integer b) Read Character c) Terminate Program d) None of these
3) Assume that $s1 = 0xabcd1234 and $s2 = 0xffff0000, then result of
instruction “xor $s5,$s1,$s2” will be .
a) $s5=0x54321234 b) $s5=0xffff1234 c) $s5=0xabcd0000 d) $s5=0x0000edcb
4) Following instruction is used to define array”arr1: .word 1:10”. How much space in
memory used by this array _ ?
a) 10 bytes b) 20 bytes c) 30 bytes d) 40 bytes
5) How we can show address of arrays?
a) Data segment window b) Text segment window c) Label window d) None of these
Section B: Short Questions Marks (2+2) CLO:
Q.1 In following code, when system call will execute. Also, mention the result of code.
.data
ask: .asciiz " \nEnter a number......\n"
.text
lb $t5, yes
lb $t6, no
li $v0, 4
la $a0, ask
syscall
Q.2 Write command to compare two number if one is greater than other.
Department of Electrical, Electronics and Computer Systems
College of Engineering and Technology
University of Sargodha
Computer Architecture Lab (EE-217)
Semester / Session: 3rd / Fall2022
Mid-Term Exam: Fall-2023
Date: 15 - 12 - 2023
Time Allowed: _1.5_ hour Total Marks
Section C Programming Task Marks (5+5+5) CLO:
a. Write a program that asks the user to enter two integers: n1 and n2 and prints the
sum of all numbers from n1 to n2. For example, if the user enters n1=3 and
n2=7, then the program should display the sum as 25.
b. Write a MIPS program that inputs two integer values. The program should output equal
if the two integers are equal. Otherwise, it should output not equal. Use the branch
instruction to check for equality.
c. State the operation of following system calls. (CLO-3) 5
1–
4–
8–
10 –
11 –