求三十个数中的最小值

DATASP SEGMENT
xx DB 73, 59, 61, 45, 81
DB 107,37,25,14, 64
DB 3, 17, 9, 23, 55, 97
DB 115, 78, 121, 67
DB 215, 137, 99, 241
DB 36, 58, 87, 100, 74, 62
yy DB ?
DATASP ENDS
CODESP SEGMENT
ASSUME CS: CODESP, DS: DATASP
MAIN PROC FAR
START: PUSH DS
MOV AX, 0
PUSH AX
MOV AX, DATASP
MOV DS, AX

MOV AL, xx
MOV SI, OFFSET xx
MOV CX, 29
LOOP1: INC SI
CMP [SI], AL

JAE LOOP2
XCHG AL, [SI]
LOOP2: DEC CX
JNZ LOOP1
MOV yy, AL
RET
MAIN ENDP
CODESP ENDS
END START

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.