Gast
#5601
Hallo!
Hab folgende C-Funktion geschrieben mit eingebettetem Assembler-Code,
welche nichts weiter machen soll als einen gewissen Delay.
...void delay05(void)
...{
... asm volatile
... (
... // =============================
... // delay loop generator
... // 8333333 cycles:
... // -----------------------------
... // delaying 8333325 cycles:
297 " ldi R17, #37h" "\n\t"
298 "WGLOOP0: ldi R18, #D6h" "\n\t"
299 "WGLOOP1: ldi R19, #EBh" "\n\t"
... "WGLOOP2: dec R19" "\n\t"
... " brne WGLOOP2" "\n\t"
... " dec R18" "\n\t"
... " brne WGLOOP1" "\n\t"
... " dec R17" "\n\t"
... " brne WGLOOP0" "\n\t"
... // -----------------------------
... // delaying 6 cycles:
306 " ldi R17, #02h" "\n\t"
... "WGLOOP3: dec R17" "\n\t"
... " brne WGLOOP3" "\n\t"
... // -----------------------------
... // delaying 2 cycles:
... " nop" "\n\t"
... " nop" "\n\t"
... // =============================
... :
... :
... );
...}
Ich bekomme jedoch folgende Fehler vom Compiler:
C:\TEMP\ccXbaaaa.s: Assembler messages:
C:\TEMP\ccXbaaaa.s:297: Error: Bad expression
C:\TEMP\ccXbaaaa.s:297: Error: garbage at end of line
C:\TEMP\ccXbaaaa.s:298: Error: Bad expression
C:\TEMP\ccXbaaaa.s:298: Error: garbage at end of line
C:\TEMP\ccXbaaaa.s:299: Error: Bad expression
C:\TEMP\ccXbaaaa.s:299: Error: garbage at end of line
C:\TEMP\ccXbaaaa.s:306: Error: Bad expression
C:\TEMP\ccXbaaaa.s:306: Error: garbage at end of line
die Zeilen hab ich mit Zahlen markiert!
Was ist daran falsch und wie muss es richtig heißen?