Re: mixing C and assembly
- From: Walter Banks <walter@xxxxxxxxxxxxx>
- Date: Wed, 23 Apr 2008 10:37:15 -0400
Mark Borgerson wrote:
In article <480F2B12.69B62031@xxxxxxxxxxxxx>, walter@xxxxxxxxxxxxx
says...
Chris H wrote:
As has already been mentioned the start up code has to be in assembler
as it sets up the memory for the stack etc however if you use the
standard one that comes with the compiler you will never need to see it.
There is no requirement for the start up code to be in asm. A lot of
compilers come with asm sample startup but the code could have
been written in C in the same compiler. The same extensions that
support embedded systems make this possible
Just out of curiosity, how do you set the initial value of the
stack pointer in C?
Most embedded systems compilers have extensions that
support processor register access. A lot of the compilers
were implemented from hosted compilers as a base and the
initial startup code was written before they added support
for processor access. The example startup has often been
this early code. My point is that it can be done in C.
In our case the first C compiler was written for the C6805
and that was based on a 6805 mistral compiler we had written
a few years earlier. Our initial startup code was written
in C on a compiler that would support it.
register_sp SP;
SP = int_value;
w..
.
- Follow-Ups:
- Re: mixing C and assembly
- From: Mark Borgerson
- Re: mixing C and assembly
- From: CBFalconer
- Re: mixing C and assembly
- From: Stefan Reuther
- Re: mixing C and assembly
- References:
- mixing C and assembly
- From: Lax
- Re: mixing C and assembly
- From: Hans-Bernhard Bröker
- Re: mixing C and assembly
- From: Chris H
- Re: mixing C and assembly
- From: Walter Banks
- Re: mixing C and assembly
- From: Mark Borgerson
- mixing C and assembly
- Prev by Date: Re: mixing C and assembly
- Next by Date: Re: mixing C and assembly
- Previous by thread: Re: mixing C and assembly
- Next by thread: Re: mixing C and assembly
- Index(es):
Relevant Pages
|