Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
S | EXPONENT | MANTISSA
INSTRUCTION DESCRIPTION
Push and pops
FLD, FSTP Push and pop floating point data
FILD, FISTP Push and pop integer data
X DD 3.4
Y DD 2 'This is an integer, while 2.0 is flt. pt.
Z DD ?
To evaluate Z = X + Y
FLD X ;ST(0) = X
FILD Y ;ST(0) = Y, ST(1) = X
FADD ;ST(0) = X + Y
FSTP Z ;Z = X + Y
Example 2. To evaluate X * Y - U / V
X DD 3.9
Y DD 2.8
U DD 7.3
V DD 4.62 ______code follows ___________
FLD X ;st(0) = X
FLD Y ;st(0) = Y, st(1) = X
FMUL ;st(0) = X*Y
FLD U ;st(0) = U, st(1) = X*Y
FLD V ;st(0) = V, st(1) = U, st(2) = X*Y
FDIV ;st(0) = U/V, st(1) = X*Y
FSUB ;st(0) = X*Y - U / V
FSTP Z ;Z = result, st(0) = empty
Util.lib contains the following subroutines for inputting
and outputting floating point numbers:
Given,e.g.:
m dd 3.6
n dd 21