If we use the version of the LPM or ELPM instruction that post-increments the Z
register, we can use that as the local variable address increment, saving a
substantial amount of space:
Old code:
do putch(pgm_read_byte_near(address++));
while (--length);
New code:
do {
// read a Flash byte and increment the address
__asm__ ("lpm %0,Z+\n" : "=r" (ch), "=z" (address): "1" (address));
putch(ch);
} while (--length);
(as per "dkinzer": http://code.google.com/p/arduino/issues/detail?id=794 )
Original issue reported on code.google.com by wes...@gmail.com on 5 Jan 2013 at 4:41
Original issue reported on code.google.com by
wes...@gmail.com
on 5 Jan 2013 at 4:41