第二个题的程序
.MODEL Small
.DATA
TABLE DB 9 DUP(?)
.STACK 200H
.CODE
MAIN PROC FAR
MOV AX,@DATA
MOV DS,AX
MOV SI,0
MOV CX,9
LIN:MOV BL,0
MOV AH,01H
INT 21H
SUB AL,30H
MOV BL,10
MUL BL
PUSH AX
MOV AH,01H
INT 21H
SUB AL,30H
MOV BL,AL
POP AX
ADD AL,BL
MOV TABLE[SI],AL
INC SI
MOV AH,02H
MOV DL,0AH
INT 21H
MOV DL,0DH
INT 21H
LOOP LIN
CALL OUTPUT
MOV CX,9
L1: MOV DX,0
MOV SI,0
PUSH CX
MOV CX,8
SUB CX,SI
L2: MOV AL,TABLE[SI]
CMP AL,TABLE[SI+1]
JB XX1
XCHG AL,TABLE[SI+1]
MOV TABLE[SI],AL
INC DX
XX1:INC SI
LOOP L2
POP CX
CMP DX,0
JZ NEXT
LOOP L1
NEXT:
MOV DL,0AH
MOV AH,02H
INT 21H
MOV DL,0DH
INT 21H
CALL OUTPUT
MOV AH,4CH
INT 21H
MAIN ENDP
OUTPUT PROC NEAR
MOV CX,9
MOV SI,0
MOV BL,10
LOUT:
MOV AL,TABLE[SI]
MOV AH,0
DIV BL
MOV DL,AL
PUSH AX
ADD DL,30H
MOV AH,02H
INT 21H
POP AX
MOV DL,AH
ADD DL,30H
MOV AH,02H
INT 21H
MOV DL,' '
INT 21H
INC SI
LOOP LOUT
RET
OUTPUT ENDP
END