Hac4u
2018-04-25 00:27:12 UTC
What is the purpose of using SHR and SHL Instructions.
For example I have the following instructions.
0x0804854c <+12>: mov eax,0x0
0x08048551 <+17>: add eax,0xf
0x08048554 <+20>: add eax,0xf
0x08048557 <+23>: shr eax,0x4
0x0804855a <+26>: shl eax,0x4
=> 0x0804855d <+29>: sub esp,eax
Why was shr and shl used?
I am debugging using GDB and I am not using any switch for optimization.
For example I have the following instructions.
0x0804854c <+12>: mov eax,0x0
0x08048551 <+17>: add eax,0xf
0x08048554 <+20>: add eax,0xf
0x08048557 <+23>: shr eax,0x4
0x0804855a <+26>: shl eax,0x4
=> 0x0804855d <+29>: sub esp,eax
Why was shr and shl used?
I am debugging using GDB and I am not using any switch for optimization.