例如,我有数量6C0000h = 7077888d打印双字数目为10进制
除以10每个字,然后保存在堆栈在这种情况下不工作在剩余部分中,由于下部双字是0000.
任何提示的赞赏。
感谢
例如..
;number = 6c0000h
mov ax,word ptr number
;after this mov ax is 0000
;dividing by ten will mean dx = 0 and ax = 0 and 0 is saved on the stack
mov cx,0
repeat:
mov dx,0
div ten ;ten = 10
inc cx
push dx
cmp ax,0
ja repeat
mov ax,word ptr number+2
;after this ax is 6Ch
;i think this part is alright
repeat2:
mov dx,0
div ten
inc cx
push dx
cmp ax,0
ja repeat2
display:
pop dx
add dl,'0'
mov ah,02h
int 21h
loop display
此代码显示:1080和不7077888这将是预期的结果
108 = 6CH和结束0是从0000 DIV 10 ..
注意:我必须使用16位寄存器
作业我想! – 2010-12-05 15:52:50