Mail Archives: djgpp/1998/09/10/18:45:34
Nate Eldredge wrote:
> > OK, Here is the input file, which seems to compile differently when giving asm
> > output, but it still isn't right! And included is the complete asm output, I
> > marked the place where it screws up, in the add function. Is there something
> > I'm doing wrong?
> I see you solved it, but I'm wondering about your original problem. How
> did you get that strange assembler? If you used a DJGPP tool to
> disassemble it, perhaps the disassembler has a bug. Actually, I suspect
> you might have looked at the assembly for something else by mistake...
Well, I can still seem to get the weird code, but now I think it may be the
Disassembler window screwing up (in RHIDE). I compiled the exact same code
with the exact same switches (-m486 included) with the exception of the -S for
asm output, here is what I got for asm output (for the function 'add' as you
can see)
.globl _add__Fii
_add__Fii:
LFB1:
.def .bf; .val .; .scl 101; .line 4; .endef
.def _a; .val 8; .scl 9; .type 04; .endef
.def _b; .val 12; .scl 9; .type 04; .endef
.def _Ret; .val 0; .scl 4; .type 04; .endef
pushl %ebp
LCFI0:
movl %esp,%ebp
LCFI1:
.ln 6
movl 8(%ebp),%eax
/APP
addl 12(%ebp), %eax
/NO_APP
.ln 8
leave
ret
And this is what I get from the Disassembler window:
add__Fii (at t2.cc:8):
000015a0: pushl %ebp
000015a2: inl $0x8b,%eax
000015a4: incl %ebp
000015a5: orb %al,(%ebx)
000015a7: incl %ebp
000015a9: leave
000015aa: ret
As you can see, I'm not getting the function confused, the label is clearly
visible, and it appear immediately before the main, in both asm and the deasm
window. AND the code does exactly what I want/expect it to do. But it just
doesn't look right from within RHIDE. It seems to get confused and think:
movl %esp,%ebp
movl 8(%ebp),%eax
addl 12(%ebp), %eax
is:
inl $0x8b,%eax
incl %ebp
orb %al,(%ebx)
incl %ebp
Can somebody tell me what the hex-code for each one of those would be? Also,
turning off the "-m486" switch generates the EXACT same code for this
function, but RHIDE seems to display it perfectly...??? Does it have anything
to do with -m486 changing the alignment of functions so RHIDE gets confused
and it's disassembler gets misaligned with the real code?
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT GeoCities DOT com
Endlis AT nbnet DOT nb DOT ca
- Raw text -