"Project.exe (process 15848) exited with code 0" 汇编语言?
"Project.exe (process 15848) exited with code 0" in Assembly Language?
我正在尝试 运行 一个以十六进制显示斐波那契数列的 N 项的程序(N = 30),当我 运行 我的代码时,我没有显示十六进制数字,但我收到一条消息说 "Project.exe (process 15848) exited with code 0"。有人可以帮我解释一下为什么我收到这条消息而不是 30 个十六进制数吗?谢谢!我在 Windows 10.
上使用 Visual Studio 2019
这是我的代码:
; Create a procedure that produces N terms of a Fibonacci sequence in hexadecimal
INCLUDE Irvine32.inc
.data
fibArray DWORD 0h, 01h ; F0 = 0 and F1 = 1
.code
main proc
mov ecx, 30 ; Number of values wanted
mov edx, 0h
mov ebx, 1h
mov esi, 8; fibarray[0] = 0, fibarray[4] = 1, so fibarray[8] = fibarray[0]+fibarray[1]
sub ecx, 1; Because indexing starts at 0 and ecx is that amount of values we want
call Fibonacci
;DumpMem register parameters fulfilled
mov esi, OFFSET fibArray
mov ecx, LENGTHOF fibArray
mov ebx, TYPE fibArray
call DumpMem
exit
main endp
; Fibonacci procedure
Fibonacci proc
L1:
mov eax, edx
add eax, ebx
mov fibArray[esi], eax
mov edx, ebx
mov ebx, eax
add esi, 4
loop L1
ret
Fibonacci endp
end main
我通过调用 "fibArray DWORD dup 30 (?)" 为数组提供 30 个未初始化的点来解决问题。谢谢@Jester!
我正在尝试 运行 一个以十六进制显示斐波那契数列的 N 项的程序(N = 30),当我 运行 我的代码时,我没有显示十六进制数字,但我收到一条消息说 "Project.exe (process 15848) exited with code 0"。有人可以帮我解释一下为什么我收到这条消息而不是 30 个十六进制数吗?谢谢!我在 Windows 10.
上使用 Visual Studio 2019这是我的代码:
; Create a procedure that produces N terms of a Fibonacci sequence in hexadecimal
INCLUDE Irvine32.inc
.data
fibArray DWORD 0h, 01h ; F0 = 0 and F1 = 1
.code
main proc
mov ecx, 30 ; Number of values wanted
mov edx, 0h
mov ebx, 1h
mov esi, 8; fibarray[0] = 0, fibarray[4] = 1, so fibarray[8] = fibarray[0]+fibarray[1]
sub ecx, 1; Because indexing starts at 0 and ecx is that amount of values we want
call Fibonacci
;DumpMem register parameters fulfilled
mov esi, OFFSET fibArray
mov ecx, LENGTHOF fibArray
mov ebx, TYPE fibArray
call DumpMem
exit
main endp
; Fibonacci procedure
Fibonacci proc
L1:
mov eax, edx
add eax, ebx
mov fibArray[esi], eax
mov edx, ebx
mov ebx, eax
add esi, 4
loop L1
ret
Fibonacci endp
end main
我通过调用 "fibArray DWORD dup 30 (?)" 为数组提供 30 个未初始化的点来解决问题。谢谢@Jester!