Reverse the bits of a byte.
char __declspec(naked) revbyte(char a)
{
_asm("movb 4(%esp), %al");
_asm("movw $8,%cx");
_asm("xorb %ah,%ah");
_asm("move:");
_asm("shrb $1,%al");
_asm("jnc shift");
_asm("inc %ah");
_asm("shift:");
_asm("rolb $1,%ah");
_asm("loop move");
_asm("rorb $1,%ah");
_asm("movb %ah,%al");
_asm("ret");
}