C pre-processor to produce machine-specific assembler code 
Author Message
 C pre-processor to produce machine-specific assembler code

Can anybody point me to a C pre-processor that produce machine specific
asembler code?

Thanks,

--

 Costantino Balletta

---------------------------------------------------------------------
e-mail:
When replying by e-mail, please remove the 'void'



Fri, 02 Feb 2001 03:00:00 GMT  
 C pre-processor to produce machine-specific assembler code


Quote:
>Can anybody point me to a C pre-processor that produce machine specific
>asembler code?

What you are looking for is a compiler, not a preprocessor. Many compilers
have a command line option to generate assembly output, check your
documentaion. A common one is -S.

--
-----------------------------------------


-----------------------------------------



Fri, 02 Feb 2001 03:00:00 GMT  
 C pre-processor to produce machine-specific assembler code

Quote:

> Can anybody point me to a C pre-processor that produce machine specific
> asembler code?

> Thanks,

Errr - cc?  cpp?
A C pre-processor, in my hopelessly muddled lexicon, simply resolves macros
and includes and other '#' directives and writes 'flat' C code from your
source.

cc, in implementations I have seen will often produce, with proper command
line switches, files which contain the assembler code that expresses what
the C code did, as one of the intermediate steps of compilation to machine
code...



Fri, 02 Feb 2001 03:00:00 GMT  
 C pre-processor to produce machine-specific assembler code

Quote:



> >Can anybody point me to a C pre-processor that produce machine
> specific
> >asembler code?

> What you are looking for is a compiler, not a preprocessor. Many
> compilers
> have a command line option to generate assembly output, check your
> documentaion. A common one is -S.

> --
> -----------------------------------------


> -----------------------------------------

Actually what I am looking for is a 'TRANSLATOR' from C to the assembler
of the target machine.  This address the case when the target machine
doesn't have the C- compiler yet.

A while ago I read about 'generic C compiler' that would let you define
your own machine language and will tanslate the C program in the target
machine assembler language.

One that I found on the net is ARCHELON's product, but ...gee! it costs
real money (~$3000). I want something for much cheaper than that.

--

 Costantino Balletta

---------------------------------------------------------------------

e-mail:
When replying by e-mail, please remove the 'void'



Fri, 02 Feb 2001 03:00:00 GMT  
 C pre-processor to produce machine-specific assembler code

Quote:
>Actually what I am looking for is a 'TRANSLATOR' from C to the assembler
>of the target machine.  This address the case when the target machine
>doesn't have the C- compiler yet.

The line between "translator" and "compiler" is fine.  But if you have
something which can translate to assembly language then to all intents and
purposes you've got a compiler.

Quote:
>A while ago I read about 'generic C compiler' that would let you define
>your own machine language and will tanslate the C program in the target
>machine assembler language.

As a minor digression, I can tell you for free that it won't work for all
targets -- they must make _some_ assumptions about the architecture and the
instructions available.

Many C compilers (and compilers in general) work by first using a "front
end" to translate into some kind of intermediate representation, and then a
"back end" to translate this to assembly language.  Thus one can use
different back ends to compile for different targets, without having to redo
the front end also.

From a brief scan of their web page I think Archelon's product essentially
lets you design your own back end, but it'll still rely on there being a
reasonable mapping between the intermediate code and the assembly code.

Cheers,
Richard
--
Richard Stamp, Cambridge, UK



Fri, 02 Feb 2001 03:00:00 GMT  
 C pre-processor to produce machine-specific assembler code


...

Quote:
>Actually what I am looking for is a 'TRANSLATOR' from C to the assembler
>of the target machine.

That is what a compiler is, if you have a program that can do that then it
is a compiler.

Quote:
> This address the case when the target machine
>doesn't have the C- compiler yet.

Maybe then the term you are looking for is cross-compiler which is a compiler
that runs on one system and generate code to be run on a different one.

Quote:
>A while ago I read about 'generic C compiler' that would let you define
>your own machine language and will tanslate the C program in the target
>machine assembler language.

gcc can be built as a cross-compiler. If it already supports the target
archetecture you are interested in then it may not be too bad. If not then
you would have to build a new back end for it which is a non-trivial task.

Quote:
>One that I found on the net is ARCHELON's product, but ...gee! it costs
>real money (~$3000). I want something for much cheaper than that.

Maybe that one is designed specifically to make building back ends easy.

--
-----------------------------------------


-----------------------------------------



Fri, 02 Feb 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Code which produced different behaviour on different machines

2. How do I grant permissions to code originating from a specific IntrAnet machine

3. Assembler needed for the Pentium processor

4. Assembler needed for the Pentium processor

5. Assembler needed for the Pentium processor

6. inline assembler and Pentium specific instruction(s)

7. Need A Decompiler for a Specific Processor

8. C++ pre-processor tool

9. C Pre-processor problem

10. Backslash-Newline with gcc pre-processor

11. K & R exercises- pre-processor problem

12. Pre-Processor Tricks with Retained State

 

 
Powered by phpBB® Forum Software