This is the first test piece with the later macros. It cannot be built as there are macros that have not been published yet but it works fine and handles 500 million iterations with no problems so the stack does not go BANG.
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
include \masm32\include64\masm64rt.inc
fpinit MACRO
fninit ;; clear FPU registers and flags
fldz ;; zero st(0)
ENDM
; -------------------------------
fpdiv MACRO arg1,arg2
fld arg1
fld arg2
fdivp
ENDM
fpmul MACRO arg1,arg2
fld arg1
fld arg2
fmulp
ENDM
fpadd MACRO arg1
fld arg1
faddp
ENDM
fpsub MACRO arg1
fld arg1
fsubp
ENDM
; -------------------------------
fpsqrt MACRO number,target
fld number
fsqrt
fstp target
ENDM
.code
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
entry_point proc
LOCAL fpval :REAL8
LOCAL pbuf :QWORD
LOCAL buff[32]:BYTE
mov pbuf, ptr$(buff) ; get buffer pointer
addme = FLT8(1.0) ; statement form
fpinit ; initialise FPU & set st(0) to 0.0
; -----------------------------
mov r11, 100000000 ; 100 million iterations, 500 million macro calls
@@:
fpadd addme ; add value to st(0)
fpadd addme
fpadd addme
fpadd addme
fpadd addme
sub r11, 1
jnz @B
; -----------------------------
fpsub FLT8(1.0) ; function form
fstp fpval ; load st(0) into variable
invoke fptoa,fpval,pbuf ; convert fpval to string
conout pbuf,lf ; display at console
waitkey
.exit
entry_point endp
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
end
comment #
.text:0000000140001016 DBE3 fninit
.text:0000000140001018 D9EE fldz
.text:000000014000101a 49C7C300E1F505 mov r11, 0x5f5e100
.text:0000000140001021
.text:0000000140001021 0x140001021:
.text:0000000140001021 DD0539100000 fld qword ptr [0x140002060]
.text:0000000140001027 DEC1 faddp st(1)
.text:0000000140001029 DD0531100000 fld qword ptr [0x140002060]
.text:000000014000102f DEC1 faddp st(1)
.text:0000000140001031 DD0529100000 fld qword ptr [0x140002060]
.text:0000000140001037 DEC1 faddp st(1)
.text:0000000140001039 DD0521100000 fld qword ptr [0x140002060]
.text:000000014000103f DEC1 faddp st(1)
.text:0000000140001041 DD0519100000 fld qword ptr [0x140002060]
.text:0000000140001047 DEC1 faddp st(1)
.text:0000000140001049 4983EB01 sub r11, 0x1
.text:000000014000104d 75D2 jne 0x140001021
.text:000000014000104d
.text:000000014000104f DD0513100000 fld qword ptr [0x140002068]
.text:0000000140001055 DEE9 fsubp st(1)
.text:0000000140001057 DD5D98 fstp qword ptr [rbp-0x68]
#