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

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

Re: [avr-gcc-list] Function Pointers on AT90USB1287 and ATmega2561


From: Kasper Pedersen
Subject: Re: [avr-gcc-list] Function Pointers on AT90USB1287 and ATmega2561
Date: Fri, 22 Feb 2008 19:11:14 +0100
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Weddington, Eric wrote:
But I do find it strange that the AT90USB1287 uses a 3 byte PC for
call/ret and reti, thought it only has 128K of flash.

I find it extremely odd too, and I'm not at all sure that it is correct.
Some investigation will have to be done to verify this information.

unsigned char how_long_is_the_instruction_pointer(void)
{
unsigned sp1=SP;  unsigned sp2; //store stack ptr
asm volatile("call rrrtt\r\n rrrtt:\r\n"::); //move stack ptr by calling
 sp2=SP; cli(); SP=sp1; sei(); //restore stack
return sp1-sp2;
}

Result on USB1286 date code 0622 is 2
Result on USB1287 date code 0548 is also 2.

/Kasper Pedersen
(apologies if this one doubles)




reply via email to

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