You are tasked to use the same positive integers from Part A to also compute: Mo
ID: 663325 • Letter: Y
Question
You are tasked to use the same positive integers from Part A to also compute: More formally. write MIPS code to output the result of above expression of h without using any built-in MIPS/MARS instructions for multiplication or division. The values already entered for Pail A for a. b. c, and d shall be used. Output the value of h in {quotient with remainder} in a format as separate decimal integers. Indicate the denominator for the remainder. Note: To receive credit, no multiplication, no division, and no shift instructions shall be used. Namely. noneof{mul, mul.d, mul.s, mulo, mulou, mult, multu, mulu, div, divu, rem, sll, sllv, sra, srav, srl, srlv} or else a zero score will result. Thus. it isto compose your own division technique. In addition. use of a loop is required for credit to realize the division code. It pail of the project points to design a way to realize division using a loop.Explanation / Answer
# A demonstration of some simple MIPS instructions # used to test QtSPIM # Declare main as a global function .globl main # All program code is placed after the # .text assembler directive .text # The label 'main' represents the starting point main: li $t2, 25 # Load immediate value (25) lw $t3, value # Load the word stored at label 'value' add $t4, $t2, $t3 # Add sub $t5, $t2, $t3 # Subtract # Exit the program by means of a syscall. # There are many syscalls - pick the desired one # by placing its code in $v0. The code for exit is "10" li $v0, 10 # Sets $v0 to "10" to select exit syscall syscall # Exit # All memory structures are placed after the # .data assembler directive .data # The .word assembler directive reserves space # in memory for a single 4-byte word (or multiple 4-byte words) # and assigns that memory location an initial value # (or a comma separated list of initial values) value: .word 12
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.