Home > Software engineering >  Turn c/assembly
Turn c/assembly

Time:09-27

Everybody is good, met with mixed assembly in vs, now I want to change the originally 32-bit platform into 64, but 64 no longer support assembly of mix, so I would like to mix of assembly and to replace to implement in c + +,

Look at this section of the program, meets the control word that wouldn't be conversion, should how to write?

Int Log2_I2I (int value, BOOL roundUp)
{
WORD TMPCW tmprnddowncw;

If (roundUp)
Tmprnddowncw=0;
The else
Tmprnddowncw=0 x0400;

_asm
{
FNSTCW TMPCW//set the control word to round to on the down
Mov ax, TMPCW
And ax, 0 xf3ff
The or tmprnddowncw, ax

Fld1
Fild value
Fyl2x
Fistp value
FLDCW TMPCW//restore control word
}

return value;
}

CodePudding user response:

First, the function of the function?

CodePudding user response:

http://blog.csdn.net/shile/article/details/51198482
  • Related