当前位置: 代码迷 >> 汇编语言 >> 汇编中FILD,FADD,FLD,FMUL都是有什么用?该怎么处理
  详细解决方案

汇编中FILD,FADD,FLD,FMUL都是有什么用?该怎么处理

热度:3235   发布时间:2013-02-26 00:00:00.0
汇编中FILD,FADD,FLD,FMUL都是有什么用?
麻烦详细说说它们的详细计算过程

------解决方案--------------------------------------------------------
浮点数运算指令:
fild:m16i/m32i/m64i;取存储器的整数,压入栈顶ST(0)。

FLD:M32R/M64R/M80R/ST(I);取存储器或ST(I)中的浮点数,压入栈顶。

FADD:M32R/M64R;ST(0)--ST(0)+32R/M64R。
FADD:ST,ST(I);ST(0)--ST(0)+ST(0)。
FADD:ST(I),ST(0);ST(I)--ST(I)+ST(0)。
FADD:ST(1)--ST(1)+ST(0),并出栈。

FMUL:M32R/M64R;ST(0)--ST(0)*M32R/M64R。
FMUL:ST,ST(I);ST(0)--ST(0)*ST(I)。
FMUL:ST(I),ST--(0);ST(I)*ST(0)。
FMUL;ST(1)--ST(1)*ST(0),并出栈。

------解决方案--------------------------------------------------------
参考一下浮点指令手册吧,eg:

FMUL

Title: Multiply
 
Syntax: FMUL [dest,src]
FMULP dest,ST
FMUL src
FIMUL src
 
Description:
 
Multiplies the source by the destination and returns the product in the destination. If two register operands are specified, one must be ST. If a memory operand is specified, the product replaces the value in ST. Memory operands can be 32- or 64-bit real numbers or 16- or 32-bit integers. 

If no operand is specified, ST(1) is multiplied by ST and the stack is popped; the product is returned in ST. For FMULP, the source must be ST; the product is returned in the destination register and ST is popped. 

-o-

----------------------------------------------------------------
 FMUL [reg,reg] | fmul st,st(2) | 486 16
| fmul st(5),st |
| fmul |
----------------------------------------------------------------
 FMULP reg,ST | fmulp st(6),st | 486 16
----------------------------------------------------------------
 FMUL memreal | fmul DWORD PTR [bx] | 486 s=11,l=14

| fmul shortreal[di+3] |
| fmul longreal |
| |
----------------------------------------------------------------
 FIMUL memint | fimul int16 | 486 w=23-27,d=22-24
| fimul warray[di] |
| fimul double |
| |
----------------------------------------------------------------
* The clocks in parentheses show times for short values--those with 40

trailing zeros in their fraction because they were loaded from a
short-real memory operand.
 
?The clocks in parentheses show typical speeds.
 
_ If the register operand is a short value--having 40 trailing zeros
in its fraction because it was loaded from a short-real memory
operand--then the timing is (112-126)+EA on the 8087 or 112-126 on
the 80287.
-o-
------解决方案--------------------------------------------------------
F开头的基本上都是浮点指令,网上搜索一下可以找到详细的浮点指令集说明。
------解决方案--------------------------------------------------------
you can find them at Floating Point Help (at masm32\help\fphelp.hlp),

or HLA book
------解决方案--------------------------------------------------------
浮点数
------解决方案--------------------------------------------------------
前面的都说完,俺混点分^_^
------解决方案--------------------------------------------------------
也给我点分吧