C do while loop in Disassembly

Source: Internet
Author: User

Int fun () <br/>{< br/> int I = 0, a = 0; <br/> DO <br/>{< br/> A + = I; <br/>}while (I <100); <br/> return; <br/>}

Main disassembly code:

Do
{
A + = I;
00ad1a3c mov eax, dword ptr [A]
00ad1a3f add eax, dword ptr [I]
00ad1a42 mov dword ptr [a], eax
} While (I <100 );
00ad1a45 cmp dword ptr [I], 64 h
00ad1a49 JL fun + 2ch (0ad1a3ch)
Return;
00ad1a4b mov eax, dword ptr [A]
}

This is simpler than the for loop.

 

Analysis:

A: (Cyclic body)

CMP <cyclic variable> and <control variable>

Jl

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.