Home > Back-end >  C code is translated into the Delphi code, mainly is the assembly parts
C code is translated into the Delphi code, mainly is the assembly parts

Time:10-06

# define FLT_TO_UINT8 (a, b)
{
INT32 FLT_TO_INT_rval;
The __asm
{
The __asm FLD dword PTR [b]
The __asm fistp dword PTR [FLT_TO_INT_rval]
}
A=FLT_TO_INT_rval;
}


# define FLT_TO_INT32 (a, b)
The __asm
{
The __asm FLD dword PTR [b]
The __asm fistp dword PTR [a]
}

CodePudding user response:

The two macros can compile it,,,

CodePudding user response:

Both macro without newline \, you copy and paste in the wrong,,
Is to float into integer b (rounded) stored in a
In the Delphi can directly use Round () function
  • Related