Gast
#1948778
Hallo erst einmal, bin dabei mich in Assambler einzuarbeiten.Und gehe
das AVR Tutorial durch. Nun habe ich ein Verständnisproblem, mit
folgendem Code, nach *Int_to_ASCII_schleife:* folgt* ldi temp6, -1+'0'*
was ist das für eine Konstante _-1+'0'_?
MFG Roderrich
Int_to_ASCII:
push ZL ; Register sichern
push ZH
push temp5
push temp6
ldi ZL,low(Tabelle*2) ; Zeiger auf Tabelle
ldi ZH,high(Tabelle*2)
ldi temp5, 10 ; Schleifenzähler
*Int_to_ASCII_schleife:*
*ldi temp6, -1+'0' * ; Ziffernzähler zählt direkt im
ASCII Code
lpm z0,Z+ ; Nächste Zahl laden
lpm z1,Z+
lpm z2,Z+
lpm z3,Z+
Int_to_ASCII_ziffer:
inc temp6 ; Ziffer erhöhen
sub temp1, z0 ; Zahl subrahieren
sbc temp2, z1 ; 32 Bit
sbc temp3, z2
sbc temp4, z3
brge Int_to_ASCII_ziffer ; noch kein Unterlauf, nochmal
add temp1, z0 ; Unterlauf, eimal wieder addieren
adc temp2, z1 ; 32 Bit
adc temp3, z2
adc temp4, z3
st X+,temp6 ; Ziffer speichern
dec temp5
brne Int_to_ASCII_schleife ; noch eine Ziffer?
[avrasm]Int_to_ASCII:
Code:Auszug aus AVR Tutorial ADC
[[http://www.mikrocontroller.net/articles/AVR-Tutorial:_ADC]]