__declspec(naked) char* __fastcall bndw2FullBin(unsigned int dwnum, char* szdst)
{ // ECX = dwnum, EDX = szdst
__asm {
mov [esp-4], ebx
mov eax, edx
mov ebx, 32
L1:
shl ecx, 1
setc dl
add dl, 48
mov [eax], dl
sub ebx, 1
lea eax, [eax+1]
jnz short L1
mov ebx, [esp-4]
mov byte ptr[eax], 0
ret 0
}
}
__declspec(naked) char* __fastcall bndw2Bin(unsigned int dwnum, char* szdst)
{ // ECX = dwnum, EDX = szdst
__asm {
mov eax, edx
test ecx, ecx
jnz short L1
mov byte ptr[eax], 48
jmp short binEXIT
L1:
bsr eax, ecx
add eax, edx
mov [esp-4], eax
L2:
shr ecx, 1
setc dl
add dl, 48
mov [eax], dl
test ecx, ecx
lea eax, [eax-1]
jne short L2
mov eax, [esp-4]
binEXIT:
add eax, 1
mov byte ptr[eax], 0
ret 0
}
}
ciao...
BruNews, MVP VC++