. 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