Ah. A real world example of the mysterious lpm instruction. Now I see how that is used. Thanks, David. David VanHorn wrote: > > On 1/3/07, Thomas Keller <tjkeller1@alltel.net > <mailto:tjkeller1%40alltel.net>> wrote: > > > Well, I was under the impression that data HAD to be in EEPROM or RAM. > > How woudl you address it if it is in the code space? > > Table: .db $00, $01..... > > Read_Table: ; called with offset in TEMP, output in TEMP > clr R0 ; Trashes R0 > ldi ZL,low(table*2) ;Point at the table > ldi ZH,high(Table*2) > add ZL,TEMP ;Add the offset > adc ZH,R0 ;16 bit add > lpm ;On smaller AVRs the result is in R0, in larger ones it's > mov TEMP,R0 ;lpm TEMP > >
Message
Re: [AVR-Chat] *sigh*
2007-01-04 by Thomas Keller
Attachments
- No local attachments were found for this message.