puts: ;dptr=Str
clr a
movc a,@a+dptr
jz puts_e
call putchar
inc dptr
jmp puts
puts_e:
ret
puts: ;X=Str
movfw X
movwf pc,f ;Ansprung
iorlw 0 ;Null-Test
SKPNZ
return
call putchar
incf X,f
goto puts
puts: ;Z=Str
lpm
adiw zl,1
tst r0
breq puts_e
mov r16,r0
rcall putchar
rjmp puts
puts_e:
ret
puts: ;R8=Str
mov rl4,[r8+]
or rl4,rl4
jz puts_e
call putchar ;R4=Zeichen
jmp puts
puts_e:
ret
void puts(const char*str) {
while (*str) putchar(*str++);
}
ostr:
pop dph
pop dpl
call puts
jmp @a+dptr ;Zurück (a=0)
unmöglich
ostr:
pop zh
pop zl
add zl,zl
adc zh,zh ;BYTEadresse
rcall puts
adiw zl,1 ;aufrunden
lsr zh
ror zl ;WORTadresse
ijmp
nicht möglich
| | | | | | | | | |