Forum: Mikrocontroller und Digitale Elektronik Fehler?


von Simon K. (simon) Benutzerseite


Lesenswert?

Hi Leute.

Ich habe hier ein Problem.
Und zwar wollte ich fragen ob
1
  ldi temp3, 64        //Vorladen mit 64
2
  mul framecnt, temp3      //Frames * 64 (64byte/frame)
3
4
  add ZL, r0        //Frameoffset addieren
5
  adc ZH, r1

das gleiche ist wie
1
  /*mov temp1, framecnt      //Framezähler holen
2
  clr temp2        //Highbyte löschen
3
  lsl temp1        //*2 Lowbyte
4
  rol temp2        //*2 Highbyte(mit Carry)
5
  lsl temp1        //*2 Lowbyte
6
  rol temp2        //*2 Highbyte(mit Carry)  
7
  lsl temp1        //*2 Lowbyte
8
  rol temp2        //*2 Highbyte(mit Carry)  
9
  lsl temp1        //*2 Lowbyte
10
  rol temp2        //*2 Highbyte(mit Carry)  
11
  lsl temp1        //*2 Lowbyte
12
  rol temp2        //*2 Highbyte(mit Carry)  
13
  lsl temp1        //*2 Lowbyte
14
  rol temp2        //*2 Highbyte(mit Carry)
15
    
16
  add ZL, temp1        //Frameoffset addieren
17
  adc ZH, temp2*/

Erste Variante ist kürzer und müsste ja eigentlich das Gleiche
bewirken. Richtig?

von Simon K. (simon) Benutzerseite


Lesenswert?

ALso bei Version 2 bitte die Kommentarzeichen rausstreichen.

von Simon K. (simon) Benutzerseite


Lesenswert?

Ah, ist das Gleiche. Hätte schwören können, dass der Rest meines
Programms 100% Richtig war.

Der Fehler lag woanders (Ein Flag nie gesetzt worden. Von daher
"hing" das Programm im gleichen Status)

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.