Re: mixing C and assembly
- From: cbarn24050@xxxxxxx
- Date: Wed, 23 Apr 2008 11:48:56 -0700 (PDT)
On Apr 23, 7:27�pm, Walter Banks <wal...@xxxxxxxxxxxxx> wrote:
Stefan Reuther wrote:
register_sp SP;
SP = int_value;
What you're doing here is writing assembly with C syntax. It relies upon
a heavily non-standard language extension, and makes assumptions about
how the compiler behaves (you don't want the compiler to use the stack
before your SP assignment, do you?). So instead of writing assembly in
C, I prefer using the real thing.
Yes, thats what he always does! He can then claim his compiler can
beat assembler for speed,code size ect. To Walter if it looks Cish,
ends in a semicolon and his compiler can change it into machine code
then its C.
I actually agree with you it is very low level C. The purpose of ISO/IEC
18037 was to define the low level syntax. Most start up code is very processor
family specific. �Writting start up code in C makes good use of C's
optimization like the branch/jump to main.
Whats to optimise? Why bother optimising a one time instruction?
Sometimes I think you'll say anything to sell a compiler.
w..
.
- Follow-Ups:
- Re: mixing C and assembly
- From: David Brown
- Re: mixing C and assembly
- From: Walter Banks
- 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
- Re: mixing C and assembly
- From: Walter Banks
- Re: mixing C and assembly
- From: Stefan Reuther
- Re: mixing C and assembly
- From: Walter Banks
- mixing C and assembly
- Prev by Date: Re: mixing C and assembly
- Next by Date: Re: Monochrome LCDs
- Previous by thread: Re: mixing C and assembly
- Next by thread: Re: mixing C and assembly
- Index(es):
Relevant Pages
|