Gast
#1603344
Warum steht in manchen Programmen:
_asm__ __volatile_
(
"rjmp 1f\n 1:" // 2 cycles
);
statt:
_asm__ __volatile_
(
"nop\n"
"nop\n"
);
|
Anzeige
|
2 Cycle-Delay: warum rjmp stat nop?
Gast
#1603344
Warum steht in manchen Programmen:
_asm__ __volatile_
(
"rjmp 1f\n 1:" // 2 cycles
);
statt:
_asm__ __volatile_
(
"nop\n"
"nop\n"
);
Wenn Du öfters den Source ausdruckst, dann spart die erste Variante Papier und Farbe.
Gast
#1603355
Dietmar schrieb: > asm_ __volatile_ > > ( > > "rjmp 1f\n 1:" // 2 cycles aber nur 1 Befehl > > ); > > > > statt: > > > > asm_ __volatile_ > > ( > > "nop\n" // 2 Befehle > > "nop\n" > > ); Spart Speicher! avr Vermutung: ein rjmp ist atomar und kann nicht durch einen Interrupt unterbrochen werden. Dietmar schrieb: > "rjmp 1f\n 1:" // 2 cycles Platzverbrauch: 1 Wort. > "nop\n" > "nop\n" Platzverbrauch: 2 Worte. Antwort schreibenBitte melde dich an, um einen Beitrag zu schreiben. |
Anzeige
|