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

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

Re: [avr-gcc-list] RE: ATMega128 RAMPZ behaviour changed ?


From: E. Weddington
Subject: Re: [avr-gcc-list] RE: ATMega128 RAMPZ behaviour changed ?
Date: Tue, 16 Dec 2003 09:37:51 -0700

On 16 Dec 2003 at 14:01, Simon Eatough wrote:

>  Hi Eric 
> Thanks for your reply, looking into it a bit further maybe its a compiler
> problem then:-
> 
> below is listing of code.
> // snip
> SamplePtr is unsigned long.
> alarm is at 0xc7e1 
> 
>    SamplePtr = &alarm;
>    143e8:     81 ee           ldi     r24, 0xE1       ; 225
>    143ea:     97 ec           ldi     r25, 0xC7       ; 199
>    143ec:     aa 27           eor     r26, r26
>    143ee:     97 fd           sbrc    r25, 7
>    143f0:     a0 95           com     r26                     << breaks 
> here.. 
>    143f2:     ba 2f           mov     r27, r26
>    143f4:     80 93 18 01     sts     0x0118, r24
>    143f8:     90 93 19 01     sts     0x0119, r25
>    143fc:     a0 93 1a 01     sts     0x011A, r26
>    14400:     b0 93 1b 01     sts     0x011B, r27
>        temp_value = pgm_read_byte_far(SamplePtr);
>    14404:     ab bf           out     0x3b, r26       ; 59    << RAMPZ loaded 
> with 0x FF here
>    14406:     fc 01           movw    r30, r24 14408: 87 91           elpm    
> r24, Z+
>    1440a:     80 93 26 01     sts     0x0126, r24
> 

What assembly do you get if you do this?:

#include <inttypes.h>
uint32_t SamplePtr;

SamplePtr = (uint32_t)&alarm;
temp_value = pgm_read_byte_far(SamplePtr);




reply via email to

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