如何在不使用 DIV 指令但使用 shift 和 add 方法的情况下在 Assembly 中划分两个数字?
我用乘法做到了,这是我的代码:
mov bl, 56H ;For example
mov dl, 79H
;start
mov bh, 00H
mov dh, 00H
xor di, di
mov cx, 08H
L1:
shr dx, 1 ;shifting the multiplier
jnc nxt
add di, bx ;adding the multiplicand to the result register di
nxt:
shl bx, 1 ;shifting the multiplicand
loop L1
第二个问题:我的老师告诉我们,有一个指令叫做 MOVZE 来做我在第 4 行和第 5 行所做的事情,但它不起作用?我使用emu8086模拟器。