Mail Archives: djgpp/1998/08/16/04:20:46
On Sat, 15 Aug 1998, Endlisnis wrote:
> > > 1] Your set_mode function should have a line like:
> > > memset(&r, 0, sizeof(r));
> > > or you might get unexpected (and undesired) results occationally.
> > Why? what does this do?
>
> It is covered in section #18.3 of the FAQ. The interrupt uses a stack provided
> by the caller, if you just let 'ss', and 'sp' be random (uninitialized) values, the
> you may crash your program. If they are zero'ed then __dpmi_int will make a stack
> for you.
The same section 18.3 also explains that __dpmi_int zeroes SS and SP
itself, so there's no need for the application to do that. It is only
required when the _go32_dpmi_simulate_int function is called.
- Raw text -