Date: Tue, 24 Mar 1998 13:14:59 +0300 (IDT) From: Eli Zaretskii To: Viktor Lundstrom cc: djgpp AT delorie DOT com Subject: Re: is this an inline asm bug? In-Reply-To: <3516978c.33819073@nntpserver.swip.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: 8bit Precedence: bulk On Mon, 23 Mar 1998, Viktor Lundstrom wrote: > Something similar happened to me before... I used an inline asm > function to write to the text-mem (ie. 0xb8000), and the inline asm > function overwrote a pointer to a struct, resulting in GPFs... > I replaced the inline asm function with _farpokeb (or whatever - a > DJGPP function in any case), and it worked. I guess the DJGPP > function restored all the registers it clobbered, but my inline asm > function listed all the clobbed registers. Well, `_farpokeXX' functions are implemented in inline assembly, and they rely on GCC to reload any registers they clobber. See the header . You might compare the code there with your version, to see what exactly did you do differently. Perhaps there *is* a bug in GCC, but it is only limited to certain registers and not to all of them. Or perhaps you used a different constraint letter(s).