Loading
클룩 할인코드 2024년 5월

피보나치 수열 어셈블리어

TITLE Program Template (firstPositiveNum.asm)

; 첫번째로 나타나는 양수?

INCLUDE Irvine32.inc


.data

fibcount DWORD 10 DUP(0)


.code

main proc

mov edx,1

mov esi, offset fibCount


mov [esi],edx

add esi,type dword


mov [esi],edx

add esi, type dword


mov ecx, lengthof fibcount - 2


mov esi,8

L1:


mov edx,fibcount[esi-8]

add fibcount[esi],edx


mov edx,fibcount[esi-4]

add fibcount[esi],edx


add esi, type dword

Loop L1




mov ecx, length fibcount

mov esi,offset fibcount


L2:


mov eax,[esi]

call writedec

add esi,type fibcount

call crlf


Loop L2




exit

main endp

end main