From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26200 invoked by alias); 11 Sep 2003 18:58:40 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 26168 invoked from network); 11 Sep 2003 18:58:40 -0000 Received: from unknown (HELO toraptor.gnnettest.com) (199.166.16.39) by sources.redhat.com with SMTP; 11 Sep 2003 18:58:40 -0000 Received: from no.name.available by toraptor.gnnettest.com via smtpd (for sources.redhat.com [67.72.78.213]) with SMTP; 11 Sep 2003 18:58:40 UT X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message Subject: RE: gcc & assembly coding conventions ?? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Thu, 11 Sep 2003 18:58:00 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Richard Sewards" To: "garret.spears" , X-SW-Source: 2003-09/txt/msg00129.txt.bz2 Arguably, you should not be editing an assembler source file at all. It is possible to do everything using C and inline assembler, including CPU startup code (I have done it for an 8240 boot ROM monitor). Then you can use #define, const, etc. and write most of your code in C. I have always found C + inline assembler to be easier to deal with than pure assembler. Regards, -- Richard Sewards richard.sewards@navtelcom.com -----Original Message----- From: garret.spears [mailto:garret.spears@comcast.net]=20 Sent: Wednesday, September 10, 2003 4:07 PM To: gcc-help@gcc.gnu.org Subject: gcc & assembly coding conventions ?? Sorry to bother you with the following. I have looked thru the gcc & gas manuals and I am coming up without any answers. I haven't done this for many years, many years. I am trying to write assembly code for a coldfire processor. Essentially when I did this years ago I dedicated a section to defines or equates, a section to data space, and a section to code - assembly language. I may be confused on naming or identifying these sections now. I am creating a file called foo.S and placing my sections into it. So far I get errors saying the line "mbar equ 0x10000000" is not an instruction. Is there a place that I should be going that will lead me thru the correct structure and declarations that I need to use? Thanks for your patience & help, Garret Refernce: gcc-2.95.3 -m5200 -x assembler led.S Led.S consists of the following first 20-30 lines #DEFINE INIT_SECTION_ASM_OP // is this a requird line or should ther be another? // Base addr of internal resources & SIM resources MBAR EQU 0x10000000 // alt I have seen ".set MBAR=3D0x10000000" but the manual shows an EQU syntax // Exception base addr to vector table VBR EQU 0x00000000 // Starting location of internal RAM & types of access RAMBAR EQU 0x30000000 //DRAM base address & permissions, $00000000 DRAM0 EQU $0000 // System integration Module config register SIMR EQU MBAR+$0003 // same problem here because MBAR is undefined // Pin assignment register PAR EQU MBAR+$00CB Should I be using a dot h file for some of this and a dot s file for my actual assembly coding?