たとえば、私は番号6C0000h=7077888dを持っています
この場合、各単語を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
このコードは次のように表示されます:予想される結果である7077888ではなく1080
108 = 6Chで、終了0は0000div10からです。
注:16ビットレジスタを使用する必要があります