avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] Is it needed to use '_U()'?


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] Is it needed to use '_U()'?
Date: Mon, 24 Oct 2005 21:21:13 +0200
User-agent: Mutt/1.4.2.1i

As Dmitry K. wrote:

> Is it any reason to use '_U()'?

I can only guess about the idea here.

For some architectures and/or object formats, global symbols used to
be prefixed by an underscore, mainly in order to avoid the ambiguity
between a global symbol and a register name, so you can safely use
e.g. "r1" as a function or variable name inside your C program, and
the assembler won't confuse that with a register "r1".

For avr-as, this is not needed as the register operands can be
distinguished from global symbols (i.e. memory operands) based on the
opcode.  (In GAS, you can even omit the "r" and write a simple "1" to
denote register "r1".)  Thus, there's no need for the underscore
prefix.

Yet, when creating avr-libc, someone (I assume either Denis or Marek)
decided to be on the safe side, and use a prefix macro so should the
policy ever change, only one place needs to be changed.

I don't think that policy will ever change ;-) (as even for other
architectures, it's usually not needed anymore since the register
distinction is done otherwise, like by prefixing registers with a
"%"), so from my point of view, that macro can be dropped.

Perhaps Marek can enlighten us here...

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)





reply via email to

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