fpc/tests/webtbs/tw2668.pp
2024-10-31 22:35:04 +01:00

40 lines
892 B
ObjectPascal

{ %skiptarget=android }
{ %cpu=i386 }
{ %OPT=-Cg- }
{ Source provided for Free Pascal Bug Report 2668 }
{ Submitted by "Marco" on 2003-09-06 }
{ e-mail: marco+bugs@freepascal.org }
{$ifdef fpc}{$MODE DELPHI} {$ASMMODE INTEL} {$endif}
type
TFloatingPointClass =
(
fpZero, // zero
fpNormal, // normal finite <> 0
fpDenormal, // denormalized finite
fpInfinite, // infinite
fpNaN, // not a number
fpInvalid // unsupported floating point format
);
const
FPClasses: array [0..5] of TFloatingPointClass =
(
fpInvalid,
fpNaN,
fpNormal,
fpInfinite,
fpZero,
fpDenormal
);
asm
MOV ECX,0
MOV EDX,0
MOVZX EAX, TFloatingPointClass(FPClasses[EDX])
MOVZX EAX, TFloatingPointClass([ECX].FPClasses[EDX])
LEA ECX,FPClasses
MOVZX EAX, TFloatingPointClass([ECX].1+2[EDX])
end.