This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Place assembly within C Code

Hi
I searched all over the keil software but never found how to access the assembly code of my project. The help itself tells that you can use #pragma SRC to instruct compiler to create an SRC file that contains all assembly codes of your project. This looks so intresting, But obviously, It seems that Keil won't let us know about translating C code to assembly!
Anyhow, I searched all over the help, But did not find any way to place assembly code into my C function. I used to place a #asm instruction anywere in my functions in Codevision, but it doesn't work in keil.
So any idea to mix assembly with C in keil Real View 3.0?

Parents
  • I think that the OP was looking for assembler listings, rather than
    using assembler with C code.

    > Basically, there are the inline and embedded assemblers. They are
    > substantially different. Be careful when using the embedded
    > assembler: it might not behave the way you would expect. Read the
    > manual for details.

    Actually, it is the inline assembler that might not behave as expected
    -- depends on what you expect, of course :-) Inline assembler is
    applied before instruction level optimization. The code you end
    up with might look very different from what you originally wrote.

    Inline assembler works only for ARM code (as opposed to Thumb). With
    newer cores providing only Thumb-2 (Cortex-M0/1/3/?), this would leave
    us with embedded assembler only. Inline assembler has been deprecated
    for ARM architectures v7 and later.

    infocenter.arm.com/.../armcc_bcfjdiaa.htm

    Regards
    Marcus
    http://www.doulos.com/arm/

Reply
  • I think that the OP was looking for assembler listings, rather than
    using assembler with C code.

    > Basically, there are the inline and embedded assemblers. They are
    > substantially different. Be careful when using the embedded
    > assembler: it might not behave the way you would expect. Read the
    > manual for details.

    Actually, it is the inline assembler that might not behave as expected
    -- depends on what you expect, of course :-) Inline assembler is
    applied before instruction level optimization. The code you end
    up with might look very different from what you originally wrote.

    Inline assembler works only for ARM code (as opposed to Thumb). With
    newer cores providing only Thumb-2 (Cortex-M0/1/3/?), this would leave
    us with embedded assembler only. Inline assembler has been deprecated
    for ARM architectures v7 and later.

    infocenter.arm.com/.../armcc_bcfjdiaa.htm

    Regards
    Marcus
    http://www.doulos.com/arm/

Children
No data