¡¶Î¢»úÔ­ÀíÓë½Ó¿Ú¼¼Êõ¡·£¨µÚËİ棩ÖܺÎÇٿκóÏ°Ìâ´ð°¸ ÏÂÔر¾ÎÄ

MOV AH,SUM+1 MOV BL,07H DIV BL MOV AVG, AL HLT CODE ENDS

13. ÉèCS=1200H, IP=0100H, SS=5000H, SP=0400H, DS=2000H, SI=3000H, BX=0300H, (20300H)=4800H, (20302H)=00FFH, TABLE=0500H, PROG_N±êºÅµÄµØַΪ1200:0278 H£¬PROG_F±êºÅµÄµØַΪ3400:0ABCH¡£ËµÃ÷ÏÂÁÐÿÌõÖ¸ÁîÖ´ÐÐÍêºó£¬³ÌÐò·Ö±ðתÒƵ½ºÎ´¦Ö´ÐУ¿ JMPÖ¸Áî (1)JMP PROG_N

¶ÎÄÚÖ±½Ó½üתÒÆ£¬Ä¿µÄµØַΪ1200H:0278H(»ò12278H) (2)JMP BX

¶ÎÄڼĴæÆ÷¼ä½ÓתÒÆ£¬Ä¿µÄµØַΪ1200H:0300H(»ò12300H) (3)JMP [BX]

ÎïÀíµØÖ·£½DS¡Á10H+BX=2000H¡Á10H+0300H=20300H (20300H)=4800H¡úIP

¶ÎÄÚ´æ´¢Æ÷¼ä½ÓתÒÆ£¬Ä¿µÄµØַΪ1200H:4800H(»ò16800H) (4)JMP FAR PROG_F

¶Î¼äÖ±½ÓתÒÆ£¬Ä¿µÄµØַΪ3400H:0ABCH(»ò34ABCH) (5)JMP DWORD PTR[BX]

ÎïÀíµØÖ·£½DS¡Á10H+BX=2000H¡Á10H+0300H=20300H (20300H)=4800H¡úIP, (20302H)=00FFH¡úCS

¶Î¼ä´æ´¢Æ÷¼ä½ÓתÒÆ£¬Ä¿µÄµØַΪ00FFH:4800H(»ò057F0H)

JMP¸ÄΪCALLºó£¬Ä¿µÄµØÖ·ÓëJMPÏàͬ¡£ (1)CALL PROG_N

¶ÎÄÚÖ±½Óµ÷Óã¬3×Ö½ÚÖ¸ÁĿµÄµØַΪ1200H:0278H(»ò12278H)£¬0103HÈëÕ»£¬SP=03FEH (2)CALL BX

¶ÎÄڼĴæÆ÷¼ä½Óµ÷Óã¬2×Ö½ÚÖ¸ÁĿµÄµØַΪ1200H:0300H(»ò12300H) £¬0102HÈëÕ»£¬SP=03FEH (3)CALL [BX]

¶ÎÄÚ´æ´¢Æ÷¼ä½Óµ÷Óã¬2×Ö½ÚÖ¸ÁĿµÄµØַΪ1200H:4800H(»ò16800H)£¬0102HÈëÕ»£¬SP=03FEH (4)CALL FAR PROG_F

¶Î¼äÖ±½Óµ÷Óã¬5×Ö½ÚÖ¸ÁĿµÄµØַΪ3400H:0ABCH(»ò34ABCH)£¬1200HºÍ0105H·Ö±ðÈëÕ»£¬SP=03FCH

(5)CALL DWORD PTR[BX]

¶Î¼ä¼ä½Óµ÷Óã¬2×Ö½ÚÖ¸ÁĿµÄµØַΪ00FFH:4800H(»ò057F0H)£¬1200HºÍ0102H·Ö±ðÈëÕ»£¬SP=03FCH

²¿·Öµ÷ÊÔ³ÌÐò£º

END START

9

STACK SEGMENT STACK

DB 100 DUP(?) STACK ENDS DATA SEGMENT BUF DW 12

BUF1 DW 100 DUP (?) ORG 300H

DB 00H,48H,0FFH,00H DATA ENDS CODE SEGMENT

ASSUME CS:CODE,DS:DATA,SS:STACK START: PUSH DS

MOV AX,DATA

MOV DS,AX MOV BX,0300H CALL PROG_N CALL BX CALL [BX] ORG 0278

PROG_N:RET ORG 0300H RET ORG 4800H RET HLT CODE ENDS

END START

14. ÈçÔÚÏÂÁгÌÐò¶ÎµÄÀ¨ºÅÖзֱðÌîÈëÒÔÏÂÖ¸Á £¨1£©LOOP NEXT (2) LOOPE NEXT (3) LOOPNE NEXT

ÊÔ˵Ã÷ÔÚÕâÈýÖÖÇé¿öÏ£¬³ÌÐò¶ÎÖ´ÐÐÍêºó£¬AX, BX, CX, DX¼Ä´æÆ÷µÄÄÚÈÝ·Ö±ðÊÇʲô START: MOV AX, 01H

MOV BX, 02H

MOV DX, 03H MOV CX, 04H NEXT: INC AX ADD BX, AX¡« SHR DX, 1 ( ) ½â£º

LOOP¹ý³Ì£º AX BX CX

³õʼֵ

01H

DX

03 H

02H 04H

10

Ñ­»·1´Î 02H Ñ­»·3´Î 04H Ñ­»·4´Î 05H

04H 0BH 10H

03H 01H 01H 00H

DX 00H 01H 00H

00H 00H

Ñ­»·2´Î 03H 07H 02H 00H

½á¹û£º

AX BX CX (1) (2) (3)

20. Éè8086CPUµÄʱÖÓƵÂÊΪ5MHz£¬Çë±àдÑÓʱ5msµÄ×Ó³ÌÐò¡£ ½â£ºÎ¢»úµÄÖ÷ƵÂÊΪ5MHz

Ôò£ºÊ±ÖÓÖÜÆÚ=Ö÷ƵÂʵĵ¹Êý=1/£¨5¡Á10-6£©=0.2¦Ìs

ÑÓʱ5msÐèÒªµÄʱÖÓÖÜÆÚÊý= 5ms/ 0.2¦Ìs=25000 ÑÓʱ×Ó³ÌÐòÈçÏ£º

DELAY5£ºMOV CX£¬N 4 DLY1£ºNOP 3 ¡ÁN

LOOP DLY1 17 ¡Á£¨N-1£©+ 5 RET 16

Ó¦¸ÃÓÐ25000=4+ 3 ¡ÁN+ 17 ¡Á£¨N-1£©+ 5+16£¬²ÅÄÜʵÏÖÒªÇóµÄÑÓʱ¡£Ôò£º N=1250=04E2H ÑÓʱ×Ó³ÌΪ£º

DELAY5£ºMOV CX£¬04E2H DLY1£ºNOP

LOOP DLY1 RET

µÚ4ÕÂ×÷Òµ

P153

5. ÔĶÁÏÂÁгÌÐò£¬ËµÃ÷ÿÌõÖ¸ÁîÖ´ÐкóµÄ½á¹ûÊÇʲô£¿

X1 DB 65H, 78H X2 DW 06FFH, 5200H X3 DD ?

GO: MOV AL, TYPE X1 MOV BL, TYPE X2 MOV CL, TYPE X3

MOV AH, TYPE GO MOV BH, SIZE X2

MOV CH, LENGTH X3 ½â£º

£¨1£©Ç°ÈýÌõÓï¾äµÄ¹¦ÄÜÊÇÉèÖÃÊý¾ÝÓÚÊý¾Ý¶ÎÖУ¬´ÓÊý¾Ý¶ÎÆ«ÒƵØÖ·0000H¿ªÊ¼´æ·Å¡£

05H 02H 03H

10H 04H 07H

00H 03H 02H

Ö´ÐÐÒ»´Î£¬ZF=0£¬Í˳öÑ­»·¡£ Ö´ÐÐÁ½´Î£¬ZF=1£¬Í˳öÑ­»·¡£

11

±äÁ¿ X1 X2 X3

³ÌÐò»ã±àºó½á¹ûÈçÏ£º

Æ«ÒƵØÖ· 0000H 0001H 0002H 0003H 0004H 0005H 0006H 0007H 0008H 0009H

Êý¾Ý 65H 78H FFH 06H 78H 00H Ëæ»úÊý Ëæ»úÊý Ëæ»úÊý Ëæ»úÊý

ÁùÌõ³ÌÐòÖ´Ðнá¹ûÈçÏ£º

£¨AL£©=01H£»ÉèÖñäÁ¿ÀàÐÍÊôÐÔ£¬×Ö½ÚÊý £¨BL£©=02H£»ÉèÖñäÁ¿ÀàÐÍÊôÐÔ£¬×Ö½ÚÊý £¨CL£©=04H£»ÉèÖñäÁ¿ÀàÐÍÊôÐÔ£¬×Ö½ÚÊý

£¨AH£©=0FFH£»ÉèÖÃGOÏÔʾÀàÐÍ£¬½ü±êºÅ£¬Îª-1£¬²¹Âë±íʾ £¨BH£©=02H£»ÉèÖÃÊý¾ÝÀàÐÍ£¬ÎÞDUPʱ£¬·µ»ØÊý¾ÝÀàÐ͵Ä×Ö½ÚÊý £¨CH£©=01H£»ÎÞDUPʱ£¬·µ»Ø1¡£ ³ÌÐòÖ´Ðкó½á¹ûÈçÏ£º

µ÷ÊÔ³ÌÐòÈçÏ£º

12