I only need answer to number 3 (on bottom) which was not answered on the last one that was posted.
li $s6,268500992
li $s3,3
li $s5,10
li $t0,10
sw $t0, 0($s6)
sw $t0, 4($s6)
sw $t0, 8($s6)
sw $t0, 12($s6)
sw $t0, 16($s6)
sw $t0, 20($s6)
sw $t0, 24($s6)
sw $t0, 28($s6)
li $t0,2
sw $t0, 32($s6)
loop: sll $t1,$s3,2
add $t1,$t1,$s6
lw $t0,0($t1)
bne $t0,$s5,exit
addi $s3,$s3,1
j loop
exit:
MIPS :program (the result is stored in $t0 ) :-
li $s6,268500992
#starting address
li $s3,9 #no of
word elements need to be counters
li $t0,0
#counter
li $t1,10
LOOP_START:
beq $s3,$0,exit
#loop condition
lw $t2,0($s6)
#extracting the value
bne $t1,$t2,NEXT_ELE #checking for
extracted is 10 or not
addi $t0,$t0,1
#if 10 then counter is increased
NEXT_ELE:
addi $s6,$s6,4
#pointing to next element
addi $s3,$s3,-1
#decrement the counter
j LOOP_START
exit:
I only need answer to number 3 (on bottom) which was not answered on the last...
I have this MIPS program and I'm having trouble with it. This program is user inputs numbers until zero and sorts and print the numbers in order. Please soove this issue. You can use any sorting algorithm except bubble sort. Need it as soon as possible. Here is the code:.datanum: .word 0space: .byte ' ' .text main: # la $t0, val # loads val into a register # li $t1, 0 #keeps track of how many numbers entered la $a0,...
QT
Spim question. Program and answer already given please explaine it.
Please explain the reason why each instruction was used
throughout the program step by step given the prompt, what is its
purpose to achive the goal asked in the prompt, why is written in
that order.
Please not just write to the side what each instruction means
in words like load $t0 to $t1. I want to understand the program
thoroughly.
Thanks in advance
Previous information needed to solve...
Show all your work, I WILL RATE!! Consider the following code: li $t0, 99 li $t1, 44 loop: addi $t0, $t0, -1 lw $t1, 0($t1) bne $t0, $zero, loop add $v0, $t0, $zero What is the static instruction count of this code? What is the dynamic instruction count? (Assume any pseudoinstructions are counted as 1 instruction). How many times is the instruction memory accessed? How many times is the data memory (i.e. lw/sw) accessed?
I AM POSTING MY QUESTION 3RD TIME . FIRST TWO TIMES I DIDNOT GET THE PROPER ANSWER. PLEASE DO ALL STEPS BY LABELING THE EACH STEP. THIS IS THE ASSIGNMENT IN WHICH THE EACH STEP SHOULD BE LABEL . I MEAN EVERY THING SHOULD BE WRITTEN WHAT WE HAVE DONE IN OUR PROGRAM THIS IS THE REQUIREMENT OF TEACHER , PLEASE DO IT PROPERLY 1) MIPS to C. Assume that the variables f, g, h, i, and j are assigned...
4) Consider the following assembly language code: INSTRUCTIONS T01 T02 T03 T04 T05 T06 T07 T08 T09 T10 T11 T12 T13 T14 (as a table) Loop: sll $t1, $s3, 2 add $t1, $t1, $s6 lw $t0, 0($t1) beq $t0, $s5, Exit addi $s3, $s3, 1 j Loop Exit: Use a pipeline with forwarding, hazard detection, and 1 delay slot for branches. The pipeline is the typical 5-stage IF, ID, EX, MEM, WB MIPS design. For the above code, complete the...
Question 29 3 pts MIPS branch instructions compute their destination by subtracting the branch address from PC 4 True False Question 31 3 pts PC-relative addressing cau cover (access) the whole memory space of MIPS. True False Question 32 2 pts If the current vlue of the PC is Ox00000000. you can use a single jump instruetion to get to the PC address as Ox00100400. True False Question 35 2 pts What is the comrect value for? in the following...
I want to calculate Y[2]=X[3]+X[4]
I'm not sure that I wrote right codes.
.text main . la $50, x #get base address of x la $s1, y #get base address of y lw $to, 12 ($50)#get data from memory of x[3] lw $t1 , 1 6($50) #get data from memory of x[4] add $t2, $t0, $t1 sw $t2, 8($51 ) #store result to y[2] li $v0, 10 #exit program syscall data x: word 5, 1, 17,-4, 6, 3 y: .word...
Please comment the MIPS code to help me understand.
Here is what the code accomplishes.
Here is the code, partially commented.
.data
Matrix: .word 41,45,5, 34,8,
15,16,23,44,48,12,32,18,47,22,8,22
.word 46,40,42,33,13,38,27,6, 29,25,18,40,47,22,26,14,3
.word 7, 48,35,9, 43,38,9, 49,28,25,42,5, 44,10,5, 38,14
.word 46,33,16,6, 13,20,31,1, 8, 17,1, 47,28,46,14,28,7
.word 32,2, 48,25,41,29,14,39,43,46,3, 39,32,49,41,28,46
.word 5, 43,2, 48,13,4, 33,41,32,19,9, 25,30,22,2, 9, 40
.word 14,47,22,18,47,3, 35,44,18,6, 33,22,11,6, 47,50,4
.word 28,34,20,30,18,27,38,5, 26,40,37,23,16,13,37,8,7
.word 48,38,39,12,10,39,23,20,21,20,33,16,24,21,25,3,46
.word 49,38,40,38,13,47,5, 13,4, 13,23,26,12,30,29,29, 3
.word 8, 20,10,13,31,7, 12,41,12,21,28,26,43,14,35,10,19
.word 49,33,25,26,24,29,46,22,7, 5, 15,41,10,31,19,41,27
.word 48,9,...
(USING THE PROGRAM MARS) Using the MemoryAccess program we wrote in class as a starting point, write a program called LoadStore # Title : Memory access.asm #Desc: Practice initially memory, #in val1 = 0x0a; #int val2 = 0x0b; #int result; #string resultstring = " final answer : "; #string returnchar = "\n"; #void main() { # result = val1 + val2; # cout<<< resultstring << returnchar; #} .data val1: .word 0x0a #store 0xa into variable val1 val2: .word 0x0b #store...
Refer the program in the next page: Assume the starting address of data segment: 0x10010000. What is the address of label num3? _______________________________ Write the common syscall code to print string for the blank marked as #Question 2 _________________________________ Write proper comments for the lines marked as #Question 3 ________________________________________________________ Write the machine code for the line marked as #Question 4 in both binary and hex. Binary:_______________________________________ Hex:___________________ Write the machine code for the line marked as #Question 5 in...