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

Write three simple x86 assembly programs to add, subtract and multiply two float

ID: 3890055 • Letter: W

Question

Write three simple x86 assembly programs to add, subtract and multiply two floating point numbers. The purpose is to show how the IA32 floating point unit works. Also provide some information about IA32 floating point unit. The code should be as simple as possible Write three simple x86 assembly programs to add, subtract and multiply two floating point numbers. The purpose is to show how the IA32 floating point unit works. Also provide some information about IA32 floating point unit. The code should be as simple as possible

Explanation / Answer

IA: Intel Architecture
IA-32: IA for 32 bit.This helps in 32-bit computing. In IA-32 instructions are processed on operands and results are stored in registers or memory locations defiined

fld num1 ; load floating point num1 value
fld num2 ; load floating point num2 value
faddp ; add floating point numbers and pop up
fstp res ; pops sum of floating points from the stack and store it in res

fld num1 ; load floating point num1 value
fld num2 ; load floating point num2 value
fsubp ; subtracts floating point numbers and pop up
fstp res ; pops difference of floating points from the stack and store it in res

fld num1 ; load floating point num1 value
fld num2 ; load floating point num2 value
fmulp ; multiplies floating point numbers and pop up
fstp res ; pop sum of floating points from the stack and store it in res