bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with .code16gcc in gnu as


From: Alan Modra
Subject: Re: Problem with .code16gcc in gnu as
Date: Sat, 6 Oct 2001 14:40:56 +0930
User-agent: Mutt/1.3.17i

On Fri, Oct 05, 2001 at 05:46:22PM -0500, Brian Hurt wrote:
> 
> The problem I'm running into is the code:
>     *((int *) 0x600000ul) = 3;
> which compiles into the x86 instruction:
>       movl    $3, 0x600000
> basically.  The problem is that in 16-bit code, gnu as truncates the
> memory address constant to 16 bits, i.e. 0.  This is bad.
> 
> Is there any possibility to fix gas so that if it's in code16gcc mode, it
> recognizes 32-bit address constants and puts a proper addr32 prefix on the
> instruction?

Yes.  The place to tweak is tc-i386.c:i386_displacement.  You can use a
combination of stack_op and flag_code to determine whether you're in
.code16gcc mode.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]