马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
assume cs:code,ds:data,ss:ts
data segment
db 16 dup (0)
data ends
ts segment
dw 8 dup (0)
ts ends
code segment
ks: mov ax,12666
mov bx,data
mov ds,bx
mov si,0
mov bx,ts
mov ss,bx
mov sp,16
mov bx,0
call dtoc
mov dh,8
mov dl,3
mov cl,2
call show
mov ax,4c00H
int 21H
dtoc:
push dx
push cx
push bx
mov dx,0
t : mov bx,10
div bx
mov cx,ax
add dx,30H
mov [si],dl
inc si
jcxz f
jmp short t
f:
pop bx
pop cx
pop dx
push si
ret
show:
pop si
push bx
push cx
mov al,160
sub dh,1
mul dh
mov bx,ax
sub dl,1
mov al,2
mul dl
add bx,ax
mov ax,0b800H
add ax,bx
mov es,ax
mov di,0
mov ah,cl
s: mov al,[si]
mov es:[di],ax
sub si,1
mov cx,si
add di,2
loop s
mov al,[si]
mov es:[di],ax
push cx
push bx
ret
code ends
end ks
我改了一个早上了都一直在除法溢出是在没办法了来论坛求教求教
用debug看到除法的得二次循环就除法溢出了:Q |