[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Global variables in pure assembler??
From: |
Larry Barello |
Subject: |
Re: [avr-gcc-list] Global variables in pure assembler?? |
Date: |
Fri, 27 Jun 2003 15:16:29 -0700 |
You want .comm, not .lcomm (which is a local) and you don't need to fool
around with sections either. They will go into the right section
automatically.
...
.comm myvar, 1 ; Reserve a byte for "myvar"
.comm yourvar, 4 ; Reserver four bytes for "yourvar"
.lcomm localvar, 1 ; a single "static" byte (e.g. local)
The type is set in the C header file. You can address it directly with an
LDS or use lo8() and hi8() to get the address into a register pair.
Cheers!
----- Original Message -----
From: "blight" <address@hidden>
To: <address@hidden>
Sent: Friday, June 27, 2003 12:06 PM
Subject: [avr-gcc-list] Global variables in pure assembler??
> Hi!
>
> I am writing a driver for some device in pure ASM bcause it needs to be
fast
> and accurate. It needs 2 static vars with global scope (in "C words")
> I was looking at the output of avr-gcc but i wasn't able to get it
working.
> One var should be unsigned char recv_data[4]; and the other unsigned char
> bytes_recvd = 0;
>
> I tried some different code like the following:
> ---------------------------------------------------------------------
> .section .bss
> recv_data:
>