Andrey Prozorov
|
Access to function local variables in asm statement
|
Andrey Prozorov
09/16/2009 2:40 PM
post38102
|
Access to function local variables in asm statement
I'm wondering how could I get an access to function local variables and arguments in assembler statements. It was very
easy under Windows but QCC inline assembler seems supports only access to global variables. Have someone a solution for
such a problem?
For example sorce code below cases
undefined reference to 'nBin'
undefined reference to 'tBcd'
messages
/*!
***********************************************************
* \brief CIO_GPS_EXPRESS reloadable settings
**********************************************************/
struct TBCD
{
long nLo;
long nMd;
long nHi;
};
TBCD tBcd;
long nBin;
/**
***********************************************************
* \brief
* Converts positive integer to BCD value
* using ASM x86 FPU code
*
* \param nInt
* Input value
*
* \return
* BCD value, limited to 99,999,999
*
***********************************************************/
long BinToBCD(long nBin)
{
TBCD tBcd;
asm(".intel_syntax noprefix");
asm("fwait");
asm("fild nBin");
asm("fbstp tBcd");
asm("fwait");
return tBcd.nLo;
}
|
|
|