Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Im receiving this output. In assembly x 8 6 How do I fix the - nan Please enter the length of the first side: 1
Im receiving this output. In assembly x How do I fix the nan
Please enter the length of the first side:
Please enter the length of the second side:
Please enter the size of the angle in degrees:
Thank you Erik Williams. You entered and
The length of the third side is: nan
The final time on the system clock is tics
Have a good day.
here is my code
segment text
two dq ; Define a double precision floating point number with the value
pi dq
conversionfactor dq ; pi
; Get user input and store in xmm
push qword
push qword
mov rdi, formatfloat
mov rsi, rsp
call scanf
movsd xmmrsp
pop rax
pop rax
; Ask for second side of triangle
mov rax,
mov rdi, lengthsecondside
call printf
; Get user input and store in xmm
push qword
push qword
mov rdi, formatfloat
mov rsi, rsp
call scanf
movsd xmmrsp
pop rax
pop rax
; Ask for angle
mov rax,
mov rdi, angleprompt
call printf
; Get user input and store in xmm
push qword
push qword
mov rdi, formatfloat
mov rsi, rsp
call scanf
movsd xmmrsp
pop rax
pop rax
; output newline
mov rdi, newline
call printf
; thank you input
mov rax,
mov rdi, thankyouinput
mov rsi, username
movq xmm xmm
movq xmm xmm
movq xmm xmm
call printf
; Get user input and store in xmm
push qword
push qword
mov rdi, formatfloat
mov rsi, rsp
movsd xmmrsp
pop rax
pop rax
movsd xmm xmm ; Copy degrees into xmm
mulsd xmm qword conversionfactor ; xmm degrees pi
; Calculate a and store in xmm
movsd xmm xmm
mulsd xmm xmm
; Calculate b and store in xmm
movsd xmm xmm
mulsd xmm xmm
; Add a and b result in xmm
addsd xmm xmm
; Calculate ab and temporarily store in xmm
movsd xmm xmm
mulsd xmm xmm
mulsd xmm qwordtwo ; two should contain the double precision floating point value of
; Calculate ab costheta and store in xmm
mulsd xmm xmm
; Subtract the product from the sum of squares
subsd xmm xmm
; Take the square root of xmm to get the length of the third side
sqrtsd xmm xmm ; The result is now in xmm
mov rdi, fmt ; Format string for printf
mov rax, ; Indicate that floating point argument is passed
call printf ; Print the third side length
; Output newline
mov rdi, newline
call printf
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started