+ i8086 asm implementation of fpc_frac_real, based on the i386 version

git-svn-id: trunk@26131 -
This commit is contained in:
nickysn 2013-11-24 18:30:40 +00:00
parent 1bf55d3086
commit bb0a3a7374

View File

@ -117,6 +117,24 @@
fstp st(1)
end;
{$define FPC_SYSTEM_HAS_FRAC}
function fpc_frac_real(d : ValReal) : ValReal;assembler;compilerproc;
asm
sub sp, 2
fnstcw [bp-2]
fwait
mov cx, [bp-2]
or word [bp-2], $0f00
fldcw [bp-2]
fld tbyte [d]
frndint
fld tbyte [d]
fsub st, st(1)
fstp st(1)
mov [bp-2], cx
fldcw [bp-2]
end;
{$define FPC_SYSTEM_HAS_INT}
function fpc_int_real(d : ValReal) : ValReal;assembler;compilerproc;
asm