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

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

Re: [avr-gcc-list] Migration from AVR GCC to WinAVR or new Linux avr-gcc


From: Goran Pufler
Subject: Re: [avr-gcc-list] Migration from AVR GCC to WinAVR or new Linux avr-gcc
Date: Wed, 17 Sep 2003 00:25:23 -0700 (PDT)

I use same code for access to the MMC, and also have several NOPs just to wait 
for devices to initialise at the begining - I will try to change this today, 
and see how it will work
 
Thx
 
Goran

"Theodore A. Roth" <address@hidden> wrote:


On Tue, 16 Sep 2003, Jamie Lawson wrote:

>
> Hi,
>
> I just came across a similar sounding problem. By comparing the listings
> from both compiler versions; I have found, at least in my case, that the
> newer compiler has optimized out some of the assembler routines I use
> for accurate timing (Dallas 1-wire stuff).
>
> For example: I have used several contiguous "rjmp +2" instructions just to
> waste a few uS and they have been "optimized" to rjmp somewhere else.
> I fixed this by using local labels in the assembler routine.

I seem to recall hitting this problem a while back. It has to do with
how gas interprets 'rjmp +2'. Turns out that gas treats the '+2' as an
absolute address which is not quite what you expect.

What you should use instead is 'rjmp .+2' to make it a relative
address. Using local labels is essentially the same thing and probably
more technically correct since you avoid magic numbers thus making
your code more readable.

The changes made to gas which changed the behaviour of 'rjmp +2' where
made just before this patch for gcc:

http://gcc.gnu.org/ml/gcc-cvs/2002-11/msg00789.html

Ted Roth

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

---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

reply via email to

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