Search code examples
assemblysar

Assembly - Arithmetic Right shift (Sar)


Possible Duplicate:
SAR command in X86 assembly with one parameter

What does it mean when there is only a source and no destination parameter in a sar instruction?

example: sar %eax, when usually the instruction is of type sar source, destination?


Solution

  • It the same as SAR EAX,1.

    "Looks like the dissembler used short-hand for SAR EAX,1 which has an opcode of 0xD1F8. when the immediate is not 1, aka SAR EAX,xx, the opcode is 0xC1F8 xx, see the Intel Instruction reference, Vol. 2B, 4-353." source -> http://www.tinyguru.com/error/qid12813962.html