I decided it was time to actually learn ASM instead of just messing with it :)

So for the first few questions..

What do ror, rol, and rcr actually do? Ive messed with them, but they seem to do the same as shl and shr

Next, when would you actually use those?


what registers do floating point arithmatic?

Sorry for the dumb questions. Newb alert! =P
Posted on 2003-05-10 16:58:51 by Torch

ror - rotate register right (i.e. LSB is placed in MSb of register)
rol - rotate register left (i.e. MSb is placed in LSb of register)
shr - shift register right (i.e. LSb is dropped into the carry bit, MSb = 0 )
shl - shift register left (i.e. MSb is dropped into the carry bit, LSb = 0 )
rcr - rotate with carry right (i.e. LSb is placed in carry bit, MSb is previous carry bit)
rcl - rotate with carry left (i.e. MSb is placed in carry bit, LSb is previous carry bit)


ror and lor are good for simply bit formating registers.
shr and shl are good for *2 and /2 integer math.
rcr and rcl are good for building data (formatting bits) as the result of some repetitve operation setting the carry bit each time through a loop.

Floating point has no registers. Its a stack. Like ESP but different as its internal into the FPU and not able to be directly accessed. Commands such as FLD (float load) push onto the stack, where FSTP (float store and pop) will pop from the stack. The FPU stack is only 8 layers high so you are limitied to what you put in befor performing an operation to maniplulate the bottom of the stack (st0) and (st1) with math operations such as FMUL, which will do [ St0 :<- St0 * St1 ], and remove st1 allowing all higher stack values to fall one step (st1 <- st2, st2 <- st3, etc.)

Hope this helps!
Posted on 2003-05-10 17:51:58 by NaN
SAR - lsb --> carry flag, msb --> temp, (shift bits right), temp --> msb
Same as SHR, but the top bit is the previous top bit instead of zero.

There are some good pictures in the Intel/AMD instruction manuals.
Posted on 2003-05-10 17:57:29 by bitRAKE