Created
October 16, 2012 19:55
-
-
Save tanayseven/3901583 to your computer and use it in GitHub Desktop.
8087 assembly level program to evaluate (x+y)(a+b)/(a+b)(x-y), floating point
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;8087 program to evaluate (x+y)(a+b)/(a+b)(x-y) | |
data segment | |
a dd 3.2 | |
b dd 2.1 | |
x dd 6.3 | |
y dd 7.7 | |
result dd ? | |
ends data | |
code segment | |
ASSUME cs:code, ds:data | |
start: mov ax, data | |
mov ds, ax | |
finit | |
fld x;(x+y) | |
fld y | |
fadd | |
fld a;(a-b) | |
fld b | |
fsub | |
fmul;(x+y)(a-b) | |
fld a;(a+b) | |
fld b | |
fadd | |
fld x;(x-y) | |
fld y | |
fsub | |
fmul;(a+b)(x-y) | |
fdiv;(x+y)(a+b)/(a+b)(x-y) | |
fstp result | |
quit: mov ah,4ch | |
int 21h | |
ends code | |
end start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment