Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Challenge

2005-06-16 by Dave VanHorn

At 08:37 AM 6/8/2005, Dave VanHorn wrote:

>Then we have an even shorter variant possible:
>
>
>
> >REVERSE:
> >     LDI        R31,TABLE_LOC
> >     MOV    R30,TEMP
> >     LPM TEMP

Guess what...

Isn't it obvious that this DOES NOT WORK?

Z needs to be loaded with the address *2, so we actually end up with:

mov     ZL,TEMP
ldi     ZH,high(table)
lsl     ZL
rol     ZH
lpm     TEMP

And this does not take into account that the table might be located 
high enough to require the ELPM instruction!

So can the real answer be simplified?

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.