__asm?? Some help me!!
-
Hi, ok how do I access contents of a structure from inside asm code? For example I have a structure (with which I will make a list) typedef struct _LIST{ DWORD value; struct _LIST *next; }list; then I have a pointer of this structure list *my_list; After having input the data in this list, how can I traverse the list from inside __asm to read the variable "value" for each of the structures? i.e. How do I read my_list->value and my_list->next from inside __asm block? Thanks
-
Hi, ok how do I access contents of a structure from inside asm code? For example I have a structure (with which I will make a list) typedef struct _LIST{ DWORD value; struct _LIST *next; }list; then I have a pointer of this structure list *my_list; After having input the data in this list, how can I traverse the list from inside __asm to read the variable "value" for each of the structures? i.e. How do I read my_list->value and my_list->next from inside __asm block? Thanks
Ok. Here's a quick example. You should be able to figure out the rest. list *my_list; my_list = new list; my_list->value = 1234; my_list->next = new list; my_list->next->value = 5678; __asm { mov eax, my_list // eax = my_list; mov ebx, dword ptr [eax] // ebx = my_list->value mov ecx, dword ptr [eax+4] // ecx = my_list->next mov edx, dword ptr [ecx] // edx = ecx->value }