わかりました、私はこれを解決することに非常に近づいているように感じますが、これに対して何もしていないようです. このプログラムは、フィボナッチ数列の 47 個の数値を作成し、それらを DWORDS の配列に格納してから、ファイル (fib.bin) に書き込む必要があります。フォーマットがめちゃくちゃになってしまいましたが、説明が必要な場合はお手伝いします。
INCLUDE Irvine32.inc
.data
fileHandle DWORD ?
filename BYTE "fib.bin", 0
FIB_COUNT = 47
array DWORD FIB_COUNT DUP(?)
.code
main PROC
; Create the file
mov edx,OFFSET filename
call CreateOutputFile
mov fileHandle,eax
; Generate the array of values
mov esi,OFFSET array
mov ecx,FIB_COUNT
call generate_fibonacci
; Write the array to a file
mov eax,fileHandle
mov edx,OFFSET array
mov ecx,SIZEOF array
call WriteToFile
; Close the file
mov eax,fileHandle
call CloseFile
exit
main ENDP
;---------------------------------------------------
generate_fibonacci PROC USES eax ebx ecx
;
; Generates fibonacci values and stores in an array.
; Receives: ESI points to the array, ECX = count
; Returns: nothing
;---------------------------------------------------
mov ebp, 0
mov edx, 1
mov ebx, edx
mov ecx, 47
L1:
mov eax, edx
mov ebp, eax
mov edx, ebx
add ebx, ebp
; dec ecx
loop L1
ret
generate_fibonacci ENDP
END main
私が見ている問題は、何も返されておらず、何を返す必要があるのか わからないことです。さまざまなレジスタを返そうとしましたが、すべてエラーが発生します。