Use of Shl in assembly

Posted by user3097712 on Stack Overflow See other posts from Stack Overflow or by user3097712
Published on 2014-06-03T02:28:24Z Indexed on 2014/06/03 3:26 UTC
Read the original article Hit count: 104

Filed under:

I have the following piece of lines and I do not understand that. Hope that someone can help me:

.....
MOV EAX, DWORD PTR SS:[EBP-0x4]
SHL EAX, 0x2
ADD EAX, DWORD PTR SS:[EBP-0x8]
PUSH EAX
....

Normally, it helps me to translate that into C language. But somehow I cant find a way to do it in that case. So, I only know that in the second line with SHL the register is multiplied by 4. And that the DWORD PTR SS:[EBP-0x4] looks like an array representation but i am not sure.

I also find the following link

x86 Assembler: shl and other instructions

But I dont understand the answer there. So my question would be: What it is going on there? Thx...

© Stack Overflow or respective owner

Related posts about assembly