8086汇编语言习题解答 - 百度文库

.

¡°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

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

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

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

PUSH PUSH

AX DS

£»EA=¶Î»ùÖµ+DISP=12000H+0345H=12345H

ÊÔÎÊÁ½ÌõÖ¸ÁîÖ´Ðкó£¬Í¼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 ¢Ý¡¢MOV ¢Þ¡¢SUB ¢ß¡¢ADC ¢à¡¢OR ¢á¡¢PUSH

AX,0FFH

£»Á¢¼´ÊýÑ°Ö· £»Ö±½ÓÑ°Ö· £»¼Ä´æÆ÷Ñ°Ö· £»¼Ä´æÆ÷¼ä½ÓÑ°Ö·

BL,[0FFH] DS,AX [SI],CX

DS:[0FFH],CL £»´øǰ׺µÄÖ±½ÓÑ°Ö· [BP][SI],AH £»»ùÖ·±äÖ·Ñ°Ö· AX,0ABH[BX] £»»ùÖ·Ñ°Ö· AX,-35[BX][DI] DS

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

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

.

.

¢â¡¢CMC

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

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

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

[BX][BP],AX [BP],BL

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

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

£»´í£¬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 XCHG

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

AX,OPRD¡±£¬ÈôÔ´²Ù×÷ÊýµÄÎïÀíµØַΪ095C0H£¬ÊÔÓÃ4ÖÖ²»Í¬Ñ°

CL,20H[DI][SI] [BP][DI],CX BX,20H[BX][SI] AX,2[BX] SI,[BX][DI] [SI],BX CX,32H[BX] AX,[SI]

Ö··½Ê½¸Ãд´ËÖ¸ÁҪÇóÉÏÊöÿ¸öÒÑÖªÌõ¼þÖÁÉÙҪʹÓÃÒ»´Î£©¡£

3.7¡¢ÒÑÖª£¨DS£©=1234H£¬£¨SI£©=124H£¬£¨12464H£©=30ABH£¬£¨12484H£©=464H

LEA

SI, [SI]

.

ÁªÏµ¿Í·þ£º779662525#qq.com(#Ì滻Ϊ@)