8086汇编语言习题解答 - 百度文库 ÏÂÔر¾ÎÄ

ÓÃÒþº¬¶Î¼Ä´æÆ÷¡°CS¡±¡¢¡°SS¡±¡°ES¡±£¬²»ÄÜÓÃÆäËû¼Ä´æÆ÷Ìæ´ú£»

ÔÚ¡°È¡Ô´´®¡±¡¢¡°ÒÔBP×÷»ùÖ·¡±¡¢¡°´æÈ¡Ò»°ã±äÁ¿¡±Èý²Ù×÷ʱ£¬³ýÁË¿É·Ö±ðʹÓÃÒþº¬¶Î¼Ä´æÆ÷¡°DS¡±¡¢¡°SS¡±¡°DSÍ⣬»¹¿É·Ö±ðʹÓá°CS¡¢SS¡¢ES¡±£¬

¡°CS¡¢DS¡¢ES¡± ¡¢¡°CS¡¢SS¡¢ES¡±µÈ½øÐÐÌæ´ú¡£

£².£´¡¢8086/8088ϵÁÐ΢»úÔÚ´æ´¢Æ÷ÖÐÑ°ÕÒ´æ´¢µ¥ÔªÊ±£¬Âß¼­µØÖ·ÓÉÄÄÁ½²¿·Ö×é³É£¿

´ð£ºÔÚ8086/8088ϵÁÐ΢»úÔÚ´æ´¢Æ÷ÖÐÑ°ÕÒ´æ´¢µ¥ÔªÊ±£¬Âß¼­µØÖ·ÓɶλùÖµºÍÆ«ÒÆÁ¿Á½²¿·Ö×é³É£¬ËüÃǶ¼ÊÇ16λÎÞ·ûºÅ¶þ½øÖÆÊý¡£

£².£µ¡¢ÉèIBM PC΢»úÄÚ´æijһµ¥ÔªµÄÎïÀíµØÖ·ÊÇ12345H£¬ÊÔÍê³ÉÏÂÁв»Í¬µÄÂß¼­µØÖ·±íʾ£º

¢Ù¡¢1234H£º0005_H

£»

EA=

¶Î

»ù

Öµ

+DISP=12340H+0005H=12345H

¢Ú¡¢1200H£º0345H £»EA=¶Î»ùÖµ+DISP=12000H+0345H=12345H

£².£¶¡¢¼ÙÉèijÓû§³ÌÐò×°ÈëÄÚ´æºó£¬£¨SS£©=0950H£¬£¨SP£©=64H£¬ÊÔÎʸÃÓû§³ÌÐòµÄ¶ÑÕ»µ×²¿£¨×Öµ¥Ôª£©ÎïÀíµØÖ·ÊÇÊǶàÉÙ£¿

£².£·¡¢Éè¶ÑÕ»¶Î¼Ä´æÆ÷£¨SS£©=3E4BH£¬³ÌÐòÖÐÉèÖöÑÕ»³¤¶ÈΪ200¸ö×Ö½Ú¡£ÊÔ¼ÆËã³ö¶ÑÕ»µ×²¿×Öµ¥ÔªÎïÀíµØÖ·£¬¶ÑÕ»Ö¸ÕëSP³õʼֵ£¨¼´¶ÑÕ»ÖÐûÓÐÊý¾Ýʱ£©ºÍSP³õʼֵָÏòµÄÎïÀíµØÖ·¡£

£².£¸¡¢ÉèijÓû§³ÌÐò£¨SP£©=30H£¬£¨AX£©=1234H£¬£¨DS£©=5678H¡£ÈçÏÖÓÐÁ½ÌõÖ¸Á

PUSH

AX

PUSH DS

ÊÔÎÊÁ½ÌõÖ¸ÁîÖ´Ðкó£¬Í¼2.18Öи÷µ¥ÔªµÄÊý¾ÝÊǶàÉÙ? (SP)=?

´ð: (SP)=30H-4H=2CH

£².£¹¡¢ÔÚIBM-PC΢»úÉÏ£¬·Ö±ð½øÐÐÏÂÁÐ8λ¶þ½øÖÆÊýµÄÔËËãºó£¬±êÖ¾¼Ä´æÆ÷ÖÐOF¡¢ZF¡¢SF¡¢CFµÄÖµ¸÷ÊǶàÉÙ£¿

¢Ù¡¢10101011+01010101 ¢Û¡¢01010101-00111110 £².£±£°¡¢É裨SP£©=50H PUSH AX PUSH BX PUSH CX

Ö´ÐÐÉÏÊöÈýÌõÖ¸Áîºó£¬£¨SP£©= 44H¡£ £².£±£±¡¢É裨SP£©=6EH POP£Æ POP

AX

¢Ú¡¢11011010+11101101 ¢Ü¡¢10110011-01100010

Ö´ÐÐÉÏÊöÁ½ÌõÖ¸Áîºó£¬£¨SP£©= 72H ¡£

µÚÈýÕÂ

3.1¡¢ÊÔ·Ö±ð˵Ã÷ÏÂÁи÷Ö¸ÁîÖÐÔ´²Ù×÷ÊýºÍÄ¿µÄ²Ù×÷ÊýʹÓõÄÑ°Ö··½Ê½£º ¢Ù¡¢AND ¢Ú¡¢AND ¢Û¡¢MOV ¢Ü¡¢CMP

AX,0FFH BL,[0FFH]

DS,AX

£»Á¢¼´ÊýÑ°Ö· £»Ö±½ÓÑ°Ö·

£»¼Ä´æÆ÷Ñ°Ö·

[SI],CX £»¼Ä´æÆ÷¼ä½ÓÑ°Ö·

¢Ý¡¢MOV ¢Þ¡¢SUB ¢ß¡¢ADC ¢à¡¢OR ¢á¡¢PUSH ¢â¡¢CMC

DS:[0FFH],CL £»´øǰ׺µÄÖ±½ÓÑ°Ö·

£»»ùÖ·±äÖ·Ñ°Ö·

[BP][SI],AH

AX,0ABH[BX] £»»ùÖ·Ñ°Ö· AX,-35[BX][DI] £»»ùÖ·±äÖ·Ñ°Ö·

DS

£»¼Ä´æÆ÷Ñ°Ö·

£»Á¢¼´ÊýÑ°Ö·

3.2¡¢ÊÔ·Ö±ðÖ¸³öÏÂÁи÷Ö¸ÁîÓï¾äµÄÓï·¨ÊÇ·ñÓÐ´í£¬ÈôÓÐ´í£¬Ö¸Ã÷ÊÇʲô´íÎó¡£

¢Ù¡¢MOV ¢Ú¡¢TEST ¢Û¡¢ADD ¢Ü¡¢AND ¢Ý¡¢CMP ¢Þ¡¢SHR ¢ß¡¢NOT ¢à¡¢LEA ¢á¡¢INC ¢â¡¢PUSH

[BX][BP],AX

£»´í£¬BXÓëBP±ØÐë¶þÑ¡Ò»

[BP],BL £»ÕýÈ·

£»´í£¬Ô´Ä¿²Ù×÷Êý²»ÄÜͬʱΪ´æ´¢Æ÷ £»´í£¬Í¬Ò»¼Ä´æÆ÷¸ß¡¢µÍ×Ö½Ú²»ÄÜÓë £»ÕýÈ· £»ÕýÈ·

£»´í£¬NOTÖ¸ÁîÖ»ÓÐÒ»¸ö²Ù×÷Êý £»ÕýÈ· £»ÕýÈ·

£»ÕýÈ·

[SI],DA_BYTE DH,DL

CL,1234H [BX][DI],3 CX,AX

DS,35[SI] CX,1

45[DI]

3.3¡¢ÏÂÃæÁ½ÌõÖ¸ÁîÖ´Ðк󣬱êÖ¾¼Ä´æÆ÷ÖУãƣ¬£Á£Æ£¬£Ú£Æ£¬£Ó£ÆºÍ£Ï£Æ·Ö±ðÊÇʲô״̬£¿

£Í£Ï£Ö £Á£Ä£Ä

£Ä£Ì£¬£¬£¸£¶ £Ä£Ì£¬£°£Á£Á£È

´ð£ºÒÔÉÏÁ½ÌõÖ¸ÁîÖ´Ðкó£º

CF= AF= ZF= SF= OF=

3.4¡¢ÔÚ8086/8088CPUÖпÉÓÃÓÚ×÷µØÖ·Ö¸ÕëµÄ¼Ä´æÆ÷ÓÐÄÄЩ£¿ ´ð£º

3.5¡¢ÒÑÖª£¨DS£©=091DH£¬£¨SS£©=1E4AH£¬£¨AX£©=1234H£¬£¨BX£©=0024H

£¨CX£©=5678H£¬£¨BP £©=0024H£¬£¨SI£©=0012H£¬£¨DI£©=0032H£¬µ¥Ôª£¨09226H£©=00F6H£¬£¨09228H£©=1E40H£¬£¨1E4F6H£©=091DH ϸ÷Ö¸±êÁî»ò³ÌÐò¶Î·Ö±ðÖ´ÐкóµÄ½á¹ûÈçºÎ?

¢Ù¡¢MOV ¢Ú¡¢MOV ¢Û¡¢LEA MOV ¢Ü¡¢LDS

MOV ¢Ý¡¢XCHG

3.6¡¢ÒÑÖª£¨SS£©=0915H£¬£¨DS£©=0930H£¬£¨SI£©=0A0H£¬ £¨DI£©=1C0H£¬£¨BX£©80H£¬£¨BP£©=470H.ÏÖÓÐÒ»Ö¸Áî XCHG

CL,20H[DI][SI] [BP][DI],CX

BX,20H[BX][SI]

AX,2[BX]

SI,[BX][DI]

[SI],BX

CX,32H[BX] AX,[SI]