Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

Re: [lpc2000] Re: Q: Global variables with C and ASM / pass argument from ASM to C function ?

Re: [lpc2000] Re: Q: Global variables with C and ASM / pass argument from ASM to C function ?

2005-04-15 by Gennady Palitsky

----- Original Message ----- 
Show quoted textHide quoted text
From: "Robert Adsett" <subscriptions@...>
To: <lpc2000@yahoogroups.com>
Sent: Friday, April 15, 2005 11:24 AM
Subject: Re: [lpc2000] Re: Q: Global variables with C and ASM / pass 
argument from ASM to C function ?


>
> At 01:25 PM 4/15/05 +0000, ateichtmann wrote:
>> > You could take the simple way out.  Write a quick function in C as a
>> > template and compile it to asm to use as a template.
>>
>>I have no idea, how to create an asm template.
>>These are the interesting and simple things that are never mentioned
>>in a compiler documentation or book :-)
>
> Most compilers have a simple switch to generate assembly as the output
> rather than an object file (something like cc -S).  That's all you
> need.  Then you can take the generated assembly file and use it as a
> template or as a tool to gather insight into the compilers operation.
>

Does anyone know how to do it in Keil?
They have #pragma SRC in a manual, but it's not recognized by the compiler.
No other options work either.
All my attempts to get the answer from tech support ended up with the 
suggestion to use a compiler's listing file (what I beleive is not the same 
at all).

Gennady

Re: Q: Global variables with C and ASM / pass argument from ASM to C function ?

2005-04-15 by Richard

> All my attempts to get the answer from tech support ended up with
>the suggestion to use a compiler's listing file (what I beleive is
>not the same at all).

Unfortunatly this sounds vary familiar to me....    :-|

Richard



--- In lpc2000@yahoogroups.com, "Gennady Palitsky" <gennadyp@j...> wrote:
> ----- Original Message ----- 
> From: "Robert Adsett" <subscriptions@a...>
> To: <lpc2000@yahoogroups.com>
> Sent: Friday, April 15, 2005 11:24 AM
> Subject: Re: [lpc2000] Re: Q: Global variables with C and ASM / pass 
> argument from ASM to C function ?
> 
> 
> >
> > At 01:25 PM 4/15/05 +0000, ateichtmann wrote:
> >> > You could take the simple way out.  Write a quick function in C
as a
> >> > template and compile it to asm to use as a template.
> >>
> >>I have no idea, how to create an asm template.
> >>These are the interesting and simple things that are never mentioned
> >>in a compiler documentation or book :-)
> >
> > Most compilers have a simple switch to generate assembly as the output
> > rather than an object file (something like cc -S).  That's all you
> > need.  Then you can take the generated assembly file and use it as a
> > template or as a tool to gather insight into the compilers operation.
> >
> 
> Does anyone know how to do it in Keil?
> They have #pragma SRC in a manual, but it's not recognized by the
compiler.
> No other options work either.
> All my attempts to get the answer from tech support ended up with the 
> suggestion to use a compiler's listing file (what I beleive is not
the same 
Show quoted textHide quoted text
> at all).
> 
> Gennady

Re: [lpc2000] Re: Q: Global variables with C and ASM / pass argument from ASM to C function ?

2005-04-15 by Robert Adsett

At 12:13 PM 4/15/05 -0400, Gennady Palitsky wrote:
>From: "Robert Adsett"
> > At 01:25 PM 4/15/05 +0000, ateichtmann wrote:
> >>I have no idea, how to create an asm template.
> >>These are the interesting and simple things that are never mentioned
> >>in a compiler documentation or book :-)
> >
> > Most compilers have a simple switch to generate assembly as the output
> > rather than an object file (something like cc -S).  That's all you
> > need.  Then you can take the generated assembly file and use it as a
> > template or as a tool to gather insight into the compilers operation.
>
>Does anyone know how to do it in Keil?
>They have #pragma SRC in a manual, but it's not recognized by the compiler.
>No other options work either.
>All my attempts to get the answer from tech support ended up with the
>suggestion to use a compiler's listing file (what I beleive is not the same
>at all).

It's not usually the same thing, although I seem to vaguely recall a 
compiler that only had a single output that essentially combined both.  And 
I have run into a few compilers that didn't have a way of producing an 
assembly file, although thankfully, that appears to be rare.  The key 
question is can you run the file through the assembler?  If so it's what 
you want.  In a pinch you can work from a listing but it's a lot uglier.  I 
do find it hard to believe that Keil can't produce an assembly file.

Robert


" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Re: [lpc2000] Re: Q: Global variables with C and ASM / pass argument from ASM to C function ?

2005-04-15 by Richard Duits

Keil has the option the generate a batch file for building your project. 
Make a copy of the file and add the right option to the compilers 
command line. Which option? I don't know, but this should be in the help 
file.

Richard.


Gennady Palitsky wrote:
Show quoted textHide quoted text
> ----- Original Message -----
> From: "Robert Adsett" <subscriptions@...>
> To: <lpc2000@yahoogroups.com>
> Sent: Friday, April 15, 2005 11:24 AM
> Subject: Re: [lpc2000] Re: Q: Global variables with C and ASM / pass
> argument from ASM to C function ?
>
>
> >
> > At 01:25 PM 4/15/05 +0000, ateichtmann wrote:
> >> > You could take the simple way out.  Write a quick function in C as a
> >> > template and compile it to asm to use as a template.
> >>
> >>I have no idea, how to create an asm template.
> >>These are the interesting and simple things that are never mentioned
> >>in a compiler documentation or book :-)
> >
> > Most compilers have a simple switch to generate assembly as the output
> > rather than an object file (something like cc -S).  That's all you
> > need.  Then you can take the generated assembly file and use it as a
> > template or as a tool to gather insight into the compilers operation.
> >
>
> Does anyone know how to do it in Keil?
> They have #pragma SRC in a manual, but it's not recognized by the 
> compiler.
> No other options work either.
> All my attempts to get the answer from tech support ended up with the
> suggestion to use a compiler's listing file (what I beleive is not the 
> same
> at all).
>
> Gennady
>
>
> ------------------------------------------------------------------------
> *Yahoo! Groups Links*
>
>     * To visit your group on the web, go to:
>       http://groups.yahoo.com/group/lpc2000/
>        
>     * To unsubscribe from this group, send an email to:
>       lpc2000-unsubscribe@yahoogroups.com
>       <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.