21,458
社区成员
发帖
与我相关
我的任务
分享
code segment
assume cs:code
start: call L
call crlf
call J
call crlf
mov ax,4c00h
int 21h
;------------------
L: mov bx,0
mov cx,10
newchar:mov ah,1
int 21h
sub al,30h
cmp al,9
ja exit
cbw
xchg ax,bx
mul cx
add bx,ax
jmp newchar
exit: mov ax,bx
ret
;------------------
J: mov cx,16
retote:rol bx,1
mov dl,'0'
adc dl,0
mov ah,2
int 21h
loop retote
ret
;------------------
crlf: mov dl,0dh
mov ah,2
int 21h
mov dl,0ah
int 21h
ret
code ends
end start
code segment
assume cs:code
main proc
repeat:call L
call crlf
call J
call crlf
mov ax,4c00h
int 21h
ret
main endp
L proc
mov bx,0
mov cx,10
newchar: mov ah,1
int 21h
sub al,30h
cmp al,9
ja exit
cbw
xchg ax,bx
mul cx
xchg ax,bx
add bx,ax
jmp newchar
exit: mov ax,bx
ret
L endp
J proc
mov ch,16
retote:
mov cl,1
rol bx,cl
mov al,bl
and al,01h
add al,30h
printit: mov dl,al
mov ah,2
int 21h
dec ch
jnz retote
ret
J endp
crlf proc
mov dl,0dh
mov ah,2
int 21h
mov dl,0ah
mov ah,2
int 21h
ret
crlf endp
code ends
end main