马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
assume cs:code,ds:data,ss:stack
data segment
db 10 dup (0)
data ends
stack segment
dw 16 dup (0)
stack ends
code segment
start:mov ax,12666
mov bx,data
mov ds,bx
mov si,0
mov bx,stack
mov ss,bx
mov bx,32
call dtoc
mov dh,8
mov dl,3
mov cl,2
call show_str
mov ax,4c00H
int 21H
;=========================================
show_str:push dx
push cx
push si
mov di,0
mov bl,dh
dec bl
mov ax,160
mul bl
mov bx,ax
add dl,dl
add bl,dl
mov ax,0b800h
mov es,ax
mov al,cl
s:mov ch,0
mov cl,ds:[si]
jcxz ok
mov es:[bx+di],cl
mov es:[bx+di+1],al
add di,2
inc si
loop s
ok:pop dx
pop cx
pop si
ret
;==========================================
dtoc:push ax
push bx
push cx
push dx
push si
mov bx,10
s0:mov dx,0
div bx
add dx,30H
push dx
inc si
mov cx,ax
jcxz s1
loop s0
mov cx,si
mov bx,0
s1:pop ds:[bx]
inc bx
loop s1
pop si
pop dx
pop cx
pop bx
pop ax
ret
;=====================================
code ends
end start
|