1: 部分代码:
MOV CX,20
LEA BX,DATA
NEXT:MOV [BX],0
INC BX
LOOP NEXT
2:完整代码
DATA SEGMENT
BUFFER DB 2,4,3,6,1,5
COUNT DW 6
MAX DB ?
DATA ENDS
STACK1 SEGMENT PARA STACK
DW 20H DUP(0)
STACK1 ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,SS:STACK1
START: MOV AX,DATA
MOV DS,AX
;----BEGIN---
MOV CX,COUNT-1
MOV SI,0
MOV AL,BUFFER[SI]
NEXT: INC SI
CMP AL,BUFFER[SI]
JA LOP
MOV AL,BUF[SI]
LOP: LOOP NEXT
MOV MAX,AL
;---END----
MOV AH,4CH
INT 21H
CODE ENDS
END START