[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] [bugs #12033] macros.inc need to be protected from mu
Re: [avr-libc-dev] [bugs #12033] macros.inc need to be protected from multiple inclusion.
Sat, 19 Feb 2005 23:59:51 +0100
As E. Weddington wrote:
> What with _U(), LOAD_Z(), LOAD_X(), etc.
I think most of them are historical only. Maybe Marek can enlighten
us a bit here.
My guess for _U() is that it could have been used in order to cope
with implementations that require a prepended underscore to external C
names. As at least all modern Unix assemblers I know of (and thus
GAS, too) do not require that anymore, there's no point to make that
Historical note for why to prepend an underscore: the PDP-11 assembler
required that the names of hardware registers (r0 through r7, sp, pc)
be reserved words that could not be used for labels. As high-level
language to not reserve these words, the way out was to prepend an
underscore to any user-specified external name, so no conflict with
the register names could ever arise.
Modern assemblers can either decide by opcode and operand position
whether the name means a register or an external symbol (that's how it
works for the AVR, where GAS even allows that you denote registers by
number only), or they use a special prefix for registers (that's how
GAS works e.g. on i386, register names start with % there). Thus the
underscore hack is not needed anymore.
I have no idea of the purpose the LOAD_foo macros once served.
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)