Dave Angel wrote:
>>   
> On general principle, I'd use
>    push ebx
> ...
>    pop ebx
>
> pairs around the cpuid instruction, if trashing ebx is a problem. 
> Seems to me it's safer than making any assumptions about implicit
> saves/restores.

That's what the "uses ebx" clause that I added to the "proc" statement
does.  It pushes ebx on entry, and pops it at every "ret".  The
advantage of that is that I don't have to worry about saving it
repeatedly throughout the function.  I'm free to do whatever I want to
ebx internally.


> I haven't looked at the cpuid instruction for years, but I'd push/pop
> any register (other than EAX) it modifies, and in between them do the
> cpuid and an appropriate move of whichever register.

Well, cpuid is kind of an odd exception, because it modifies all of the
general purpose registers (eax, ebx, ecx, edx) in one fell swoop.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to