This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C Preprocessing Directive in assembler


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]