avr-gcc dziwna konstrukcja

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From Polish to

Threaded View
;*************************************************************************
; 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



Re: avr-gcc dziwna konstrukcja
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
http://jump.to/fleury

;*************************************************************************
; 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ł



Re: avr-gcc dziwna konstrukcja
Michał Lankosz przemówił ludzkim głosem:

Quoted text here. Click to load it
"1"
Quoted text here. Click to load it

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

Re: avr-gcc dziwna konstrukcja
Quoted text here. Click to load it

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ł



Site Timeline