avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Array of pointers to functions revisited...


From: Royce & Sharal Pereira
Subject: Re: [avr-gcc-list] Array of pointers to functions revisited...
Date: Mon, 19 Jul 2004 15:24:17 +0530

Hi Martin,
----- Original Message -----
From: "Martin Krüger " <address@hidden>

------- Ursprüngliche Nachricht -------

As far as i can see it contains the correct adresses. Remember the avr 
programm-memory is orgenized
in 16 bit words. So the adress is always half of what you would expect if the 
memory was organized
in 8 bits.

---Yes you are right . Sholuld've thought of that!

In the .lst file I see a   '.word pm(fun1)' instead of a '.word fun1' etc.(BTW 
What's this pm ?)

---I guess pm(xxxx)  stands for "adress of xxxx" ?

Yes here is still a bug. You must use a dereferencing operator:

fun= pgm_read_word(&call_fun[f_cnt]);

---This worked nicely! Thank You!

> There is a un-necessary 'ld' before 'lpm' which destroys the Z reg, so that 
> the fetched address is
wrong

lpm needs the pointer to the programm menory in the Z reg.
So this ld isnt unneccessary at all.

---Since the array is in Flash & the elements are also constants in flash, a 
'LD' should never be
seen. Anyways, with the fix you suggested, the 'LD' disappeared too(as it 
should) :)

Thank you all!
--Royce.




_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list

Sichern Sie sich Ihre Premium E-Mail-Adresse bei Lycos: eigene Domain, 1000 MB 
Mailspeicher, 100
free SMS, POP3, Weiterleitung und Hightech Spamschutz: http://mail.lycos.de





reply via email to

[Prev in Thread] Current Thread [Next in Thread]