TITLE Save an array and dispaly
INCLUDE Irvine32.inc
.data
array DWORD 12 DUP (?) ; define a array for saving Fibonacci numbers
step = type array
num DWORD ?
count DWORD ?
prompt byte "The first twelve fibonacci numbers are ",0
prompt1 DWORD " ",0
.code
main PROC
mov edx,offset prompt
call writestring
mov ebx,0 ;they are for calculateing the value of array
mov edx,1 ;
mov ebp,0 ;
mov ecx,11 ;for outputing
mov eax,00h
display:
push eax
call Fibonacci
pop eax
call writeint
add eax,01h
loop display
call crlf
call waitmsg
exit
main ENDP
Fibonacci proc USES esi eax ebx edx ebp
mov esi,esp
add esi,24
mov eax,[esi] ;get the value of we have pushed it
cmp eax,1
jl L1
add ebp,ebx ;calculate the value of array
add ebp,edx ;
mo
汇编语言的简答入门--斐波那契数列(递归)
最新推荐文章于 2023-05-09 10:17:47 发布
这篇博客介绍了如何使用汇编语言实现斐波那契数列的递归算法,但在实际运行中遇到了输出错误的问题,作者寻求社区的帮助和解答。
摘要由CSDN通过智能技术生成