This works also, and its pretty fast
int A = 0xAA000000;
int B;
__asm
{
mov eax, dword ptr [A] ;
mov ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
SHL eax,1 ;
ADC ebx,0 ;
MOV dword ptr [B],ebx ;
}
I know the following is better but he said no loops
int A = 0xAA000000;
int B;
__asm
{
mov eax, dword ptr [A] ;
mov ebx,0 ;
here:
SHL eax,1 ;
ADC ebx,0 ;
CMP eax, 0
JNE here
MOV dword ptr [B],ebx ;
}
codito ergo sum
|