delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/16/05:11:52

Newsgroups: comp.os.msdos.djgpp
Date: Wed, 15 Nov 1995 18:04:15 -0500 (EST)
From: David Friedman <dfriedmn AT wam DOT umd DOT edu>
To: DJGPP Mailing List <djgpp AT sun DOT soe DOT clarkson DOT edu>
Subject: Re: GAS (i86) assembling incorectly

On Tue, 14 Nov 1995, Charles Sandmann wrote:

> > A note to everybody:
> >   It seems that if you don't specify a opcode suffix, GAS will assemble some 
> > instructions with the wrong opperand size and not produce any warnings or 
> > error messages! It gleefully assembled "out %al, %dx" into *outw %ax, 
>
> Always review code generated by GAS with a debugger.  It's one of the
> buggiest pieces of code I have ever seen.  It does a great job with GCC

> >   who just spent 3 days debugging before he solved the above problem
> 
> Ignored segment overrides and incorrect sizes have cost me at least
> 200 hours of V2 development time.  Even worse, sometimes segment 
> overrides would be generated properly (and sometimes ignored) if you changed 
> the *COMMENTS* in the GAS code.  Scary.  Much of V2's GAS code has 
> the numeric opcodes added for overrides to work around the bugs. 
> 

Sound advice.  I just started using DJGPP and didn't realize it came with 
a very nice disassembler.  That, and if I had read the FAQ would of 
cleared up the problem in 2 seconds.

Another problem: hex numbers without '0x' get the letters stripped out: A
"movl $3DA, %edx" (to start video adapter i/o) will assemble as movl $3, 
edx.  Fortunately, there didn't appear to be anything critical at that port 
address (phew!).

David Friedman

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019