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: Joerg Wunsch
Subject: Re: [avr-gcc-list] Calling function with hard coded address
Date: Thu, 2 Nov 2006 22:42:27 +0100 (MET)

Simon Han <address@hidden> wrote:

> 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

Well, I can't seem to reproduce that in any way (but I don't have GCC
3.x anymore, only 4.1.x).  Can you get us some more source code to
reproduce?

In my case, GCC always emitted ICALL instructions.

Btw., the result will be the same anyway: as the processor cannot
support more than 128 KiB of ROM addresses, the upper address bits
will silently be masked off.


Claude Sylvain wrote:

> GCC-AVR do not seem to support EICALL, so address space for function
> pointers are limited to the first 64K.

This is wrong.  EICALLs are only needed for devices with *more* than
128 KiB of ROM, as the JUMP/CALL addressing uses 16-bit word
addresses.  ATmega640/1280/1281 appear to support EICALL anyway,
probably because the simply share the CPU code with their larger
siblings ATmega2560/2561.  EIND is effectively ignored on these
devices.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)





reply via email to

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