//////////////////////////////////////////////////////////////pow10.asm
;*******************************************************
;* *
;* Delphi Run Library *
;* *
;* Copyright (c) 1996,98 Inprise Corporation *
;*--------------------------------------------------------------------------
;* To compile "tasm32 /ml pow10.asm" *
;*--------------------------------------------------------------------------
;*******************************************************
.386
;.MODEL flat,c (error must be in segement block must have segment
;!!!!!11 important if ',c' is not used , must use 'public _ppow10, and'_ppow10 proc'
;!!!!!11 important if .MODEL flat,c is not used , must use ;_TEXTSEGMENT WORD PUBLIC
;'CODE'..._TEXT ENDS and must use 'public _ppow10 and '_ppow10 proc'
.MODELflat,c ; just use .code, no need for segment,!!!!!11 important if',c' is used , must use 'public ppow10, and 'ppow10 proc'
;ppow10 PROTO,aVal:PTR REAL8, bVal:PTR REAL8
;includeE:\Vsource\masm32\INCLUDE\windows.inc
;includeE:\Vsource\masm32\INCLUDE\user32.inc
;includeE:\Vsource\masm32\INCLUDE\kernel32.inc
PUBLICppow10
.CODE
;DllEntryproc hInstance:HINSTANCE, reason:DWORD, reserved1:DWORD
;.if reason==DLL_PROCESS_ATTACH
;invoke MessageBox,NULL,addr LoadMsg,addr AppName,MB_OK
;.elseif reason==DLL_PROCESS_DETACH
;invoke MessageBox,NULL,addr UnloadMsg,addr AppName,MB_OK
;.elseif reason==DLL_THREAD_ATTACH
;invoke MessageBox,NULL,addr ThreadCreated,addr AppName,MB_OK
;.else ; DLL_THREAD_DETACH
;invoke MessageBox,NULL,addr ThreadDestroyed,addr AppName,MB_OK
;.endif
;mov eax,TRUE
;ret
;DllEntryEndp
;FUNCTION _Ppow10( double val, double pow: ) : Extended;
;_TEXTSEGMENT WORD PUBLIC 'CODE'
;ppow10 PROC,aVal:PTR REAL8, bVal:PTR REAL8
;ppow10 PROC,aVal:* Qword, bVal:Qword
ppow10PROC near
XUEQU 8 ; for eip & ebp
XDEQU 0 ; for edi, esi, ebx, ecx, edx
fp_powerEQU QWORD PTR [ebp+XU+8]
fp_valEQU QWORD PTR [ebp+XU]
valEQU QWORD PTR [eBP-XD-8] ; USE STACK
powerEQU QWORD PTR [eBP-XD-16] ; USE STACK
pow10EQU QWORD PTR [eBP-XD-24] ; USE STACK
FPower10:
pushebp
movebp,esp
;push edi
;push esi
;push eax
;push edx
subesp,24
FINIT
fldz
fstval
fstpower
fstppow10
MOV EAX,8 MOV EDX,8; fldpi
fld fp_val ;st(0)=val; fld aVal;st(0)=val
fstval
;fld Arg2 ;st(0)=power
;fstp power
;fld val ;st(0)=val
;fmul val ;st(0)=val*val
;fmul val ;st(0)=val*va*val
;fadd st,st(0)
;fmul qword ptr [ebp+16] ;st(0)=power
;fadd st,st(0)
;fwait
addesp,24
;pop edx
;pop eax
;pop esi
;pop edi
movesp,ebp
popebp
;leave ; @@@@@@ important don't use leave in vc++ 2010
RET;return value = st(0)
ppow10ENDP
;_TEXTENDS
END
;END DllEntry