From: broeker AT acp3bf DOT knirsch DOT de (Hans-Bernhard Broeker) Newsgroups: comp.os.msdos.djgpp Subject: Re: Problems with DJGPP lib and grx23 Date: 29 Nov 1999 15:50:19 +0100 Organization: RWTH Aachen, III. physikalisches Institut B Lines: 53 Message-ID: <81u3rb$90k@acp3bf.knirsch.de> References: <4 DOT 2 DOT 0 DOT 58 DOT 19991126181032 DOT 00a65c40 AT hal DOT nt DOT tuwien DOT ac DOT at> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 943887022 16331 137.226.32.75 (29 Nov 1999 14:50:22 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 29 Nov 1999 14:50:22 GMT X-Newsreader: TIN [version 1.2 PL2] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Anton Helm (tony AT dictator DOT nt DOT tuwien DOT ac DOT at) wrote: > At 07:40 PM 11/24/99 +0100, you wrote: > Well, if you know what you are looking for, you probably find it. I > don't. Program crashes at _GR_shift_scanline+99 while running the > first inline asm part. This is somewhat mysterious as 99 is > definitely out of this inline asm part. (See the second asm file > attached below.) No, it isn't. That '99' is decimal, I think, i.e. it's the code found at address 0x63 in the disassembled listing, and that code is movb (%ecx),%ah and comes from the inline asm part of the routine. To quote the 2.81 disassembly: 56: 8a 2e movb (%esi),%ch 58: eb 06 jmp 60 <__GR_shift_scanline+60> 5a: 8d b6 00 00 00 leal 0x0(%esi),%esi 5f: 00 60: 4e decl %esi 61: 88 e8 movb %ch,%al 63: 8a 26 movb (%esi),%ah 65: 88 e5 movb %ah,%ch That's the beginning of the inline assembly block. As you see, %esi was chosen for term '%3' of the inline assembly. Same part, in 2.95 asm: 51: 8a 29 movb (%ecx),%ch 53: eb 0b jmp 60 55: 8d 74 26 00 leal 0x0(%esi,1),%esi 59: 8d bc 27 00 00 leal 0x0(%edi,1),%edi 5e: 00 00 60: 49 decl %ecx 61: 88 e8 movb %ch,%al 63: 8a 21 movb (%ecx),%ah 65: 88 e5 movb %ah,%ch I.e., it chose %ecx for %3. But that's *wrong*. It shouldn't have done that, as %ch which is explicitly used is part of %ecx, and thus %ecx is not available for holding an input/output expression. So it looks like putting '%ch' into the output register list of that asm block was not enough. Whole %ecx will have to be put there... I don't know the exact syntax, though... It's really time for the grx23 code to be patched, accordingly, or at least an 'official' patch should be made available, by its maintainers, on their web site. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.