วันจันทร์ที่ 10 พฤษภาคม พ.ศ. 2553

Fibonacci in Assembly

INCLUDE Irvine32.inc

          .data

         .code

main PROC

          mov ecx,7

          mov eax,0

          mov ebx,1

          mov edx,eax

          add edx,ebx

          call writedec

          call crlf

          xchg eax,ebx

          call writedec

          call crlf

          xchg ebx,eax

          mov eax,edx

          call writedec

          call crlf

l1:     mov edx,ebx

          add edx,eax

          mov eax,edx

          call writedec

          call crlf

          xchg ebx,eax

          loop l1

          exit

main ENDP

          END main

ไม่มีความคิดเห็น:

แสดงความคิดเห็น