This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: C Preprocessing Directive in assembler
- From: Andrew Lunn <andrew at lunn dot ch>
- To: twomol <twomol at bj1860 dot net>
- Cc: "ecos-discuss at sources dot redhat dot com" <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 10 Nov 2004 09:21:27 +0100
- Subject: Re: [ECOS] C Preprocessing Directive in assembler
- References: <20041110033546.TZLE15477.fep1.bj1860.net@twomol>
On Wed, Nov 10, 2004 at 11:56:01AM +0800, twomol wrote:
> hello
> I'm a new guy to ecos,when I read the source of ecos ,I was puzzled.For example,
> the vector.s in the hal\arm\arch\v2_0\src directory:
>
> #ifdef CYGSEM_HAL_ROM_RESET_USES_JUMP
> // Assumption: ROM code has these vectors at the hardware reset address.
> // A simple jump removes any address-space dependencies [i.e. safer]
> b reset_vector // 0x00
> #else
> ldr pc,.reset_vector // 0x00
> #endif
> ldr pc,.undefined_instruction // 0x04
> ldr pc,.software_interrupt // 0x08 start && software int
>
>
> the "#ifdef CYGSEM_HAL_ROM_RESET_USES_JUMP" is a c/c++ language Preprocessing Directive,how dose it affect the assembler.
info gcc
Options Controlling the Kind of Output
======================================
Compilation can involve up to four stages: preprocessing, compilation
proper, assembly and linking, always in that order. The first three
stages apply to an individual source file, and end by producing an
object file; linking combines all the object files (those newly
compiled, and those specified as input) into an executable file.
For any given input file, the file name suffix determines what kind
of compilation is done:
`FILE.c'
C source code which must be preprocessed.
[snip]
`FILE.s'
Assembler code.
`FILE.S'
Assembler code which must be preprocessed.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss