Question: #Program: mlQuadratic.asm # Author: ********** # Date: mm/dd/yy # Purpose: Practice floating point calculations #---------------------------------------------------------------- # Create assembler for the Quadratic solving # #include #

#Program: mlQuadratic.asm # Author: ********** # Date: mm/dd/yy # Purpose: Practice floating point calculations #---------------------------------------------------------------- # Create assembler for the Quadratic solving # #include # #include # using namespace std; # # 2x^2 -8x - 24 = 0 # # -b +- SQR( b^2 - 4ac) # x = --------------------- # 2a # # x = 6.0, -2.0 # # # void main() # { # float a = 2.0, b = -8.0, c = -24.0; # float sqroot = sqr( b*b - 4*a*c ); # float root1 = (-b + sqroot)/2*a; # float root2 = (-b - sqroot)/2*a; # cout << "Root1:\t" << root1 << endl; # cout << "Root2:\t" << root2 << endl; # } # OUTPUT: # Root1: 6 # Root2: -2

.data

.eqv SYS_PRINT_FLOAT 2 #float .eqv SYS_PRINT_TEXT 4 #text (zero terminated) .eqv SYS_EXIT 10 #terminate endl: .asciiz " " lblRoot1: .asciiz "Root1:\t" lblRoot2: .asciiz "Root2:\t"

a: .float 2.0 b: .float -8.0 c: .float -24.0 mytwo: .float 2.0 myfour: .float 4.0

.text .globl main

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!