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

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

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


From: Tom Harris
Subject: [avr-gcc-list] Puzzling behaviour of rjmp in assembler
Date: Fri, 6 Dec 2002 08:48:40 +1100

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?

TomH <tomh(AT)optiscan(DOT)com>
avr-gcc-list at http://avr1.org



reply via email to

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