汇编实验10-3
assume cs:code,ds:datadata segment
db 10 dup(0)
data ends
code segment
ho:mov ax,12666
mov bx,data
mov ds,bx
mov si,0
call dtoc
mov dh,8
mov dl,3
mov cl,2
call show_str
mov ax,4c00h
int 21h
show_str:
mov al,0a0h
dec dh
mul dh
mov bx,ax
mov al,2
mul dl
sub ax,2
add bx,ax
mov ax,0b800h
mov es,ax
mov di,0
mov ch,0
mov al,cl
show:
mov cl,
jcxz yes
mov es:,cl
mov es:,al
inc si
add di,2
jmp short show
yes:ret
dtoc:
push si
mov bx,0
hodiv:
mov dx,0
mov cx,10
div cx
mov cx,ax
jcxz ok
add dx,30H
push dx
inc bx
jmp short hodiv
ok:
add dx,30H
push dx
inc bx
mov cx,bx
mov si,0
s:
pop ax
mov ,al
inc si
loop s
over:
pop si
ret
code ends
end ho
页:
[1]