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?
Message
Re: [AVR-Chat] Challenge
2005-06-16 by Dave VanHorn