>
> Hi David, thanks for the explanation.
> My problem is how to find the LPM passed the end of table
> by looking at the ZH:ZL register.
Ah. Ok.
Normally, I use null terminated strings, and tables of definite length, so I
haven't had to do that in a while.
I tried the code below, but it is not working:
>
> read:
> lpm register, Z+
>
> ldi temp, high(ENDTABLE*2)
> cp ZL, low(ENTABLE*2)
> cpc ZH, temp
> brlo read
damn gmail, can't use tabs..
ldi YL,low(EndTable*2)
ldi YH,high(EndTable*2)
sub YL,ZL
sub YH,ZH ;If addresses are equal, then result is 0000h
or YL,YH ;single byte, we don't care what it is, as long as it's <>0
and YL,YL ;May not be needed, if Or sets the Z flag, I don't remember
offhand
breq wherever
[Non-text portions of this message have been removed]Message
Re: [AVR-Chat] Reading tables from flash
2006-09-29 by David VanHorn
Attachments
- No local attachments were found for this message.