📄 8.asm
字号:
stack segment stack 'stack'
dw 32 dup(?)
stack ends
data segment
DecIn db 11,0,11 dup (?)
data ends
code segment
begin proc far
assume ss:stack,cs:code,ds:data
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
mov dx,offset DecIn
mov ah,10
int 21H
mov dl,00AH
mov ah,2
int 21H
mov cl,DecIn[1]
mov ch,0
Dec cx
mov SI,offset DecIn + 2
mov ax,0
OUTSIDE:
mov bx,cx
mov DI,SI
INSIDE:
mov al,[SI]
INC SI
CMP al,[SI]
JNS NEXT
XCHG al,[SI]
XCHG al,[SI-1]
NEXT:
Dec bx
CMP bx,0
JNZ INSIDE
mov SI,DI
LOOP OUTSIDE
mov bl,DecIn[1]
add bl,offset DecIn
add bl,2
mov bh,0
mov byte ptr [bx],'$'
mov dx,offset DecIn + 2
mov ah,9
int 21H
ret
begin endp
code ends
end begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -