[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Asm Operator for Address Negation
From: |
Ram Kumar Rengaswamy |
Subject: |
Re: [avr-gcc-list] Asm Operator for Address Negation |
Date: |
Thu, 10 Aug 2006 00:36:06 -0700 |
Hi Erik,
I have created a small program that shows the error.
//------------------ permsTable.c---------------------------
void permsCheck(unsigned char i);
unsigned char permsTable[2] = {0x00, 0x01};
int main()
{
unsigned char i;
for (i = 0; i < 2; i++)
permsCheck(i);
while(1);
return 0;
}
#---------- permsCheckAsm.S--------------------
.section .text
.global permsCheck
permsCheck:
movw r30, r24
subi r30, lo8(-permsTable)
sbci r31, hi8(-permsTable)
ret
The error message is as follows:
avr-gcc -c -Os -Wall -Wa,-mmcu=atmega128,-adhlmsn=permsTable.lst -
mmcu=atmega128 permsTable.c -o permsTable.o
avr-gcc -c -Wa,-mmcu=atmega128,-ahlms=permsCheckAsm.lst
permsCheckAsm.S -o permsCheckAsm.o
permsCheckAsm.S: Assembler messages:
permsCheckAsm.S:5: Error: can't resolve `0' {*ABS* section} -
`permsTable' {*UND* section}
permsCheckAsm.S:5: Error: expression too complex
permsCheckAsm.S:6: Error: can't resolve `0' {*ABS* section} -
`permsTable' {*UND* section}
permsCheckAsm.S:6: Error: expression too complex
make: *** [permsCheckAsm.o] Error 1
rm permsTable.o
Thanks,
-Ram
On Aug 9, 2006, at 7:40 PM, Erik Christiansen wrote:
On Wed, Aug 09, 2006 at 05:04:05PM -0700, Ram Kumar Rengaswamy wrote:
SUBI r30, lo8(-permsTable)
SBCI r31, hi8(-permsTable)
However, I am getting a syntax error with the above operation.
Ram,
This listing shows that the given syntax can assemble OK.
16 permsTable = 4242
17
18 0010 EE56 subi r30, lo8(-permsTable)
19 0012 FF4E sbci r31, hi8(-permsTable)
What is the full assembler source used? What is the exact error
message?
Erik