lt512a
INCLUDE lt512a.mac
.model small
.stack
.data
msg1 DB 'Please enter the number(xx):',0dh,0ah,'$'
msg2 DB 'The numbers entered are:',0dh,0ah,'$'
msg3 DB 'The sorting result(ascending):',0dh,0ah,'$'
crlf DB 0dh,0ah,'$'
maxcount = 100
count DW ?
buf db maxcount DUP(?)
.code
main PROC
mov ax,@data
mov ds,ax
dispmsg msg1
mov bx,OFFSET buf
call input
cmp cx,0
je START4
mov count,cx
dispmsg crlf
dispmsg msg2
mov bx,OFFSET buf
mov cx,count
START2:
mov al,[bx]
call ALdisp
dispchar ','
inc bx
loop START2
dispmsg crlf
mov bx,OFFSET buf
mov cx,count
call sorting
dispmsg msg3
mov bx,OFFSET buf
mov cx,count
START3:
mov al,[bx]
call ALdisp
dispchar ','
inc bx
loop START3
dispmsg crlf
START4:
mov ax,4c00h
int 21h
main ENDP
INCLUDE sub512a.asm
END main