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

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

Re: Fw: [avr-gcc-list] Can this be optimised?


From: Theodore A. Roth
Subject: Re: Fw: [avr-gcc-list] Can this be optimised?
Date: Wed, 28 Jul 2004 07:51:37 -0700 (PDT)

On Wed, 28 Jul 2004, Royce & Sharal Pereira wrote:

> Hi, all,
>
> > ----- Original Message -----
> > From: "Royce & Sharal Pereira" <address@hidden>
> > > -------------------------------------------------------------------
> > > Oh! That simple! I had no Idea sfrs were defined as 16 bit
> > > also...In future I'll look at the ioxx.h files much closer..
> > >
> > ---------------------------------------------------------------------
>  Just curious...what is the difference between ADC & ADCW (eg. in
>  iom8.h) ? (I know it's something to do with that '__ASSEMBLER__'
>  thing...but it's still fuzzy).
>  Thanks, --Royce.

ADC happens to also be an assembler instruction so you can't use it in
asm source or the assembler will get confused. Other than that ADC and
ADCW are the same as far as C source code is concerned.

You should always look at the ioXXX.h files before using a pair of io
registers as a 16-bit variable like this since there are cases where the
two registers are not at consecutive memory addresses (e.g. on the
mega128, UBRR0L is at address 0x29 while UBRR0H is at 0x90, but UBRR1H
and UBRR1L are consecutive).

---
Ted Roth
PGP Key ID: 0x18F846E9
Jabber ID: address@hidden


reply via email to

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