ÓÑÇéÌáʾ£ºÈç¹û±¾ÍøÒ³´ò¿ªÌ«Âý»òÏÔʾ²»ÍêÕû£¬Çë³¢ÊÔÊó±êÓÒ¼ü¡°Ë¢Ð¡±±¾ÍøÒ³£¡ÔĶÁ¹ý³Ì·¢ÏÖÈκδíÎóÇë¸æËßÎÒÃÇ£¬Ð»Ð»£¡£¡ ±¨¸æ´íÎó
ÒÀÒÀС˵ ·µ»Ø±¾ÊéĿ¼ ÎÒµÄÊé¼Ü ÎÒµÄÊéÇ© TXTÈ«±¾ÏÂÔØ ½øÈëÊé°É ¼ÓÈëÊéÇ©

windows»·¾³ÏÂ32λ»ã±àÓïÑÔ³ÌÐòÉè¼Æ-µÚ8²¿·Ö

°´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·­Ò³£¬°´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ£¬°´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿£¡
¡ª¡ª¡ª¡ªÎ´ÔĶÁÍꣿ¼ÓÈëÊéÇ©ÒѱãÏ´μÌÐøÔĶÁ£¡




MASMÌõ¼þ²âÊԵĻù±¾±í´ïʽÊÇ£º

¼Ä´æÆ÷»ò±äÁ¿¡¡¡¡²Ù×÷·û¡¡²Ù×÷Êý

Á½¸öÒÔÉϵıí´ïʽ¿ÉÒÔÓÃÂß¼­ÔËËã·ûÁ¬½Ó£º

£¨±í´ïʽ1£©Âß¼­ÔËËã·û£¨±í´ïʽ2£©¡¡Âß¼­ÔËËã·û£¨±í´ïʽ3£©¡­

ÔÊÐíµÄ²Ù×÷·ûºÍÂß¼­ÔËËã·ûÈç±í3¡£5Ëùʾ¡£

±í3¡£5¡¡¡¡Ìõ¼þ²âÊÔÖеIJÙ×÷·û

²Ù×÷·ûºÍÂß¼­ÔËËã¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡²Ù¡¡¡¡¡¡¡¡×÷¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Óá¡¡¡¡¡¡¡Í¾
¡¡

¡¡µÈÓÚ
¡¡±äÁ¿ºÍ²Ù×÷ÊýÖ®¼äµÄ±È½Ï
¡¡
£¡=
¡¡²»µÈÓÚ
¡¡±äÁ¿ºÍ²Ù×÷ÊýÖ®¼äµÄ±È½Ï
¡¡
¡·¡¡
¡¡´óÓÚ
¡¡±äÁ¿ºÍ²Ù×÷ÊýÖ®¼äµÄ±È½Ï
¡¡
¡·=
¡¡´óÓÚµÈÓÚ
¡¡±äÁ¿ºÍ²Ù×÷ÊýÖ®¼äµÄ±È½Ï
¡¡

Ðø±í¡¡¡¡¡¡¡¡¡¡¡¡

²Ù×÷·ûºÍÂß¼­ÔËËã¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡²Ù¡¡¡¡¡¡¡¡×÷¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Óá¡¡¡¡¡¡¡Í¾
¡¡
¡¶¡¡
¡¡Ð¡ÓÚ
¡¡±äÁ¿ºÍ²Ù×÷ÊýÖ®¼äµÄ±È½Ï
¡¡
=3£©&&ebx¡¡¡¡¡¡¡¡¡¡¡¡£»y´óÓÚµÈÓÚ3ÇÒebxΪ·ÇÁãÖµ

£¨z&1£©£ü£ü£¡eax¡¡¡¡¡¡¡¡¡¡¡¡£»zºÍ1½øÐС°Ó롱²Ù×÷ºó·ÇÁã»òeaxÈ¡·´ºó·ÇÁã

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£»Ò²¾ÍÊÇ˵xµÄλ0µÈÓÚ1»òÕßeaxΪÁã

ϸÐĵĶÁÕßÒ»¶¨»á·¢ÏÖ£¬MASMµÄÌõ¼þ²âÊÔ²ÉÓõÄÊǺÍCÓïÑÔÏàͬµÄÓï·¨¡£È磡ºÍ&ÊǶԱäÁ¿µÄ²Ù×÷·û£¨È¡·´ºÍ¡°Ó롱²Ù×÷£©£¬£ü£üºÍ&&ÊDZí´ïʽ½á¹ûÖ®¼äµÄÂß¼­¡°Ó롱ºÍÂß¼­¡°»ò¡±£¬¶ø¡¢£¡=¡¢¡·¡¢¡¶¡¡µÈÊDZȽϷû¡£Í¬Ñù£¬¶ÔÓÚ²»º¬±È½Ï·ûµÄµ¥¸ö±äÁ¿»ò¼Ä´æÆ÷£¬MASMÒ²Êǽ«ËùÓзÇÁãÖµÈÏΪÊÇ¡°Õ桱£¬ÁãÖµÈÏΪÊÇ¡°¼Ù¡±¡£

MASMµÄÌõ¼þ²âÊÔÓï¾äÓм¸¸öÏÞÖÆ£¬Ê×ÏÈÊDZí´ïʽµÄ×ó±ßÖ»ÄÜÊDZäÁ¿»ò¼Ä´æÆ÷£¬²»ÄÜΪ³£Êý£»Æä´Î±í´ïʽµÄÁ½±ß²»ÄÜͬʱΪ±äÁ¿£¬µ«¿ÉÒÔͬʱÊǼĴæÆ÷¡£ÕâЩÏÞÖÆÀ´×ÔÓÚ80x86µÄÖ¸ÁÒòΪÌõ¼þ²âÊÔα²Ù×÷·ûÖ»ÊǼòµ¥µØ°Ñÿ¸ö±í´ïʽ·­Òë³Écmp»òtestÖ¸Á80x86µÄÖ¸ÁÖÐûÓÐcmp¡¡0£»eaxÖ®ÀàµÄÖ¸ÁͬʱҲ²»ÔÊÐíÖ±½Ó²Ù×÷Á½¸öÄÚ´æÖеÄÊý£¬ËùÒÔ¶ÔÕâÁ½¸öÏÞÖÆÊǺܺÃÀí½âµÄ¡£

³ýÁËÕâЩºÍ¸ß¼¶ÓïÑÔÀàËƵÄÌõ¼þ²âÊÔα²Ù×÷£¬»ã±àÓïÑÔ»¹ÓÐÌØÊâµÄÒªÇ󣬾ÍÊdzÌÐòÖг£³£Òª¸ù¾Ýϵͳ±êÖ¾¼Ä´æÆ÷Öеĸ÷ÖÖ±ê־λÀ´×öÌõ¼þÌøת£¬ÕâЩÔڸ߼¶ÓïÑÔÖÐÊÇÓò»µ½µÄ£¬ËùÒÔÓÖÔö¼ÓÁËÒÔÏÂһЩ±ê־λµÄ״ָ̬ʾ£¬ËüÃDZ¾ÉíÏ൱ÓÚÒ»¸ö±í´ïʽ£º

CARRY£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡±íʾCarryλÊÇ·ñÖÃλ

OVERFLOW£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡±íʾOverflowλÊÇ·ñÖÃλ

PARITY£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡±íʾParityλÊÇ·ñÖÃλ

SIGN£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡±íʾSignλÊÇ·ñÖÃλ

ZERO£¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡±íʾZeroλÊÇ·ñÖÃλ

Òª²âÊÔeaxµÈÓÚebxͬʱZeroλÖÃ룬Ìõ¼þ±í´ïʽ¿ÉÒÔдΪ£º

£¨eaxebx£©¡¡&&¡¡ZERO£¿

Òª²âÊÔeaxµÈÓÚebxͬʱZeroλÇåÁ㣬Ìõ¼þ±í´ïʽ¿ÉÒÔдΪ£º

£¨eaxebx£©¡¡&&¡¡£¡¡¡ZERO£¿

ºÍCÓïÑÔµÄÌõ¼þ²âÊÔͬÑù£¬MASMµÄÌõ¼þ²âÊÔαָÁî²¢²»»á¸Ä±ä±»²âÊԵıäÁ¿»ò¼Ä´æÆ÷µÄÖµ£¬Ö»ÊǽøÐС°²âÊÔ¡±¶øÒÑ£¬µ½×îºóËü»á±»±àÒëÆ÷·­Òë³ÉÀàËÆÓÚcmp»òtestÖ®ÀàµÄ±È½Ï»òλ²âÊÔÖ¸Áî¡£

3¡£5¡£2¡¡¡¡·ÖÖ§Óï¾ä

·ÖÖ§Óï¾äÓÃÀ´¸ù¾ÝÌõ¼þ±í´ïʽ²âÊÔµÄÕæ¼ÙÖ´Ðв»Í¬µÄ´úÂëÄ£¿é£¬MASMÖеķÖÖ§Óï¾äµÄÓï·¨ÈçÏ£º

¡£if¡¡Ìõ¼þ±í´ïʽ1

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡±í´ïʽ1Ϊ¡°Õ桱ʱִÐеÄÖ¸Áî

£§¡£elseif¡¡¡¡Ìõ¼þ±í´ïʽ2£§

¡¡¡¡¡¡¡¡±í´ïʽ2Ϊ¡°Õ桱ʱִÐеÄÖ¸Áî

£§¡£elseif¡¡¡¡Ìõ¼þ±í´ïʽ3£§

¡¡¡¡¡¡¡¡±í´ïʽ3Ϊ¡°Õ桱ʱִÐеÄÖ¸Áî

¡­

£§¡£else£§

¡¡¡¡¡¡¡¡ËùÓбí´ïʽΪ¡°·ñ¡±Ê±Ö´ÐеÄÖ¸Áî

¡£endif

×¢Ò⣺¹Ø¼ü×Öif/elseif/else/endifµÄÇ°ÃæÓиöСÊýµã£¬Èç¹û²»¼ÓСÊýµã£¬¾Í±ä³Éºê»ã±àÖеÄÌõ¼þ»ã±àα²Ù×÷ÁË£¬½á¹û¿ÉÊÇÌì²îµØ±ð¡£

ΪÁË˵Ã÷±àÒëÆ÷¾¿¾¹ÊÇÈçºÎ´¦ÀíÕâЩαָÁîµÄ£¬ÏÈдһ¶ÎÈçϵÄÔ´´úÂ룺

¡£if¡¡¡¡¡¡¡¡¡¡eax¡¡&&¡¡£¨ebx¡¡¡·=¡¡dwX£©¡¡£ü£ü¡¡£¡£¨dwY¡¡£¡=¡¡ecx£©

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡esi£»1

¡£elseif¡¡edx

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡esi£»2

¡£elseif¡¡esi¡¡&¡¡1

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡esi£»3

¡£elseif¡¡ZERO£¿¡¡&&¡¡CARRY£¿

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡esi£»4

¡£endif

È»ºó·´»ã±à£º

£»¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£if¡¡eax

£º00401000¡¡0BC0¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡or¡¡eax£»¡¡eax

£º00401002¡¡7408¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡je¡¡0040100C

£»¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¨ebx¡¡=¡¡dwX£©

£º00401004¡¡3B1D00304000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡cmp¡¡ebx£»¡¡dword¡¡ptr¡¡£§00403000£§

£º0040100A¡¡7308¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jnb¡¡00401014

£»¡¡¡¡¡¡¡¡¡¡¡¡¡¡£¨dwY¡¡£¡=¡¡ecx£©

£º0040100C¡¡390D04304000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡cmp¡¡dword¡¡ptr¡¡£§00403004£§£»¡¡ecx

£º00401012¡¡7507¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jne¡¡0040101B

£º00401014¡¡BE01000000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡esi£»¡¡00000001

£º00401019¡¡EB23¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jmp¡¡0040103E

£»¡¡¡¡¡¡¡¡¡¡¡¡¡¡elseif¡¡edx

£º0040101B¡¡0BD2¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡or¡¡edx£»¡¡edx

£º0040101D¡¡7407¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡je¡¡00401026

£º0040101F¡¡BE02000000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡esi£»¡¡00000002

£º00401024¡¡EB18¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jmp¡¡0040103E

£»¡¡¡¡¡¡¡¡¡¡¡¡¡¡elseif¡¡esi¡¡&¡¡1

£º00401026¡¡F7C601000000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡test¡¡esi£»¡¡00000001

£º0040102C¡¡7407¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡je¡¡00401035

£º0040102E¡¡BE03000000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡esi£»¡¡00000003

£º00401033¡¡EB09¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jmp¡¡0040103E

£»¡¡¡¡¡¡¡¡¡¡¡¡¡¡ZERO£¿

£º00401035¡¡7507¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jne¡¡0040103E

£»¡¡¡¡¡¡¡¡¡¡¡¡¡¡CARRY£¿

£º00401037¡¡7305¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jnb¡¡0040103E

£º00401039¡¡BE04000000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡esi£»¡¡00000004

£º0040103E¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡­



¡¡
À´Ô´£ºµç×Ó¹¤Òµ³ö°æÉç¡¡×÷ÕߣºÂÞÔƱò¡¡ÉÏÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡»ØÊéÄ¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏÂÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ÉÏÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡»ØÊéÄ¿¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ÏÂÒ»Ò³¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡


µÚ3Õ¡¡Ê¹ÓÃMASM


3¡£5¡¡¸ß¡¡¼¶¡¡Óï¡¡·¨£¨2£©

¡¡¡¡¡¡¡¡
¿ÉÒÔ¿´µ½£¬MASM±àÒëÆ÷¶ÔÕâЩÌõ¼þ·Ö֧αָÁîÓÅ»¯µÃÏ൱ºÃ£¬¿´µ½ÕâЩ·´»ã±àºóµÄÖ¸ÁΩһµÄ¸Ð¾õÊǺÃÏñÓֻص½ÁËDOS»ã±àʱ´ú·ÖÖ§Ö¸Áî¶ÑÖУ¬´ÓÕâÀï¿ÉÒÔ·¢ÏÖ£¬ÕâЩαָÁî°Ñ»ã±à³ÌÐòµÄ¿É¶ÁÐÔ»ù±¾ÉÏÌá¸ßµ½Á˸߼¶ÓïÑÔµÄˮƽ¡£

·ÖÎö·´»ã±à´úÂë¿ÉÒÔ·¢ÏÖ£¬ÔÚ²»Í¬µÄÌõ¼þÂú×ãÖ®ºó£¬ÏÈÊÇÖ´ÐÐÂú×ãÌõ¼þºóÐèÒªÖ´ÐеÄÖ¸ÁÈçÉÏÃæµÄmov¡¡esi£¬0001ºÍmov¡¡esi£»0002µÈÖ¸ÁÕâЩָÁîÖ´Ðк󣬺óÃ涼ÓÐÒ»¾äÖ±½ÓÌøתµÄÖ¸Áîjmp¡¡0040103E£¬0040103EµØÖ·¶ÔÓ¦Õû¸öÌõ¼þ·ÖÖ§½á¹¹µÄβ²¿£¬ÕâÒâζ×Å£¬ÓÉ¡¡¡£if/¡£elseif/¡£else/¡£endifÌõ¼þ·Ö֧αָÁî¹¹³ÉµÄ·ÖÖ§½á¹¹Ö»ÄÜÓÐÒ»¸öÌõ¼þ±»Âú×㣬Ҳ¾ÍÊÇ˵£¬³ÌÐò°´ÕÕ´ÓÉϵ½Ïµĸ÷¸öÌõ¼þ±í´ïʽ£¬Ë³ÐòÅжϣ¬µ±µÚÒ»¸öÌõ¼þ±í´ïʽÂú×ãµÄʱºò£¬Ö´ÐÐÏàÓ¦µÄ´úÂ룬Ȼºó¾ÍºöÂÔµôÏÂÃæËùÓеÄÆäËûÌõ¼þ±í´ïʽ£¬¼´Ê¹ºóÃæÓÐÁíÒ»¸öÂú×ãÌõ¼þʱҲÊÇÈç´Ë£¡

Èç¹ûÐèÒª¹¹³ÉµÄ·ÖÖ§½á¹¹¶ÔÓÚËùÓеıí´ïʽΪ¡°Õ桱¶¼ÒªÖ´ÐÐÏàÓ¦µÄ´úÂ룬¿ÉÒÔÀûÓöà¸ö¡¡¡£if/¡£endifÀ´Íê³É£¬ÈçÏÂËùʾ£º

¡£if¡¡¡¡¡¡¡¡¡¡±í´ïʽ1

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡±í´ïʽ1Ϊ¡°Õ桱ҪִÐеÄÖ¸Áî

¡£endif

¡£if¡¡¡¡¡¡¡¡¡¡±í´ïʽ2

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡±í´ïʽ2Ϊ¡°Õ桱ҪִÐеÄÖ¸Áî

¡£endif

¡­

¡¡Ê¹Óá¡¡£if/¡£else/¡£endif¹¹³É·Ö֧αָÁîµÄʱºò£¬²»ÒªÂ©Ð´Ç°ÃæµÄСÊýµã£¬if/else/endifÊǺê»ã±àÖÐÌõ¼þ»ã±àºê²Ù×÷µÄα²Ù×÷Ö¸Á×÷ÓÃÊǸù¾ÝÌõ¼þ¾ö¶¨ÔÚ×îºóµÄ¿ÉÖ´ÐÐÎļþÖаü²»°üÀ¨Ä³Ò»¶Î´úÂë¡£±ÈÈçÔÚ³ÌÐòµÄµ÷ÊԽ׶Σº

DEBUG¡¡¡¡¡¡¡¡¡¡equ¡¡1

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡­

if¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡DEBUG

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡invoke¡¡¡¡MessageBox£»NULL£»offset¡¡szText£»offset¡¡szCaption£»MB_OK

endif

¸Ã´úÂëÓÃÀ´ÏÔʾһ¸öµ÷ÊÔÐÅÏ¢£¬µ±³ÌÐòÕýʽ·¢ÐÐʱ£¬½«µÚÒ»¾ä¸ÄΪDEBUG¡¡equ¡¡0£¬È»ºóÔÙ±àÒ룬ÄÇô¿ÉÖ´ÐÐÎļþÖиù±¾²»»á°üÀ¨Õâ¶Î´úÂ룬ÕâºÍ¡£if/¡£else/¡£endif¹¹³É·ÖÖ§µÄαָÁîÍêÈ«ÊÇÁ½»ØÊÂÇé¡£

3¡£5¡£3¡¡¡¡Ñ­»·Óï¾ä

Ñ­»·ÊÇÖظ´Ö´ÐеÄÒ»×éÖ¸ÁMASMµÄÑ­»·Î±Ö¸Áî¿ÉÒÔ¸ù¾ÝÌõ¼þ±í´ïʽµÄÕæ¼ÙÀ´¿ØÖÆÑ­»·ÊÇ·ñ¼ÌÐø£¬Ò²¿ÉÒÔÔÚÑ­»·ÌåÖÐÖ±½ÓÍ˳ö£¬Ê¹ÓÃÑ­»·µÄÓï·¨ÊÇ£º

¡£while¡¡¡¡Ìõ¼þ²âÊÔ±í´ïʽ

¡¡¡¡¡¡¡¡Ö¸Áî

¡¡¡¡¡¡¡¡£§¡£break¡¡£§¡£if¡¡Í˳öÌõ¼þ£§£§

¡¡¡¡¡¡¡¡£§ntinue£§

¡£endw

»ò

¡£repeat

¡¡¡¡¡¡¡¡Ö¸Áî

¡¡¡¡¡¡¡¡£§¡£break¡¡£§¡£if¡¡Í˳öÌõ¼þ£§£§

¡¡¡¡¡¡¡¡£§ntinue£§

¡¡¡¡¡¡¡¡¡£until¡¡¡¡Ìõ¼þ²âÊÔ±í´ïʽ¡¡£¨»ò¡£untilcxz¡¡£§Ìõ¼þ²âÊÔ±í´ïʽ£§£©

¡£while/¡£endwÑ­»·Ê×ÏÈÅжÏÌõ¼þ²âÊÔ±í´ïʽ£¬Èç¹û½á¹ûÊÇ¡°Õ桱£¬ÔòÖ´ÐÐÑ­»·ÌåÄÚµÄÖ¸Á½áÊøºóÔٻص½¡¡¡£while´¦Åжϱí´ïʽ£¬Èç´ËÍù¸´£¬Ò»Ö±µ½±í´ïʽ½á¹ûΪ¡°¼Ù¡±ÎªÖ¹¡£¡£while/¡£endwÖ¸ÁîÓпÉÄÜÒ»±éÒ²²»»áÖ´Ðе½Ñ­»·ÌåÄÚµÄÖ¸ÁÒòΪÈç¹ûµÚÒ»´ÎÅжϱí´ïʽʱ¾ÍÓöµ½½á¹ûΪ¡°¼Ù¡±µÄÇé¿ö£¬ÄÇô¾ÍÖ±½ÓÍ˳öÑ­»·¡£

¡£repeat/¡£untilÑ­»·Ê×ÏÈÖ´ÐÐÒ»±éÑ­»·ÌåÄÚµÄÖ¸ÁȻºóÔÙÅжÏÌõ¼þ²âÊÔ±í´ïʽ£¬Èç¹û½á¹ûΪ¡°Õ桱µÄ»°£¬¾ÍÍ˳öÑ­»·£¬Èç¹ûΪ¡°¼Ù¡±£¬Ôò·µ»Ø¡¡¡£repeat´¦¼ÌÐøÑ­»·£¬¿ÉÒÔ¿´³ö£¬¡£repeat/¡£until²»¹Ü±í´ïʽµÄÖµÈçºÎ£¬ÖÁÉÙ»áÖ´ÐÐÒ»±éÑ­»·ÌåÄÚµÄÖ¸Áî¡£

Ò²¿ÉÒÔ°ÑÌõ¼þ±í´ïʽֱ½ÓÉèÖÃΪ¹Ì¶¨Öµ£¬ÕâÑù¾Í¿ÉÒÔ¹¹½¨Ò»¸öÎÞÏÞÑ­»·£¬¶ÔÓÚ¡£while/¡£endÖ±½ÓʹÓÃTRUE£¬¶Ô¡¡¡£repeat/¡£untilÖ±½ÓʹÓÃFALSEÀ´µ±±í´ïʽ¾ÍÊÇÈç´Ë£¬ÕâÖÖÇé¿öÏ£¬¿ÉÒÔʹÓá¡¡£breakαָÁîÇ¿ÖÆÍ˳öÑ­»·£¬Èç¹û¡¡¡£breakαָÁîºóÃæ¸úÒ»¸ö¡¡¡£if²âÊÔαָÁîµÄ»°£¬ÄÇôµ±Í˳öÌõ¼þΪ¡°Õ桱ʱ²ÅÖ´ÐС¡¡£breakαָÁî¡£

ÔÚÑ­»·ÌåÖÐÒ²¿ÉÒÔÓá¡ntinueαָÁîºöÂÔÒÔºóµÄÖ¸ÁÓöµ½¡¡ntinueαָÁîʱ£¬²»¹ÜÏÂÃ滹ÓÐûÓÐÆäËûÑ­»·ÌåÖеÄÖ¸Á¶¼»áÖ±½Ó»Øµ½Ñ­»·Í·²¿¿ªÊ¼Ö´ÐС£

ͬÑù£¬ÎªÁËÉîÈëÁ˽âMASM±àÒëÆ÷°ÑÑ­»·Î±Ö¸Áî±ä³ÉÁËʲô£¬ÏÂÃæ¶Ô±ÈÒ»¶ÎÔ´³ÌÐòºÍ·´»ã±àºóµÄ´úÂë¡£Ê×ÏÈÊÇÔ´³ÌÐò£º

¡¡¡¡¡¡¡¡¡£while¡¡¡¡eax¡¡¡·¡¡1

¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡esi£»1

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£break¡¡¡¡¡£if¡¡ebx

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ntinue

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡esi£»2

¡¡¡¡¡¡¡¡¡£endw

¡¡¡¡¡¡¡¡¡£repeat

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡esi£»1

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£break¡¡¡¡¡£if¡¡£¡ebx

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ntinue

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡esi£»2

¡¡¡¡¡¡¡¡¡£until¡¡¡¡¡¡¡¡¡¡¡¡eax¡¡¡·¡¡1

¡¡¡¡¡¡¡¡¡£repeat

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡¡¡¡¡¡¡¡¡esi£»1

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£break

¡¡¡¡¡¡¡¡¡£untilcxz

ÒÔÏÂÊÇ·´»ã±àºóµÄ´úÂ룺

£»¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£while¡¡¡¡µÚÒ»¸öÑ­»·¿ªÊ¼

£º00401000¡¡EB10¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jmp¡¡00401012

£º00401002¡¡BE01000000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡esi£»¡¡00000001

£º00401007¡¡0BDB¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡or¡¡ebx£»¡¡ebx

£»¡¡¡¡¡¡¡£break¡¡¡£if¡¡ebx

£º00401009¡¡750C¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jne¡¡00401017

£»¡¡¡¡¡¡ntinue

£º0040100B¡¡EB05¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jmp¡¡00401012

£º0040100D¡¡BE02000000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡esi£»¡¡00000002

£»¡¡¡¡¡¡¡£while¡¡eax¡¡¡·¡¡1

£º00401012¡¡83F801¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡cmp¡¡eax£»¡¡00000001

£º00401015¡¡77EB¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ja¡¡00401002

£»¡¡¡¡¡¡¡£repeat¡¡µÚ¶þ¸öÑ­»·¿ªÊ¼

£º00401017¡¡BE01000000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡esi£»¡¡00000001

£»¡¡¡¡¡¡¡£break¡¡¡£if¡¡£¡ebx

£º0040101C¡¡0BDB¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡or¡¡ebx£»¡¡ebx

£º0040101E¡¡740C¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡je¡¡0040102C

£»¡¡¡¡¡¡ntinue

£º00401020¡¡EB05¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jmp¡¡00401027

£º00401022¡¡BE02000000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡esi£»¡¡00000002

£»¡¡¡¡¡¡¡£until¡¡eax¡¡¡·¡¡1

£º00401027¡¡83F801¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡cmp¡¡eax£»¡¡00000001

£º0040102A¡¡76EB¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jbe¡¡00401017

£»¡¡¡¡¡¡¡£repeat¡¡µÚÈý¸öÑ­»·¿ªÊ¼

£º0040102C¡¡BE01000000¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡mov¡¡esi£»¡¡00000001

£»¡¡¡¡¡¡¡£break

£º00401031¡¡EB02¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡jmp¡¡00401035

£»¡¡¡¡¡¡¡£untilcxz

£º00401033¡¡E2F7¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡loop¡¡0040102C¡¡¡¡¡¡£»×¢ÒâÕâÀïÊÇloopÖ¸Á

¶Ô±ÈαָÁîºÍ·­Òë³ÉµÄʵ¼ÊÖ¸Á¿ÉÒÔ¶ÔÑ­»·µÄαָÁîÓиüºÃµÄÀí½â£º¡£break·­Òë³ÉÒ»¸öÌøתָÁîÌøµ½Ñ­»·½áÊøµÄµØ·½£¬ntinueÊÇÒ»¸öÎÞÌõ¼þÌøתָÁîÌøµ½Ñ­»·¿ªÊ¼µÄµØ·½£¬¡£whileÊÇÏȱȽÏÌõ¼þÔÙÖ´ÐÐÑ­»·Ì壬¶ø¡¡¡£repeatÊÇÏÈÖ´ÐÐÑ­»·ÌåÔٱȽÏÌõ¼þµÄ¡£

¶ÔÖ¸ÁîµÄ·ÖÎöÖпÉÒÔ·¢ÏÖ£¬¡£while/¡£endwºÍ¡¡¡£repeat/¡£untilÑ­»·Ã»ÓÐʹÓÃloopÖ¸ÁîµÄÓÅÊÆ£¬ÒòÎ
·µ»ØĿ¼ ÉÏÒ»Ò³ ÏÂÒ»Ò³ »Øµ½¶¥²¿ ÔÞ£¨0£© ²È£¨0£©
δÔĶÁÍꣿ¼ÓÈëÊéÇ©ÒѱãÏ´μÌÐøÔĶÁ£¡
ÎÂÜ°Ìáʾ£º ο´Ð¡ËµµÄͬʱ·¢±íÆÀÂÛ£¬Ëµ³ö×Ô¼ºµÄ¿´·¨ºÍÆäËüС»ï°éÃÇ·ÖÏíÒ²²»´íŶ£¡·¢±íÊéÆÀ»¹¿ÉÒÔ»ñµÃ»ý·ÖºÍ¾­Ñé½±Àø£¬ÈÏÕæдԭ´´ÊéÆÀ ±»²ÉÄÉΪ¾«ÆÀ¿ÉÒÔ»ñµÃ´óÁ¿½ð±Ò¡¢»ý·ÖºÍ¾­Ñé½±ÀøŶ£¡