DATA SEGMENT
ARY DW 025AH,1357H,9706H,0040H,05C3H,86D0H,720FH,082AH,019DH,0124H
ORG 0050H
MAX DW 0
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, ES:DATA
ORG 100H
START: MOV CX, 9H ;循环次数=数据个数-1
MOV AX, SEG ARY
MOV ES, AX
LEA SI, ARY
MOV AX, ES:[SI] ;最大值初值
SCHMAX: ADD SI, 2
MOV DX, ES:[SI]
CMP DX, AX
JLE NEXT
MOV AX, DX
JMP NEXT
NEXT: LOOP SCHMAX
FINISH: MOV ES:[MAX], AX
INT 3 ;暂停,以便查看运行结果
CODE ENDS
END START
;;编译链接生成11-30SCH.exe, 在DOS的Debug中运行通过;
;;若按此例定义的10个带符号数,
;;运行结束,在MAX变量中保存的最大数是 +720Fh,
;;该结果,在Debug中,可用 D ES:0050 命令查看到。