Gast
#283381
Hallo,
Umgebung Attiny2313 1Mhz, neuestes Winavr
wollte mal das Timingverhalten bei Portpins testen und hab mir dazu das
Assembler-Listing angeschaut.
#define LED_rot_an (PORTD |= (1<<LED_rot))
#define LED_rot_aus (PORTD &= ~(1<<LED_rot))
In der main Routine dann
do
{
LED_rot_aus;
LED_rot_an;
}
while (1);
Daraus erzeugt der Compiler fogendes:
do
{
LED_rot_aus;
78: 95 98 cbi 0x12, 5 ; 18
LED_rot_an;
7a: 95 9a sbi 0x12, 5 ; 18
7c: 95 98 cbi 0x12, 5 ; 18
7e: 95 9a sbi 0x12, 5 ; 18
80: fb cf rjmp .-10 ; 0x78
Wieso wird vor rjmp nochmals ein cbi und sbi gemacht, obwohl ich das
gar nicht programmiert habe.
Sollte es nicht so aussehen:
do
{
LED_rot_aus;
78: 95 98 cbi 0x12, 5 ; 18
LED_rot_an;
7a: 95 9a sbi 0x12, 5 ; 18
rjmp
Bitte erklärt mir das, danke
Volker