Fibonacci numbers written in Intel assembly

Source: Internet
Author: User
Extends delib kernel32.lib extends delib user32.lib extends delib irvine32.lib. 386. model flat, stdcall. stack 4096 exitprocess proto, dwexitcode: DWORD dumpregs Proto. datafirst DWORD 1; initialize the first number to 1 twodword 1; initialize the second number to 1 dest dword 12 DUP (0); output the first 12 Fibonacci numbers. codemain proc mov edX, offset DEST; edX is the Dest offset address mov ESI, 0; ESI is used for DEST index mov ECx, 10; loop 10 times, because mov eax, first; eax has been provided to store the results; MoV dword ptr [edX], eax; MoV eax, two; MoV dword ptr [edX + 4], eax; Start: Push ECx; MoV ECx, dword ptr [edX + ESI * 4]; inc esi; MoV eax, dword ptr [edX + ESI * 4]; add eax, ECX; inc esi; MoV dword ptr [edX + ESI * 4], eax; call dumpregs; Dec ESI; pop ECx; loop start; invoke exitprocess, 0 main endpend main

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.