马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 18555587 于 2011-11-6 17:59 编辑 assume cs:code
data segment
db 10 dup(0)
data ends
code segment
start:
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
dtoc:
mov bx,10
mov di,0
s2:
mov dx,0
div bx
add dx,30h
push dx
inc di
mov cx,ax
jcxz s3
jmp short s2
s3:
mov cx,di
s4:
pop ax
mov [si],al
inc si
loop s4
mov si,0
ret
show_str:
mov ax,0b800h
mov es,ax
mov al,0a0h
dec dh
mul dh
mov bx,ax
mov al,2
mul dl
sub ax,2
add bx,ax
mov di,0
mov al,cl
mov ch,0
s1:
mov cl,[si]
jcxz s
mov es:[bx+di],cl
mov es:[bx+di+1],al
inc si
add di,2
jmp short s1
s:
ret
code ends
end start
|