Wasted flash space to load high byte of memory addresses

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

anyone know if GCC has a flag to cause the compiler to avoid lots of load 0 into address high bytes on the small memory AVRs? Lots of flash memory words are wasted on loading high bytes whereas the memory can be addressed in one byte. The high byte register could be cleared and left 0, or at least, the compiler could generate one-word instructions to clear it, knowing the chip type is, say, a 2313.

I hope I haven't stuck my foot in my mouth again on this.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've never been that deep intom gcc, but is the a flag to choose memory models. If so, I guess that could solve the problem.

admin's test signature