k, somene can explain rorm rol this way i'll expain shr

shr eax,n
eax / 2 ^ n

now

rol eax, n
????

ror eax, n
????

tnx in advance
Posted on 2001-10-06 01:12:46 by Max
To explain it the easy way, we'll look at ROL EAX, 1. This is very
easy :)
Bits will be ROTATED LEFT. So, it's basically a SHL EAX, 1... except
the leftmost bit will be remembered, the shift will be done , and the
rightmost bit will be set to the remebered value. From here on,
arbitraty values should be easy to understand.
Posted on 2001-10-06 02:00:19 by f0dder
f0dder, heads-up this is a classic homework problem. He's looking for the algebraic equation for this... I've seen the assignment before.

Max, You've written almost half of the answer in your original post. this much I'll give you... You've got the remainder to consider (sum in) as well as the quotient, think about how you'd represent them so that the bits align as f0dder said. Try n=1 first & then expand from there.

over & out on this thread.
Posted on 2001-10-06 12:30:08 by rafe
tnx guys but rafe is right im looking for the algebraic equation ....thats the only way i can understand how it works :[
Posted on 2001-10-06 23:18:46 by Max
I don't know if we should tell you or not, we can't be doing your homework for you (if rafes right that is) ;)

But, heres rol eax; first part you knew eax = eax * 2^n and then you have to account for the roll over (if thats the right term) which is eax / 2^(32-n)

So in total you get eax = eax * 2^n + eax / 2^(32-n)

It should be easy to figure out ror from this. :)
Posted on 2001-10-07 05:17:03 by Eóin
If you need to understand what an instruction does, use the 16b version in debug.

Anyone know how to divide by 10 using shr? I can multiply easy by adding the results of shl 1 and shl 3.
Thanks
Posted on 2001-10-07 15:23:06 by eet_1024