΢»úÔÀíÓë½Ó¿Ú¼¼Êõ£¨µÚ¶þ°æ£© Ç廪´óѧ³ö°æÉç
MOV CX,80
COMPARE: MOV BX,0
CMP BUFF[BX],90 JB LP8 INC DA9 JMP NEXT LP8: LP7: LP6: LP5: NEXT: SUM: CMP BUFF[BX],80 JB LP7 INC DA8 JMP NEXT CMP BUFF[BX],70 JB LP6 INC DA7 JMP NEXT CMP BUFF[BX],60 JB LP5 INC DA6 JMP NEXT INC DA5 JMP NEXT INC BX
LOOP COMPARE MOV CX,80 XOR AX,AX MOV BX,00
ADD AX,BUFF[BX] INC BX LOOP LP1 MOV CL,80 DIV CL
MOV AVER , AL
25
΢»úÔÀíÓë½Ó¿Ú¼¼Êõ£¨µÚ¶þ°æ£© Ç廪´óѧ³ö°æÉç
MOV AH,4CH INT 21H CODE ENDS END START
13. ±àдһ¸ö×Ó³ÌÐò£¬¶ÔALÖеÄÊý¾Ý½øÐÐżУÑ飬²¢½«¾¹ýУÑéµÄ½á¹û·Å»ØALÖС£ ´ð£º
JIOU PROC
PUSH CX PUSH BX XOR AH, AH PUSH AX MOV CL, 7
LOOP1: SAR AL, 1
ADC AH, 0 LOOP LOOP1 MOV AL, AH XOR AH, AH MOV BL, 2 DIV BL MOV BL, AH POP AX ROR BL, 1 OR AL, BL POP BX POP CX RET
JIOU ENDP
14. ÀûÓÃÉÏÌâµÄ×Ó³ÌÐò£¬¶Ô80000H¿ªÊ¼µÄ256¸öµ¥ÔªµÄÊý¾Ý¼ÓÉÏżУÑ飬ÊÔ±à
26
΢»úÔÀíÓë½Ó¿Ú¼¼Êõ£¨µÚ¶þ°æ£© Ç廪´óѧ³ö°æÉç
³ÌÐò¡£
CODE SEGMENT
ASSUME CS: CODE START : MOV AX, 8000H MOV DS, AX MOV SI, 0 MOV CX, 256 LP: MOV AL, [SI] CALL JIOU MOV [SI], AL INC SI LOOP LP MOV AH, 4CH INT 21H JIOU PROC
PUSH CX PUSH BX XOR AH, AH PUSH AX MOV CL, 7
LOOP1: SAR AL, 1
ADC AH, 0 LOOP LOOP1 MOV AL, AH XOR AH, AH MOV BL, 2 DIV BL MOV BL, AH POP AX ROR BL, 1 OR AL, BL
27
΢»úÔÀíÓë½Ó¿Ú¼¼Êõ£¨µÚ¶þ°æ£© Ç廪´óѧ³ö°æÉç
POP BX POP CX RET JIOU ENDP CODE ENDS END START
28