I've tried to use the shift left command as 'shl eax, bl', but the MASM doesn't like that statement. Am I doing something wrong or should I do something like I've done below. This is a little different in that it's being called from Visual Basic with the CallWindowProc api call.

Thanks - Jack



.586
.model small
.code

GetBitIn32bitNo PROC STDCALL USES ebx ecx edx a32bitNo:dword, BitNo:dword, long3:dword, long4:dword

mov eax,a32bitNo
mov ebx,BitNo

;shl eax, bl doesn't work - substitute for shift left to BitNo
$label:
dec ebx
jz exit
shr eax,1
jmp $label

exit:
and eax,1

ret 16
GetBitIn32bitNo endp

END

Posted on 2002-03-05 23:31:42 by JackRazz
I don't know what manual you learned assembly from, but mine
says the only allowed versions of that instruction are:
SHL [i]reg[/i]/[i]mem[/i], 1

SHL [i]reg[/i]/[i]mem[/i], [b]CL[/b]
SHL [i]reg[/i]/[i]mem[/i], [i]imm8[/i]
Posted on 2002-03-05 23:45:18 by bitRAKE
Thanks for the info. I went back to the book and sure enough I mis-read the example. I still have a lot to learn.

Jack
Posted on 2002-03-06 20:00:04 by JackRazz