Win32 compilation [30]-condition and loop pseudocommands:. If,. While,. Repeat, etc.

Source: Internet
Author: User
. If,. elseif,. Else,. endif: Conditional pseudocommand
 
; You can use a condition similar to that in the C language: A = BA! = BA> = ba

; implements flat, stdcallinclude windows. incinclude implements masm32.incinclude Debug. incincludelib implements masm32.libincludelib Debug. Lib. codemain proc XOR eax, eax. If! Eax printtext 'eax = 0'. endif; MoV eax, 3. If eax = 3 printtext 'eax = 3'. Else printtext' eax! = 3 '. endif; MoV eax, 4. if eax = 3 printtext 'eax = 3 '. elseif eax> 3 printtext 'eax> 3 '. else printtext 'eax; test30_2.asm.386.model flat, stdcallinclude windows. incinclude kernel32.incinclude masm32.incinclude debug. incincludelib kernel32.libincludelib masm32.libincludelib debug. lib. codemain proc mov eax, 1 mov edX, 0. if eax & edX printtext '&&'. endif. if eax | edX printtext' | ';. endif. if eax & edX printtext '&'. endif retmain endpend main

   

. While,. endw: while loop pseudocommand:

 
; Empty flat, stdcallinclude windows. incinclude unzip masm32.incinclude Debug. incincludelib uninstall Debug. Lib. codemain proc mov eax, 9. While eax> 0 printdec eax dec eax. endw retmain endpend main

  

. Repeat,. Until: repeat loop pseudocommand:

 
; Empty flat, stdcallinclude windows. incinclude release Debug. incincludelib release Debug. Lib. codemain proc mov eax, 9. Repeat printdec eax dec eax. Until eax = 0 retmain endpend main

  

Both. While and. Repeat support. Break and. Continue.

. While and. Break:
 
; Test30_6.asm.386.model flat, stdcallinclude windows. incinclude kernel32.incinclude masm32.incinclude debug. incincludelib kernel32.libincludelib masm32.libincludelib debug. lib. codemain proc mov eax, 9. while true printdec eax dec eax. break. if eax = 5. endw retmain endpend main

  

. Repeat and. Continue:

 
; Test30_7.asm.386.model flat, stdcallinclude windows. incinclude kernel32.incinclude masm32.incinclude debug. incincludelib kernel32.libincludelib masm32.libincludelib debug. lib. codemain proc mov eax, 0. repeat Inc eax. continue. if eax = 2 printdec eax. until eax> 3 retmain 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.