Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, can i get help with this in assembling language. # Name: # Date: # # TODO: #

ID: 3888283 • Letter: H

Question

Hi, can i get help with this in assembling language.

# Name:
# Date:
#
# TODO:
# part 1:
# - prompt user to input height and width of a right triangle
# - compute the area of the right triangle (width * height / 2)
# and print out the result to one desimal place (ie: 42.3)
#
# part 2:
# - add basic input validation to make sure both height and
# width are greater than zero.
# - print out an error message and ask user to input again if
# the input is less than or equal to zero.
# - upload your .s file to D2L under "Lab #2 Triangle area"
#
# Note:
# 1. Please fill out the register usage section.
# 2. Please notice that the remainder of any number divide by 2
# is either 0 or 1 in binary. Therefore, fractional part of
# the result is either ".0" or ".5" in decimal respectively.
#
###########################################################
# Register Usage
#
# $t0
# $t1
# $t2
# $t3
# $t4
# $t5
# $t6
# $t7
# $t8
# $t9
###########################################################
.data

###########################################################
.text
main:


exit:
li $v0, 10 # exit program
syscall
###########################################################

Explanation / Answer

.data

Input_height: .asciiz "Enter height: "
Input_width: .asciiz "Enter width: "
Print_area: .asciiz "Area of traingle: "
fp1: .float 2.0
.text

height:
la $a0, Input_height
li $v0,4
syscall
li $v0,6
syscall
#blez $f0, height
mov.s $f1, $f0

width:
la $a0, Input_width
li $v0,4
syscall
li $v0,6
syscall
#blez $f0, width
mov.s $f2, $f0

mul.s $f3,$f2,$f1
l.s $f4, fp1
div.s $f12, $f3,$f4
la $a0, Print_area
li $v0, 4
syscall
li $v0, 2
syscall


li $v0,10
syscall

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote