avr-gcc dziwna konstrukcja

Mar 21, 2010 2 Replies

Jak zinterpretowaæ zapis poni¿szy skoków? Co to za etykiety czy warto¶ci "1" i "1f"? Fragment znajduje siê w pliku i2cmaster.S pobranym ze strony

formatting link
;************************************************************************* ; delay half period ; For I2C in normal mode (100kHz), use T/2 > 5us ; For I2C in fast mode (400kHz), use T/2 > 1.3us ;************************************************************************* .stabs "",100,0,0,i2c_delay_T2 .stabs "i2cmaster.S",100,0,0,i2c_delay_T2 .func i2c_delay_T2 ; delay 5.0 microsec with 4 Mhz crystal i2c_delay_T2: ; 4 cycles rjmp 1f ; 2 "



1: rjmp 2f ; 2 "
2: rjmp 3f ; 2 "
3: rjmp 4f ; 2 "
4: rjmp 5f ; 2 "
5: rjmp 6f ; 2 "
6: nop ; 1 " ret ; 3 " .endfunc ; total 20 cyles = 5.0 microsec with 4 Mhz crystal

Micha³



Michał Lankosz przemówił ludzkim głosem:

A do manuala zajrzałeś?

Local labels help compilers and programmers use names temporarily. They create symbols which are guaranteed to be unique over the entire scope of the input source code and which can be referred to by a simple notation. To define a local label, write a label of the form ‘N:’ (where N represents any positive integer). To refer to the most recent previous definition of that label write ‘Nb’, using the same number as when you defined the label. To refer to the next definition of a local label, write ‘Nf’—the ‘b’ stands for “backwards” and the ‘f’ stands for “forwards”.

Here is an example: 1: branch 1f 2: branch 1b 1: branch 2f 2: branch 1b

Which is the equivalent of: label_1: branch label_3 label_2: branch label_1 label_3: branch label_4 label_4: branch label_3

U¿ytkownik "Zbych" snipped-for-privacy@onet.pl napisa³ w wiadomo¶ci news:ho5vj9$2bb7$ snipped-for-privacy@news.mm.pl...

Mo¿e s³abo i nie tam gdzie trzeba szuka³em. Poza tym te¿ nie bardzo wiedzia³em, czego szukam. Dziêkujê za pomoc. Micha³

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required