程序代码:
DATAS SEGMENT ARRAY DB 11,22,5,18,23,7,13,9,2,6 MAX DB ? MIN DB ? DATAS ENDS STACKS SEGMENT STACKS ENDS CODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKS START: MOV AX,DATAS MOV DS,AX MOV SI,00H MOV CX,OFFSET MAX MOV BX,OFFSET ARRAY SUB CX,BX MOV AL,[SI] MOV MAX,AL MOV MIN,AL LOP: MOV AL,[SI] CMP MAX,AL JAE NEXT ; MOV MAX,AL CMP MIN,AL JNB NEXT2 MOV MIN,AL NEXT: NEXT2: INC SI LOOP LOP MOV AH,4CH INT 21H CODES ENDS END START