AnsweredAssumed Answered

Combination C and assembler (BF504)

Question asked by maxxisis on Apr 10, 2011
Latest reply on Apr 11, 2011 by Andreas

Hello,

  I would need help with assembler (I am BLACKFIN assembler beginner) . I have following error message, during translation attached file:

 

-----------------------------------------------------------------------------------------------------------------------------

[Error li1021]  The following symbols referenced in processor 'p0' could not be resolved:
        'Data_To_Send' referenced from '.\Debug\FT2232HL_ASYN_FIFO.doj'
        'PORTFIO' referenced from '.\Debug\FT2232HL_ASYN_FIFO.doj'
        'i' referenced from '.\Debug\FT2232HL_ASYN_FIFO.doj'

 

Linker finished with 1 error
cc3089: fatal error: Link failed
Tool failed with exit/exception code: 1.
Build was unsuccessful.

-----------------------------------------------------------------------------------------------------------------------------

 

1) Why registers names arent known in asm? I have to use its addresses directly

                                                                             asm("P0.h = 0xFFC0;");

                                                                             asm("P0.l = 0x1508;");

                                                                             instead of              

                                                                             asm("P0.h LO(PORTGIO_SET);");

                                                                             asm("P0.l =LO(PORTGIO_SET);");     ??

2) Where can I find used register for variable "i"?    to use "asm("R0 = [P1+i];");" correctly..

3) When I am using register R7-0,P7-0 etc. in asm("");, how can i be sure, that compilator hasnt already used these registers for some different variables from C code??

4) Or is this approach of combinig C with assembler bad?

Attachments

Outcomes