OHPen
January 24th, 2010, 13:34
Hi,
atm I'm writing a few functions in microsofts inline assembler using visual studio. probably most of you already did the same. Regarding the ms inline assembler i have a question.
masm for example allows it to use structure definitions which enables you to use something like this:
mov TPos[0].x,1
Its pretty neat to address struct members like that. I would love to do so in microsoft inline assembler as well!
Any idea how to achieve that ?
Thank you ;D
Regards,
OHPen
PS: I just found a solution for my problem. In microsoft inline assembler is obviously rather easy to use structs.
Look like this:
As you can see there is nothing you have to do. Simply use it. Nice, isn't it ? ;D
atm I'm writing a few functions in microsofts inline assembler using visual studio. probably most of you already did the same. Regarding the ms inline assembler i have a question.
masm for example allows it to use structure definitions which enables you to use something like this:
mov TPos[0].x,1
Its pretty neat to address struct members like that. I would love to do so in microsoft inline assembler as well!
Any idea how to achieve that ?
Thank you ;D
Regards,
OHPen
PS: I just found a solution for my problem. In microsoft inline assembler is obviously rather easy to use structs.
Look like this:
Code:
typedef struct const_data_area
{
byte teste;
DWORD a;
DWORD b;
} const_data_area_t;
__declspec(naked) void __stdcall afunction(void)
{
__asm
{
pusha
pushf
teste:
mov eax, teste
push [eax].b
As you can see there is nothing you have to do. Simply use it. Nice, isn't it ? ;D