lt512c.asm

来自「钱晓杰汇编语言的很多例子 非常经典 我从微辅网上下载的 希望对大家有用」· 汇编 代码 · 共 55 行

ASM
55
字号
;LT512C.ASM
dispchar    macro char
    mov dl,char
    mov ah,2
    int 21h
    endm
dispmsg macro message
    mov dx,offset message
    mov ah,9
    int 21h
    endm
	.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
	extern ALdisp:near,sorting:near,input:near
	.startup
	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: .exit 0
	end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?