[Top][All Lists]

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

Re: [avr-gcc-list] avr seminar Summary

From: Keith Gudger
Subject: Re: [avr-gcc-list] avr seminar Summary
Date: Mon, 9 Jun 2003 10:00:40 -0700 (PDT)

Global structs help because the compiler can load the base address into
the 'X' register, and then access any member with the 'X + offset' type of
instructions.  In any routine with multiple calls to global variables,
this can save a lot of space.

This is much better than using LDS (address) which takes another word of
PGM memory (or worse, when the compiler loads up the 'Z' registers with
the address and *then* does an LD instruction *each time any global 
variable gets called*).


On Mon, 9 Jun 2003, Wallace White wrote:

> Reza -
> Thanks for the notes. I have one question:
> > They 
> > stressed using local variables, and if you were to use global variables, 
> > to pack them in a struct (for a smaller code base).  
> What's the advantage of global structs over global discrete variables?
> Thanks,
> Wallace
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://www.avr1.org/mailman/listinfo/avr-gcc-list

reply via email to

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