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

Assembly in C

Hi all can anyone tell me how to include assembly code in between your C coding. For the sake of simplicity consider the below code and mentioned procedure thereafter which I learn from the A51macro assembler and utility file.

void main()
{
 #pragma asm
  JMP $
 #pragma endasm
  while(1);
}

After this step I am right clicking on my source file main.c and in the Option for... properties I am activating Generate Assembler SRC file and Assemble SRC file. After this step on final rebuilding the target files I am getting list of 2 warnings-
1) UNRESOLVED EXTERNAL SYMBOL symbol C_START
2) REFERENCE MADE TO UNRESOLVED EXTERNAL symbol C_START

Please tell how to eliminate this and get 0 error and 0 warning. Thanks

Parents
  • How you write to Flash memory depends entirely on your particular hardware.

    As you haven't given any details of your particular hardware, the question is impossible to answer!

    If you are talking about on-chip Flash, then the Datasheet for the particular chip will tell you whether it is possible and, if it is, what you need to do...

Reply
  • How you write to Flash memory depends entirely on your particular hardware.

    As you haven't given any details of your particular hardware, the question is impossible to answer!

    If you are talking about on-chip Flash, then the Datasheet for the particular chip will tell you whether it is possible and, if it is, what you need to do...

Children