Re: RE: registers not saved

2002-12-12 Thread John Baldwin
On 12-Dec-2002 Matthew Dillon wrote: >:> function A calls function B which uses ecx as a loop index. The bad part is >function B never >:> saves/restores the value of ecx and function A starts dereferencing garbage. >:> >:> An informal sampling of my driver seems to indicate that ebx gets >:> pu

Re: RE: registers not saved

2002-12-11 Thread Matthew Dillon
:> function A calls function B which uses ecx as a loop index. The bad part is :function B never :> saves/restores the value of ecx and function A starts dereferencing garbage. :> :> An informal sampling of my driver seems to indicate that ebx gets :> pushed/poped at entry/exit but ecx and edx do

RE: registers not saved

2002-12-10 Thread John Baldwin
On 10-Dec-2002 Chuck Tuffli wrote: > I've been chasing down some weird panics in my CAM driver and have > noticed that functions don't seem to save all register values before > they modify them. > > For example, function A uses register ecx to hold the value of a pointer. Part way >through, > fu

Re: registers not saved

2002-12-10 Thread Matthew Dillon
In C for the IA32, EAX, ECX, and EDX are scratch registers. All other registers must be saved and restored by the procedure. Also keep in mind that the return value of a procedure is placed in eax. If the return value is a 64 bit value, it is placed in eax and edx.

Re: registers not saved

2002-12-10 Thread Chuck Tuffli
On Tue, Dec 10, 2002 at 04:58:34PM +0100, [EMAIL PROTECTED] wrote: > In message <[EMAIL PROTECTED]>, Chuck Tuffli write > s: > >I've been chasing down some weird panics in my CAM driver and have > >noticed that functions don't seem to save all register values before > >they modify them. > > > >For

Re: registers not saved

2002-12-10 Thread phk
In message <[EMAIL PROTECTED]>, Chuck Tuffli write s: >I've been chasing down some weird panics in my CAM driver and have >noticed that functions don't seem to save all register values before >they modify them. > >For example, function A uses register ecx to hold the value of a pointer. Part way >