📄 5e.asm
字号:
stack segment stack 'stack'
dw 32 dup(?)
stack ends
data segment
Input db 255,0,256 dup (?)
MaxAddr dw ?
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 Input
mov ah,10
int 21H
mov ch,0
mov cl,Input[1]
mov SI,offset Input + 2
mov MaxAddr,SI
mov DI,0
mov bx,0
mov ax,0
mov dl,1
AGAIN:
LODSB
CMP al,','
JZ MYCMP
push ax
mov ax,bx
mov dh,10
mul dh
mov bx,ax
pop ax
sub al,030H
mov ah,0
add bx,ax
JMP SIGN
MYCMP:
INC dl
mov ax,bx
mov byte ptr [SI-1],'$'
CMP DI,ax
JS SIGN
mov DI,ax
mov word ptr MaxAddr,SI
mov bx,0
SIGN:
LOOP AGAIN
mov byte ptr [SI],'$'
mov al,0AH
mov ah,14
int 10H
;problem
add dl,030H
mov dh,dl
mov ah,2
int 21H
mov al,0AH
mov ah,14
int 10H
mov dx,MaxAddr
mov ah,9
int 21H
ret
begin endp
code ends
end begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -