汇编语言的简答入门--斐波那契数列(递归)
2013-10-08 21:47
441 查看
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 ; mov ebx,edx ; mov edx,ebp ; dec eax ;the times of recursion call Fibonacci L1: mov [esi],ebp ;result return address ret loop L1 Fibonacci ENDP END main
输出有错误请求各位兄长学长帮忙!感激不尽。
相关文章推荐
- 汇编语言的简答入门--斐波那契数列(递归)
- 汇编语言的简单入门--斐波那契数列(非递归)
- 汇编语言入门七:函数调用(一)
- 汇编语言入门
- 基础知识04 - 零基础入门学习汇编语言04
- [BX]和loop指令02 - 零基础入门学习汇编语言24
- 一本Linux下AT&T汇编语言与GCC内嵌汇编入门的中文书籍
- 包含多个段的程序03 - 零基础入门学习汇编语言31
- 更灵活的定位内存地址的方法02 - 零基础入门学习汇编语言33
- 更灵活的定位内存地址的方法06 - 零基础入门学习汇编语言37
- 使用BIOS进行键盘输入和磁盘读写03 - 零基础入门学习汇编语言77(完)
- 数据处理的两个基本问题03 - 零基础入门学习汇编语言40
- 数据处理的两个基本问题05 - 零基础入门学习汇编语言42
- 标志寄存器03 - 零基础入门学习汇编语言56
- 基础知识03 - 零基础入门学习汇编语言03
- 基础知识05 - 零基础入门学习汇编语言05
- [BX]和loop指令02 - 零基础入门学习汇编语言24
- [BX]和loop指令06 - 零基础入门学习汇编语言28
- 更灵活的定位内存地址的方法06 - 零基础入门学习汇编语言37
- 使用BIOS进行键盘输入和磁盘读写03 - 零基础入门学习汇编语言77(完)