Answered step by step
Verified Expert Solution
Question
1 Approved Answer
main: lui $a0,0x8000 jal first1pos jal printv0 lui $a0,0x0001 jal first1pos jal printv0 li $a0,1 jal first1pos jal printv0 add $a0,$0,$0 jal first1pos jal printv0
main:
lui $a0,0x8000
jal first1pos
jal printv0
lui $a0,0x0001
jal first1pos
jal printv0
li $a0,1
jal first1pos
jal printv0
add $a0,$0,$0
jal first1pos
jal printv0
li $v0,10
syscall
first1pos: # your code goes here
printv0:
addi $sp,$sp,-4
sw $ra,0($sp)
add $a0,$v0,$0
li $v0,1
syscall
li $v0,11
li $a0,' '
syscall
lw $ra,0($sp)
addi $sp,$sp,4
jr $ra
(Exercise) Create first1posv2.s Once again start from first1pos.v to find the exact same bit as firstlposv1.s. However, this version should start a mask at 0x80000000 and repeatedly shift the mask to the right to check each bit in $ao (without modifying the original value in $a0). You should make sure the output in version 1 and 2 are matchingStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started