0

这是代码片段:

.386 
.model flat, stdcall 
    option casemap :none ; case sensitive 
.nolist 
include \masm32\include\windows.inc 
include \masm32\include\user32.inc 
include \masm32\include\kernel32.inc 
include \masm32\include\masm32.inc 
include \masm32\include\fpu.inc
.list 
includelib \masm32\lib\user32.lib 
includelib \masm32\lib\kernel32.lib 
includelib \masm32\lib\masm32.lib

.data
angulo_deg DW 270
coseno  DB 50 DUP(" "),0ah,0dh,0
sal1_1 DB "Medidas para el angulo 270 Grados",0
sal3 DB "Coseno: ",0
.code
Inicio:
    ; ANGULO DEG:
    fclex
    pushd 180   ;store the integer value of 180 on the stack
    fidiv dword ptr angulo_deg  ;divide the angle in degrees by 180
                                ;-> ST(0)=angle in degrees/180
    fldpi       ;load the hard-coded value of π
                ;-> ST(0)=π, ST(1)=angle in degrees/180
    fmul        ;-> ST(0)=angle in degrees*π/180, => angle in radians
    invoke FpuCos, 0,0, SRC1_FPU or ANG_DEG or DEST_FPU
    invoke FpuFLtoA, 0,4, ADDR coseno, SRC1_FPU or SRC2_DIMM
    invoke StdOut, ADDR coseno
    invoke ExitProcess,0
End Inicio

然后我用“ml /c /coff /Fl ejemplo1.asm”编译它不会引发任何错误。但是当我链接到:“link /subsystem:console ejemlo1”时,它会出现:

ejemlo1.obj:错误 LNK2001:未解析的外部符号 _FputoA@16

ejemlo1.obj : 错误 LNK2001: 无法解析的外部符号 _FpuCos@12

ejemlo1.exe : 致命错误 LNK1120: 2 unresolved externals

我不知道问题是什么。希望您能够帮助我。非常感谢。

4

0 回答 0