急!!!汇编语言求超过25项的斐波那契数列

汇编语言求超过25项的斐波那契数列汇编语言求超过25项的斐波那契数列汇编语言求超过25项的斐波那契数列

希望可以解决你的问题:http://blog.csdn.net/ytdxyhz/article/details/12247107

 INCLUDE Irvine32.inc
.data

array DWORD 25 DUP (?)   ; define a array for saving Fibonacci numbers
step = type array

prompt byte "The first 25 fibonacci numbers are ",0
prompt1 DWORD "  ",0

.code
main PROC

mov esi,OFFSET array                ;edi = address of array

mov ecx,lengthof array              ;initialize loop conuter


mov edx,offset prompt               ;place the zero-ended string's offset in EDX
call writestring                    ;output the prompt

mov edx,offset prompt1              ;place the zero-ended string's offset in EDX

mov edi,0                           ;assign 0 to the first element
mov [esi],edi

mov eax,[esi]                       ;mov the first element to eax for outping
call writeint
call writestring

mov edi,1                           ;assign 1 to the first element              
mov [esi + 4],edi

mov eax,[esi + 4]                   ;mov the second element to eax for outping
call writeint
call writestring

sub ecx,2                           ;because we have output two element in array so we just need to the remain of element . 

L1:     

    mov edi,0                       ;every time we use this register,we need to clear it.
    add edi,[esi]
    add esi,step                    ;point to next element

    add edi,[esi]
    add esi,step                    ;point to next element

    mov [esi],edi
    mov eax,[esi]                   ;move an integer

    call writeint
    call writestring
    sub esi,step                    ;point to last element
    loop L1

    call waitmsg
exit
main ENDP
END main

是32bit汇编,用masm32编译

虽然过了很多年,但是发两个
https://download.csdn.net/download/WuZian_CSU/12634504
https://blog.csdn.net/WuZian_CSU/article/details/107428745