Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly Language > Re: begginer qu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 19 of 23 Topic 4988 of 5163
Post > Topic >>

Re: begginer question

by Prime Mover <epleite@[EMAIL PROTECTED] > May 5, 2008 at 06:37 PM

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.
 




 23 Posts in Topic:
begginer question
Prime Mover <epleite@[  2008-05-02 20:05:41 
Re: begginer question
Robert Redelmeier <red  2008-05-03 04:36:41 
Re: begginer question
Frank Kotler <fbkotler  2008-05-03 09:19:00 
Re: begginer question
Herbert Kleebauer <kle  2008-05-03 12:04:20 
Re: begginer question
Phat Sam <phatsam@[EMA  2008-05-04 09:31:14 
Re: begginer question
Prime Mover <epleite@[  2008-05-03 11:17:42 
Re: begginer question
Robert Redelmeier <red  2008-05-03 20:11:01 
Re: begginer question
"Wolfgang Kern"  2008-05-04 11:04:32 
Re: begginer question
Robert Redelmeier <red  2008-05-04 18:59:10 
Re: begginer question
Frank Kotler <fbkotler  2008-05-03 22:21:13 
Re: begginer question
Prime Mover <epleite@[  2008-05-03 11:23:26 
Re: begginer question
"Wolfgang Kern"  2008-05-04 10:51:20 
Re: begginer question
"rio" <a@[EM  2008-05-05 18:58:54 
Re: begginer question
"Rod Pemberton"  2008-05-06 05:40:32 
Re: begginer question
Evenbit <nbaker2328@[E  2008-05-03 11:50:54 
Re: begginer question
kteixeira85@[EMAIL PROTEC  2008-05-04 06:54:40 
Re: begginer question
Robert Redelmeier <red  2008-05-04 19:04:49 
Re: begginer question
Phat Sam <phatsam@[EMA  2008-05-04 09:20:56 
Re: begginer question
Prime Mover <epleite@[  2008-05-05 18:37:43 
Re: begginer question
"Wolfgang Kern"  2008-05-06 10:17:25 
Re: begginer question
"rio" <a@[EM  2008-05-06 16:39:34 
Re: begginer question
Prime Mover <epleite@[  2008-05-05 18:50:50 
Re: begginer question
"Wolfgang Kern"  2008-05-06 10:30:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 18:04:43 CDT 2008.