From: Matthew Mastracci Newsgroups: comp.os.msdos.djgpp Subject: Re: Asm routine returns Date: Mon, 6 Oct 1997 21:22:19 -0600 Organization: The University of Calgary Lines: 36 Message-ID: <61c9up$2ea@ds2.acs.ucalgary.ca> References: NNTP-Posting-Host: mmastrac AT acs2 DOT acs DOT ucalgary DOT ca Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Mon, 6 Oct 1997, Sam Davies wrote: > I know that this error is actually a result of calling my routine, since > I can comment out the call to the function, and there's no problem... > So I'm assuming it must be that I messed up within the routine... I > modify SI, DI, BP, and DS, but I push and pop all these at the beginning > and end... Is there anything else that I could be screwing up in my > routine that is causing this strange behavior? I don't have to save the > other general registers, do I? I'm just curious: are you saving the extended 32-bit registers as well? Even if you only use the 16-bit registers, you should save and restore the extended ones. Your stack frame should look similar to this: push ebp mov ebp, esp push ds push edi push esi [program] pop esi pop edi pop ds mov esp, ebp pop ebp /\/\att /\/\astracci mmastrac AT acs DOT ucalgary DOT ca GCS/GE d- s+:+ a--- C++++ UA P+ L E-- W+ N++ o K+ w+ O M- V PS++ PE++ Y+ PGP t+++ 5+++ X++ R++ tv+ b+++ DI++++ I G++ e h r* z?