Today I discovered that I had forgotten that shr 32 does nothing in a x86 program.

Today I discovered that I had forgotten that shr 32 does nothing in a x86 program.

Bit me nicely in the ass while trying to write some code that was supposed to pass a NativeUInt to a function accepting 64bit values as two 32bit parameters.

The input was NativeUInt as it was a memory size parameter, and my code was supposed to work on both 32bit and 64bit platforms.

I understand the shr behavior it's due to the ISA working that way, but a hint wouldn't hurt I think...

Comments