Yahoo Groups archive

AVR-Chat

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

Message

Re: [AVR-Chat] Reading from flash in Assembly

2004-12-03 by Dave VanHorn

At 11:10 AM 12/3/2004, Jim Wagner wrote:


>Paul -
>
>The reason is that the low bit is used as a byte indicator.
>Bit = 0 gets low byte in 16 bit word and 1 gets high byte
>in the word.

It all becomes clear, when you remember that program space is 16 bit words.
ZH       ZL
XXXXXXXX XXXXXXXY ; y = word select
XXXXXXXX XXXXXXX0 ; X = address

So load Z with (AddressOfData*2) and then
ld      TEMP,Z+ till you hit the end (null terminated or length count)

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.