9

I want to convert this to C:

SHR CL,1

rECX is the name of the (32bit unsigned int)register variable. It should be simple, but I can't figure out the proper pointer magic :/

user3590
  • 101
  • 3
  • *(unsigned char*)&rECX >>= 1; I knew it was easy :) – user3590 Jan 08 '14 at 19:42
  • 1
    Folks, please don't forget to vote up questions, too! Although this would likely be more fitting for SO, it's a valid question that internauts may find useful. Voting will help it pop up more prominently and reward the asker. – 0xC0000022L Jan 09 '14 at 02:12

1 Answers1

13

rECX = (rECX & 0xFFFFFF00) | ((rECX & 0xFF) >> 1)

Jason Geffner
  • 20,681
  • 1
  • 36
  • 75