Is it possible to access directly struct fields within an assembly function? And how can I access via assembly an global variable?
In inline assembly on intel syntax I can do this:
struct str
{
int a;
int b;
}
int someGlobalVar;
__declspec(naked) void __fastcall func(str * r)
{
__asm
{
mov dword ptr [ecx].a, 2
mov dword ptr [ecx].b,someGlobalVar
}
}
How do I do this in a assembly x64 function (not inline), with ATT syntax (gcc), if it's not possible how do I do this in an inline function?