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

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

Re: [avr-gcc-list] Puzzling behaviour of rjmp in assembler


From: E. Weddington
Subject: Re: [avr-gcc-list] Puzzling behaviour of rjmp in assembler
Date: Wed, 11 Dec 2002 14:06:34 -0700

On 6 Dec 2002 at 8:48, Tom Harris wrote:

> Greetings,
> 
> Using avr-gcc 20021111, I assembled the following:
> 
>  .section .text
>  .func i2c_delay_T2
> i2c_delay_T2:        
>  rjmp +2
>  rjmp +2
>  rjmp +2
>  rjmp +2
>  ret          
>  .endfunc     
> 
> using options `-c -x assembler-with-cpp -mmcu=at90s2313`.
> 
> On dumping the output with avr-objdump , the generated code has
> incorrect offsets. `rjmp -2' looks like an infinite loop. This code
> used to work with an old release of avr-gcc, I could find the verion
> if required.
> 
> 00000000 <i2c_delay_T2>:
>    0:   00 c0           rjmp    .+0             ; 0x2
>    2:   ff cf           rjmp    .-2             ; 0x2
>    4:   fe cf           rjmp    .-4             ; 0x2
>    6:   fd cf           rjmp    .-6             ; 0x2
>    8:   08 95           ret
> 
> Is this a bug or what?
> 

If you could post the same code assembled with an earlier version 
where it shows a difference in the output, that would be great.

Thanks
Eric

avr-gcc-list at http://avr1.org



reply via email to

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