.386 .model flat,stdcall option casemap:none .stack 4096 include windows.inc ExitProcess PROTO,dwExitCode:DWORD STUDENT struct ;自定义数据结构 name DWORD ? ID DWORD ? STUDENT ends .data stwndclass WNDCLASS <> ;末初始化 stwndclass1 WNDCLASS <1,1,1,1,1,1,1,1,1,1> ;初始化 student1 STUDENT <> .code main PROC ;方法一 mov student1.ID ,01h ;访问结构成员 ;方法二:指针法访问结构 mov esi, offset student1 ;结构对象地址给esi mov ebx,[esi+STUDENT.ID] ;注意:不是tudent1.ID ;方法三: mov esi, offset student1 ;结构对象地址给esi assume esi:ptr STUDENT ;把寄存器esi定义为结构指针 mov ecx,[esi].ID assume esi:nothing ;取消定义 INVOKE ExitProcess,0 main ENDP END main
标签:汇编,student1,mov,STUDENT,DWORD,数据结构,ID,esi From: https://www.cnblogs.com/liming19680104/p/17867278.html