assembly - Is this the correct interpretation of x86-64 shift instructions? -



assembly - Is this the correct interpretation of x86-64 shift instructions? -

movl %eax, %edx sarl $31, %edx shrl $31, %edx

i have above x86-64 code. interpreting mean sarl shift value of edx (which equivalent of eax) right arithmetically, meaning important bit fill 31 of 32 bits out of register, filling in right.

then, shrl, fills 31 important bits 0, leaving 1 lone bit in edx register. bit read '0' if eax positive , '1' if eax negative.

is right interpretation, or grasping concept incorrectly?

assembly x86-64 shift

Comments

Popular posts from this blog

c# - ASP.NET MVC Sequence contains no matching element -

java - Parsing XML, skip certain tags -

rest - How to invalidate user session on inactivity in a stateless server? -