SAR stands for Shift Arithmetic Right and the instruction performs arithmetic shift. The instruction preserves the sign of the value to be shifted and so the vacant bits are filled according to the sign-bit.
Compilers generate SAR instruction when right shift operator ">>" is used on a signed integer.
The use of SAR instruction can potentially lead to create a signedness bug if it's assumed the shift is unsigned.
more here.............http://reversingonwindows.blogspot.com/2014/07/inspection-of-sar-instructions.html
Compilers generate SAR instruction when right shift operator ">>" is used on a signed integer.
The use of SAR instruction can potentially lead to create a signedness bug if it's assumed the shift is unsigned.
more here.............http://reversingonwindows.blogspot.com/2014/07/inspection-of-sar-instructions.html