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, 03.07.2019 14:10
Line joining liquid phase with liquid and solid phase mixture is known as: a) liquidus b) solidus c) tie line d) none of the mentioned
Answers: 2
question
Engineering, 04.07.2019 18:10
Apipe with an outside diameter of 15 cm is exposed to an ambient air and surrounding temperature of -20°c. the pipe has an outer surface temperature of 65°c and an emissivity of 0.85. if the rate of heat loss from the pipe surface is 0.95 kw per meter of length, the external convective heat transfer coefficient (h) is: (a) 12.5 w/m"k (b) 18.6 w/mk (c) 23.7 w/mk (d) 27.9 w/mk (e) 33.5 w/mk
Answers: 1
question
Engineering, 04.07.2019 18:10
Burgers vector is generally parallel to the dislocation line. a)-true b)-false
Answers: 2
question
Engineering, 04.07.2019 18:10
Manometers are good examples of measuring instruments, nowadays they are not as common as before. a)-capacitive probe gauges b)-gravitational gauges deformation ) gauges d)-digital gauges
Answers: 1
You know the right answer?
Write a MIPS program that utilizes subroutine. This program should take input of an integer from the...
Questions
question
Mathematics, 06.05.2021 19:30
question
Mathematics, 06.05.2021 19:30
question
Mathematics, 06.05.2021 19:30
Questions on the website: 13722367