Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do i find length of third side in assembly language x 8 6 . Here is my current code ; Calculate a ^ 2

How do i find length of third side in assembly language x86. Here is my current code
; Calculate a^2 and store in xmm3
movsd xmm3, xmm15
mulsd xmm3, xmm3
; Calculate b^2 and store in xmm4
movsd xmm4, xmm12
mulsd xmm4, xmm4
; Add a^2 and b^2, result in xmm3
addsd xmm3, xmm4
; Calculate 2ab and temporarily store in xmm4
movsd xmm4, xmm15
mulsd xmm4, xmm12
mulsd xmm4, qword [two] ; [two] should contain the double - precision floating - point value of 2.0
; Calculate 2ab * cos(\theta ) and store in xmm4
mulsd xmm4, xmm14
; Subtract the product from the sum of squares
subsd xmm3, xmm4
; Take the square root of xmm3 to get the length of the third side
sqrtsd xmm0, xmm3 ; The result is now in xmm0
mov rax, 1
mov rdi, length_third_side
call printf
; Output newline
mov rdi, newline
call printf
;Formula for third side: c?S=qrt(a???2+b???2-2ab**cos(t))
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions

Question

Different formulas for mathematical core areas.

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago