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 12:35:00 -0800


On Nov 1, 2006, at 12:16 PM, Dave Hansen wrote:

From: Simon Han <address@hidden>
[...]
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)();

If this is the case, you should also be able to solve the problem by specifying the address as unsigned, e.g.

  ((func_type) 0x1D400U)();

Note the 'U' suffix.  Haven't tried it, though...

Regards,

  -=Dave

Hi Dave,

        I tried both 'U' and 'UL'.  Both cases compiled to the same error.
        BTW, I am using atmega128

Simon



_________________________________________________________________
Get today's hot entertainment gossip http://movies.msn.com/movies/ hotgossip?icid=T002MSN03A07001






reply via email to

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