我有另一種錯誤嘗試使用-fasm塊參數(這使英特爾風格彙編語法)與蘋果GCC 4.2.1編譯這在工作MSVC聯彙編代碼:塊組件的操作數沒有識別,標籤 'LASM $ TYPE' 使用,但不限定:GCC內聯彙編錯誤:塊組件操作不承認
typedef struct _MyStruct
{
int data;
//...
}MyStruct;
void testAsm()
{
MyStruct *pMyStruct = new MyStruct(); // Please not that I create an instance of MyStruct here only for the sake of simplicity
_asm
{
mov edi, pMyStruct
add edi, TYPE MyStruct // error: block assembly operand not recognized. label 'LASM$TYPE' used but not defined
//...
};
delete pMyStruct;
}
我該如何解決這個問題?
你究竟想要做什麼?我從來沒有在Visual C++中看到這樣的語法... – Goz 2011-06-03 09:58:45
其實,這是我第一次看到它,我無法找到文檔,它會覆蓋它... – Ryan 2011-06-03 10:11:34
我也遇到過這個問題 - 在另一個內聯彙編代碼中,使用了offset關鍵字:「mov eax,offset fptr」,其中fptr是一個函數「void fptr(void * pData)」...這次GCC報告錯誤「Block assembly operand not承認「:( – Ryan 2011-06-03 10:16:11