|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
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 ds:[si],ax
ret
show_str:mov al,160
mul dh
mov ds:[si+5],ax
mov al,2
mul dl
add ax,ds:[si+5]
mov bx,ax
mov ds:[si+7],cl
mov ch,0
s:mov al,ds:[si+1]
mov ah,0
mov byte ptr ds:[si+2],10
div byte ptr ds:[si+2]
mov ds:[si+3],al ;商暂存ds:[si+3]
mov al,ds:[si]
div byte ptr ds:[si+2]
mov cl,ah ;余数在cl中
jcxz ok
mov ah,ds:[si+3] ;商在ax中
mov ds:[si],ax
push cx
inc byte ptr ds:[si+4]
jmp short s
ok:mov ax,0b800h
mov es,ax
mov dl,ds:[si+7]
s2:pop ax
add al,30h
mov es:[bx],al
mov es:[bx+1],dl
add bx,2
sub byte ptr ds:[si+4],1
mov cl,ds:[si+4]
jcxz ook
jmp short s2
ook:ret
code ends
end star |
|