avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Calling function with hard coded address


From: Simon Han
Subject: Re: [avr-gcc-list] Calling function with hard coded address
Date: Wed, 1 Nov 2006 11:19:04 -0800

To reply my own question.  :-)

The problem is that gcc does sign extension to the value.
Changing to value less than 0x7fe fixed the problem.

Simon

On Oct 31, 2006, at 9:30 PM, Simon Han wrote:

Hi all,

        I am trying to call functions with hard coded address as follow.

typedef void (*func_type)( void );

((func_type) 0x1D400)();

The problem is that the generated code is slightly different... (shown below)

ff 95 00 ea     call    0x7fd400

Compare to standard function call (shown below)

0e 94 00 ea   call   0x1d400

What happened was that the upper 8 bits (bit16 to bit23 of address bits) are set to 1's instead of 0's.

My questions are following.

1. Is this a bug?

2. is there a way to get around this?

I am using avr-gcc 3.4.3 and binutil 2.15.

Thank you for any suggestion,
Simon





_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list





reply via email to

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