There are two versions of the macro. The first is the ideal, and the second is the work-around going through rax.
;---------------------------------------------- froundz
; st0 <- st0 rounded towards zero at non-zero st1 intervals
%macro froundz 0 ; x,|n|
fdiv st0,st1 ; xi=x/|n|,|n|
sub rsp,8
fisttp qword[rsp]
fild qword[rsp] ; Trunc(xi),|n|
fmul ; Trunc(xi)|n|
add rsp,8
%endmacro
;---------------------------------------------- froundz
; st0 <- st0 rounded towards zero at non-zero st1 intervals
%macro froundz2 0 ; x,|n|
fdiv st0,st1 ; xi=x/|n|,|n|
sub rsp,8
mov rax,rsp
;fisttp qword[rax] ; 0x08DD is the rax opcode
dw 8DDh ; |n|
fild qword[rax] ; Trunc(xi),|n|
fmul ; Trunc(xi)|n|
add rsp,8
%endmacro
The assembly command gives the following output:
Assemble.cmd
------------
Copyright (c) 1997 Analytical Logic
All rights reserved
Assembling project: FastMath ...
32-bit Borland Assembly ... Failed!
FastMath.32.asm:618: error: no instruction for this cpu level
FastMath.inc:796: ... from macro `froundz' defined here
32-bit Microsoft Assembly ... Failed!
FastMath.32.asm:618: error: no instruction for this cpu level
FastMath.inc:796: ... from macro `froundz' defined here
64-bit Borland Assembly ... Ok
64-bit Microsoft Assembly ... Ok
64-bit Microsoft DLL ... Ok
Moving objects:
FastMath.x64.obj ... Ok
FastMath.o ... Ok
FastMath.dll ... Ok
C:\Source\Analog\FastMath\Nasm>
Nasm is 2.12.
I omitted to mention that it is only the 32-bit assemble that throws the error and requires the hard-coded opcode.