DATA SEGMENT
A DB 5,2,5,6,4,3
B DB ?
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
MOV CX,0000
MOV CL,06
LEA BX,A
MOV AL,00
MOV AH,BYTE PTR[BX]
L1:CMP AL,BYTE PTR[BX]
JNC L2
MOV AL,BYTE PTR[BX]
L2:CMP AH,BYTE PTR[BX]
JC L3
MOV AH,BYTE PTR[BX]
L3:INC BX
DEC CL
CMP CL,00
JNZ L1
MOV AH,4CH
INT 21H
CODE ENDS
END START
;OUTPUT:->
;-G CS: 0025
;
;AX=0206 BX=0006 CX=0000 DX=0000 SP=0000 BP=0000 SI=0000 DI=0000
;DS=0BF4 ES=0BE4 SS=0BF4 CS=0BF5 IP=0025 NV UP EI PL ZR NA PE NC
;0BF5:0025 B44C MOV AH,4C