[ create a new paste ] login | about

Link: http://codepad.org/JhXSvMiX    [ raw code | fork ]

Evetro - C, pasted on Jul 9:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// direct method: "stack", mb shortest code
unsigned rbN5 (unsigned arg)
{
  __asm
  {
    mov edx, arg
    mov ecx, 32
    
NEXTBIT:
    shr edx, 1  // pop cf from edx
    rcl eax, 1  // push cf into eax
    loop NEXTBIT  // sub ecx, 1 + jnz NEXTBIT will be faster
  }
}


Create a new paste based on this one


Comments: