[英]How do I declare an extern variable in assembly code?
Asm.asm汇编
.code
OurFunc proc
sub edi, 0
jmp[jmpBk]
Ourfunc endp
end
Main.cpp主文件
extern DWORD jmpBk;
extern "C" void OurFunc();
int main()
{
ourFunc();
}
I get the following error我收到以下错误
1>Assembling Asm.asm...
1>Asm.asm(4): error A2006: undefined symbol : jmpBk
This isn't the actual code but how would I use the external DWORD variable in the.asm file.这不是实际代码,而是如何在 .asm 文件中使用外部 DWORD 变量。
I guess, you are using MASM.我猜,你正在使用 MASM。 If so, here's the code:
如果是这样,这是代码:
externdef jmpBk : near
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.