1、定义结构
stTypeName struct
field1 Type ?
field2 Type ?
... ...
stTypeName ends
2、定义结构变量
2.1、无初始值结构变量
stVarName stTypeName <>
2.2、带初始值结构变量
stVarName stTypeName <initValue1 ,initValue2 ,...>
3、访问结构中的字段
3.1、直接访问结构字段
mov eax , stVarName.field1
3.2、使用指针访问结构字段
mov esi , offset stVarName
mov eax , [esi + stTypeName.field1] ; 注意是 stTypeName而不是 stVarName
3.3、使用结构指针访问结构字段
mov esi , offset stVarName
assume esi : ptr stTypeName ; 类似局部变量定义
mov eax , [esi].field1
... ...
assume esi : nothing