subject
Engineering, 28.02.2020 19:04 oryunnis

Write a MIPS program that utilizes subroutine. This program should take input of an integer from the user and then pass that number to BaseChange subroutine. The subroutine should then calculate the binary form of that number by use of the stack and display the result to the user. An Example of sample input and output would be:Input a number in decimal form: 5The number 5 in binary is: 00000000000000000000000000000101Thi s is what is what I have so fardatastr: .asciiz "\nInput a number in decimal form: "str1: .asciiz "\nThe number in binary is \n"newLine: .asciiz "\n".textli $v0, 4 # Display promptla $a0, strsyscallli $v0, 5 # User inputsyscalladd $s0, $v0, $0 # Store $v0 to $s0jal binary # Jump to subroutine binarymain:li $v0, 4la $a0, str1 # Display final promptsyscallli $v0, 1add $a0, $s5, $0 # Display integersyscallli $v0, 4la $a0, newLine # New linesyscallli $v0, 10 # Terminate programsyscallbinary:bne $0, $s0, mainli $t0, 2 # Hardcode to 2 for divisiondiv $s0, $t0 # divide user input by 2mfhi $s2 # Remaindermflo $s3 # Quotientaddi $sp, $sp, -4 # Decrement by 4sw $s2, 0($sp) # Store $sp to $s1addi $s0, $s0, 1j binary # Jump backjr $ra

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
If a particle moves along a path such that r : (3 sin t) m and ? : 2t rad, where t is in seconds. what is the particle's acceleration in m/s in 4 seconds? a)- 16.43 b)- 16.29 c)- 15.21 d)- 13.79
Answers: 1
question
Engineering, 04.07.2019 18:10
Abrake has a normal braking torque of 2.8 kip in and heat-dissipating cast-iron surfaces whose mass is 40 lbm. suppose a load is brought to rest in 8.0 s from an initial angular speed of 1600 rev/min using the normal braking torque; estimate the temperature rise of the heat dissipating surfaces.
Answers: 3
question
Engineering, 04.07.2019 18:10
Air is to be cooled in the evaporator section of a refrigerator by passing it over a bank of 0.8-cm-outer-diameter and 0.4-m-long tubes inside which the refrigerant is evaporating at -20°c. air approaches the tube bank in the normal direction at 0°c and 1 atm with a mean velocity of 4 m/s. the tubes are arranged in-line with longitudinal and transverse pitches of sl- st 1.5 cm. there are 30 rows in the flow direction with 15 tubes in each row. determine (a) the refrigeration capacity of this system and (b) pressure drop across the tube bank. evaluate the air properties at an assumed mean temperature of -5°c and 1 atm. is this a good assumption?
Answers: 1
question
Engineering, 04.07.2019 18:10
True or false (explain) (110)[111] is a slip system in bcc metals . the {111} family in fcc contains 8 planes. resolved shear stress (rss) in single crystals is just related to the applied stress. critical resolved shear stress (crss) in single crystal metals is direct proportional to the number of defects in the structure
Answers: 2
You know the right answer?
Write a MIPS program that utilizes subroutine. This program should take input of an integer from the...
Questions
question
Geography, 16.07.2019 19:00
question
Mathematics, 16.07.2019 19:00
Questions on the website: 13722361