Question: 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))
 How do i find length of third side in assembly language

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!