2013-10-15 70 views
1

未定义的符号:WriteFloat未定义的符号:WriteFloat

; Implementation of the following expression: 
; (6.0 * 2.0) + (4.5 * 3.2) 
; FPU instructions used. 

INCLUDE Irvine32.inc ; 32-bit Protected mode program. 
Include Macros.inc 

.data 
    array REAL4 6.0, 2.0, 4.5, 3.2 
    dotProduct REAL4 ? 
    val BYTE ? 

.code 
main PROC 

    finit    ; initialize FPU 
    fld array   ; push 6.0 onto the stack 
    fmul array+4  ; ST(0) = 6.0 * 2.0 
    fld array+8   ; push 4.5 onto the stack 
    fmul array+12  ; ST(0) = 4.5 * 3.2 
    fadd    ; ST(0) = ST(0) + ST(1) 
    fstp dotProduct  ; pop stack into memory operand 
    call WriteFloat 

    exit 
main ENDP 

END main 

我的代码工作。这个问题只是WriteFloat。当我将WriteFloat更改为WriteInt或WriteDec时,没有错误。但我无法得到我的确切结果。我有Irvine32.lib,Macros.inc和我正在使用masm615,我的编辑器是textpad。

+0

你不应该有'INCLUDELIB'Irvine32.lib“'? – Michael

回答

0

改变线

fstp dotProduct 

fst dotProduct 

WriteFloat使用堆栈上的价值,但FSTP从栈中删除该值。 fst(不带“p”)允许堆栈中的值。