Assembly Windows套接字asm:上下文堆栈为空
您好,我在使用NASM编译asm代码时遇到了结构问题 这是我的结构定义和声明:Assembly Windows套接字asm:上下文堆栈为空,assembly,nasm,winsock2,Assembly,Nasm,Winsock2,您好,我在使用NASM编译asm代码时遇到了结构问题 这是我的结构定义和声明: struc wsa_data_struct .wVersion resw 1 .wHighVersion resw 1 .szDescription resb WSADESCRIPTION_LEN .szSystemStatus resb WSASYS_STATUS_LEN .iMaxSckets resw 1 .ImaxUdpDg resw 1 .lpVend
struc wsa_data_struct
.wVersion resw 1
.wHighVersion resw 1
.szDescription resb WSADESCRIPTION_LEN
.szSystemStatus resb WSASYS_STATUS_LEN
.iMaxSckets resw 1
.ImaxUdpDg resw 1
.lpVendorInfo resb 1
.size
endstruc
wsa_dat:
istruc
at wsa_data_struct.wVersion, dw 0
at wsa_data_struct.wHighVersion, dw 0
at wsa_data_struct.szDescription, db 0
at wsa_data_struct.szSystemStatus, db 0
at wsa_data_struct.iMaxSckets, dw 0
at wsa_data_struct.ImaxUdpDg, dw 0
at wsa_data_struct.lpVendorInfo, db 0
iend
当我尝试编译代码时,会弹出以下错误:
error: (at:1) `%$strucname': context stack is empty
error: (at:1) `%$strucstart': context stack is empty
error: (at:1) `%$strucname': context stack is empty
error: (at:1) `%$strucstart': context stack is empty
error: (at:1) `%$strucname': context stack is empty
error: (at:1) `%$strucstart': context stack is empty
.
.
.
这只是结构声明的第一行,每行都需要结构名称:
istruc wsa_data_struct
见:
顺便说一句:
.size
需要一个类似于resd1
istruc
的类型需要结构的名称:
istruc wsa_data_struct
见:
顺便说一句:.size
需要类似于resd 1
的类型