-1
FindFirstFileおよびFindNextFileウィンドウ関数で見つかったファイルに関する情報を格納するWIN32_FIND_DATA構造体を初期化しようとしています。問題は、yasmのstuctを初期化する方法を理解できないことです。 ここに私のコードです:yasm x86アセンブリの構造体を初期化する
struc FILETIME
.dwLowDateTime resd 1
.dwHighDateTime resd 1
endstruc
struc WIN32_FIND_DATA
.dwFileAttributes resd 1
.ftCreationTime resb FILETIME_size
.ftLastAccessTime resb FILETIME_size
.ftLastWriteTime resb FILETIME_size
.nFileSizeHigh resd 1
.nFileSizeLow resd 1
.dwReserved0 resd 1
.dwReserved1 resd 1
.cFileName resb 260
.cAlternateFileName resb 14
endstruc
[bits 32]
section .text
extern _exit
global _main
_main:
push 0
call _exit
ret
section .data
dataWin32:
istruc WIN32_FIND_DATA
at a, dd 0
at b, db 0
at c, db 0
at d, db 0
at e, dd 0
at f, dd 0
at g, dd 0
at h, dd 0
at i, db 0
a
iend
私が得るエラーは以下のとおりです。
testStruct.asm:38: error: undefined symbol `b' (first use)
testStruct.asm:38: error: (Each undefined symbol is reported only once.)
testStruct.asm:39: error: undefined symbol `c' (first use)
testStruct.asm:40: error: undefined symbol `d' (first use)
testStruct.asm:41: error: undefined symbol `e' (first use)
testStruct.asm:42: error: undefined symbol `f' (first use)
testStruct.asm:43: error: undefined symbol `g' (first use)
testStruct.asm:44: error: undefined symbol `h' (first use)
testStruct.asm:45: error: undefined symbol `i' (first use)
'a、' 'b'などで何をすると思いましたか?構造にその名前のフィールドはありません! –
あなたは 'a'、 '.dwFileAttributes'の代わりに必要があるという意味ですか? –
@WeeBey:アセンブラーはあなたが望むものを推測することはできません。適切な識別子を使用する必要があります。そして、あなたはそれらを完全に修飾しなければなりません: 'WIN32_FIND_DATA.dwFileAttributes'など –