21,458
社区成员
发帖
与我相关
我的任务
分享
assume cs:code,ds:data
data segment
quo dw 0 ;商
rem dw 0 ;余数
data ends
code segment
start:
mov ax,data
mov ds,ax
;
mov ax,1234h ;被除数高16位
mov dx,5678h ;低16位
mov cx,0123h ;除数高16位
mov bx,4567h ;低16位
;
s0:
sub dx,bx ;做32位减法
sbb ax,cx ;
cmp ax,cx ;高16位比较
jb s1
inc word ptr quo ;商增1
jmp s0
s1:
cmp dx,bx ;低16位比较
jb s2
inc word ptr quo ;商增1
jmp s0
s2:
mov word ptr rem,dx ;rem<--余数
;
mov ah,4ch
int 21h
code ends
end start