I am having trouble translating the below assembly in to c++
MOVZX EAX, DX
Where EDX is a 32bit register. I need to get the lowest 16 bits(DX).
I've tried the following:
unsigned edx = 0x123ABCDE;
unsigned dx = (edx>>16) & 0xff;
I expect to get an the value of BCDE stored in dx, but it's gone a bit wrong.
Any help would be much appreciated.