Thank you all for all the information and tips. It is been really
helpful.
I am trying to convert this algorithm below to assembly:
%%%%%%%%%%%%
Unsigned Multiplication Algorithm
AQ = Q*M
A = 0;
Q = operand1
M = operand2
C = carry
for (count=1 to count <= nbits)
begin
if Q[0] = 1 then
A = A+M
end if
****ft CAQ 1 bit to the right % CAQ is the C,A,Q grouped
end
%%%%%%%%%%%%%%%%%
I am doing like this, for 8-bit numbers:
mov AH, 0
mov AL, Q
mov BL, M
mov CL, 8; counter starts with 8
mov CF, 0; carry
L0:
cmp AL(0), 1; I need to access the first bit of AL!!!! don't know if
this is right
jne L1
add AH, BL
jmp L1
L1:
shr AX, 1
dec CF
cmp CF, 0
jng L0
Does that make sense???
Thank you again.


|