【米么推文素材】汇编语言示例 求斐波那契数
来源:互联网 发布:得力美工刀片 编辑:程序博客网 时间:2024/06/05 17:25
TITLE assignment3-1 (assignment3-1.asm); Aodan Jing Student #:104134047INCLUDE Irvine32.inc.datamessage BYTE "How many values of the Fibonacci number sequence do you want? ",0message1 BYTE " ",0n DWORD 01h.codemain PROCmov edx,offset messagecall writestringcall READINTcall crlfmov ecx ,eax ; loop counterL1:push n ; n starts with 1call Fibcall writedec ;print fib numbermov edx,offset message1call writestring ; print space between numbersinc n ; go to the next oneloop L1call crlfcall waitmsgexitmain ENDPFib PROC push ebp mov ebp, esp mov ebx,[ebp+8] ; get n cmp ebx,2 ; if n =1,2 just return 1 ja L1 mov eax, 1 jmp quit L1: dec ebx ; n-1 push ebx call Fib ;get fib(n-1) push eax ; store fib(n-1) in stack mov ebx,[ebp+8] sub ebx, 2 ; n -2 push ebx call fib ; get fib(n-2) pop edx ; get fib(n-1) add eax,edx ; add them up to get fib(n) quit: pop ebp ret 4Fib ENDPEND main
阅读全文
0 0
- 【米么推文素材】汇编语言示例 求斐波那契数
- 求斐波那契数
- 求斐波那契数
- 求斐波那契数
- 汇编语言计算斐波那契
- 快速求斐波那契数(scheme实现)
- 求斐波那契数(fibonacci)--c语言版
- 大斐波那契数
- 偶斐波那契数
- mips汇编语言实现Fibonacci(斐波那契)数列
- 80x86 汇编语言编程:斐波那契数列
- 斐波那契数
- 斐波那契数
- 斐波那契数
- 斐波那契数
- 斐波那契数
- 斐波那契数
- 斐波那契数
- table表单边框样式设计
- APDU SW应答码处理,错误应答码解释
- 20. Valid Parentheses
- shell及linux基础
- java开发腾讯AI,共探人工智能
- 【米么推文素材】汇编语言示例 求斐波那契数
- Go语言解析Html
- 没有UI的Fragment的妙用——截屏
- oracle--8.分页查询
- Dynamics CRM Developer Extensions提升你的开发效率(Plug-in篇)
- 使用Keil 5,Keil4 烧录nrf51822,52832协议栈
- 如何将Apache日志文件按时间分隔存储
- Quantum Cascade Laser(QCL)
- flask-alchemy-pagination