Re: mixing C and assembly





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.

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.

w..


.



Relevant Pages

  • Re: Need to Improve my skill set in C
    ... Anand wrote: ... > Now I am familiar with all the syntax and concepts. ... > idea is to know how entire c compiler behaves in all ... US$18) and download the ISO C language specification. ...
    (comp.lang.c)
  • Re: Creating a VM in Lisp
    ... I anticipate the language actually being quite low level, ... of the awful C syntax (difference between statement and expression, ... etc.) it would behave more like Lisp. ...
    (comp.lang.lisp)
  • Re: Creating a VM in Lisp
    ... I anticipate the language actually being quite low level, ... of the awful C syntax (difference between statement and expression, ...
    (comp.lang.lisp)