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

Error compiling asm code

Hi again, IÂ'm trying to compile the following code (with the SRC directive actived):

void alfa (void)
{
        #pragma ASM
                JMP   $  ; endless loop
        #pragma ENDASM
}

but an error has occurred in other part of my source code. Exactly, where the line A DATA 0E0H appears. Any idea?

; .\list.SRC generated from: list.c
; COMPILER INVOKED BY:
;        C:\Keil\C51\BIN\C51.EXE list.c LARGE OPTIMIZE(5,SIZE) BROWSE ORDER INCDIR(..\FreeRTOSV5.2.0\Source\include) DEBUG OBJECTEXTEND CODE LISTINCLUDE SYMBOLS PREPRINT SRC(.\list.SRC)

$NOMOD51

NAME    LIST

A       DATA    0E0H
ADC_CHCTR0      DATA    0CAH
ADC_CHCTR1      DATA    0CBH
...

Thanks in advance.

Parents
  • I found the solution to solve my problem.
    I have just created a file only with asm and C code and activated the SRC directive.
    With this configuration the project compiles, but if I mix the asm code with other C code, I get the error that I report before.

    So, finally, I have a file called "port_asm.c" with the following code:

    void alfa (void) {
    #pragma asm
      JMP   $  ; endless loop
    #pragma endasm
    }
    

    Thanks a lot for your support.

Reply
  • I found the solution to solve my problem.
    I have just created a file only with asm and C code and activated the SRC directive.
    With this configuration the project compiles, but if I mix the asm code with other C code, I get the error that I report before.

    So, finally, I have a file called "port_asm.c" with the following code:

    void alfa (void) {
    #pragma asm
      JMP   $  ; endless loop
    #pragma endasm
    }
    

    Thanks a lot for your support.

Children