Date: Sun, 16 Aug 1998 11:20:30 +0300 (IDT) From: Eli Zaretskii To: Endlisnis cc: djgpp AT delorie DOT com Subject: Re: displaying a bmp In-Reply-To: <35D5BC70.41E201F@unb.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.