英文目已打在程式中,便不多了。
中文目描述:
在案中入氏列前 47 ,用 DWORD(32 bit)存
出如下:

出的候以 binary 方式去,因此,用 notepad++ 的外件去看吧。
充:
Notepad++ 的 Hex Editor 外
TITLE
;using file output by Irvine32 WriteToFile
;Problem: File of Fibonacci Numbers
;generates the first 47 values in the Fibonacci
;1, 1, 2, 3, 5, 8
INCLUDE Irvine32.inc
BUFFER_SIZE = 500
.data
; WriteTofile
fileHandle DWORD ?
buffer BYTE BUFFER_SIZE DUP(?)
bytesWritten DWORD ?
; CreateOutputFile
filename BYTE "output.txt", 0
.code
start PROC
; start process CreateOutputFile
mov edx, OFFSET filename
call CreateOutputFile
cmp eax, INVALID_HANDLE_VALUE
je file_error ; display error message
mov fileHandle, eax ; save the file handle
; end process CreateOutputFile
mov ecx, 47
mov eax, 0 ; f[0] = 0
mov ebx, 1 ; f[1] = 1
mov esi, OFFSET buffer
loopi: ; eax = f[i-2], ebx = f[i-1]
mov DWORD PTR [esi], ebx; write f[i]
add esi, 4
add eax, ebx ; f[i] = f[i-1]+f[i-2]
xchg eax, ebx ; swap(eax, ebx)
loop loopi
; start process WriteToFile
mov eax, fileHandle
mov edx, OFFSET buffer
mov ecx, 188 ; 47(Fibonacci number) * 4 bytes(DWORD)
call WriteToFile
mov bytesWritten, eax ; save return value
call CloseFile
; end process WriteToFile
file_error:
invoke ExitProcess, 0 ; end program
start ENDP
end start
文章定位: