[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-chat] SFRs in assembly code
From: |
Heike C. Zimmerer |
Subject: |
Re: [avr-chat] SFRs in assembly code |
Date: |
Thu, 23 Jul 2009 10:12:42 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) |
"Daniel Otte" <address@hidden> writes:
> It seems that the preprocessor of gas doesn't handle the UL suffix correct.
>
> #define UBRR_VALUE ((((F_CPU) + (8 * (BAUD)))/ (16 * (BAUD))) -1)
>
> works, while
>
> #define UBRR_VALUE ((((F_CPU) + (8UL * (BAUD))) /(16UL * (BAUD))) -1UL)
>
> yields a lot of " Error: missing ')'" messages.
>
> can anyone verify that?
Yes. indeed, the error message is triggered by the 'UL'. The simple
assembler line
.equ test, (34UL)
gives (among others)
./added/fastload.h: Assembler messages:
./added/fastload.h:203: Error: missing ')'
> Should I file a bug report for gas?
No. While you can use the C preprocessor with gas, you cannot use C
constructs with gas. 34UL is not a valid gas constant, since gas
doesn't know anything about things like 'unsigned long' (and it would
have no meaning whatsoever in it).
This #define is meant for use with C and only expands to something
meaningful when used in C. The error messages you've got are somewhat
misleading, however. My above test line gave after the part cited
above:
./added/fastload.h:203: Error: junk at end of line, first unrecognized
character is `U'
which points to the problem.
Heike
- [avr-chat] SFRs in assembly code, Daniel Otte, 2009/07/22
- Re: [avr-chat] SFRs in assembly code, Heike C. Zimmerer, 2009/07/22
- Re: [avr-chat] SFRs in assembly code, Daniel Otte, 2009/07/22
- Re: [avr-chat] SFRs in assembly code, Heike C. Zimmerer, 2009/07/22
- Re: [avr-chat] SFRs in assembly code, Daniel Otte, 2009/07/22
- RE: [avr-chat] SFRs in assembly code, Weddington, Eric, 2009/07/22
- RE: [avr-chat] SFRs in assembly code, Weddington, Eric, 2009/07/22
- Re: [avr-chat] SFRs in assembly code, Daniel Otte, 2009/07/22
- Re: [avr-chat] SFRs in assembly code,
Heike C. Zimmerer <=