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

Can't compile ASM generated with SRC option

Hi,

I'm trying to compile a library of rom functions for the DS80C400. The Most of the files compile without a problem.

The ones I do have difficulties with all have inline assembler. Obviously these are all bracketed with the appropriate #pragma.

Now I understand I can generate a .src assembler file with the SRC option.

Thus far I have not been able to assemble one of these generated files. The reason for failure always being :
xxx.SRC(x): error A45: UNDEFINED SYMBOL

The .lst file is telling me what is undefined but beyond be able to add extern declarations which I've tried and don't work I don't know what to do next.

I feel I should have to edit automatically generated files to get them to work - I have done to see how to get things to work, but its a bad way of working and everytime I change the any C and have to regenerate the file I have to start again.

I have to admit this does sound like its going to be one check box somewhere to solve this but I haven't found it in any of the documention so far.

So 1) do I need to go down to generating assembler files?

2) If so how do I resolve the scoping issues?

Cheers

Bernard

Parents
  • "The ones I do have difficulties with all have inline assembler."

    Very simple answer: Don't use in-line Assembler!
    If you need to write assembly code, then do it directly in an assembler source file - don't bastardise your 'C'!

    "Now I understand I can generate a .src assembler file with the SRC option."

    When using inline assembler, you must convert to .SRC and then assemble the result.
    This means that you lose all your 'C' symbol & debug info - as far as the assembler & linker are concerned, it's just another assembler file.
    Another reason why I say Don't use in-line Assembler!

    "do I need to go down to generating assembler files?"

    Yes - if you insist on doing inline assembler.
    But I say, Don't use in-line Assembler!

Reply
  • "The ones I do have difficulties with all have inline assembler."

    Very simple answer: Don't use in-line Assembler!
    If you need to write assembly code, then do it directly in an assembler source file - don't bastardise your 'C'!

    "Now I understand I can generate a .src assembler file with the SRC option."

    When using inline assembler, you must convert to .SRC and then assemble the result.
    This means that you lose all your 'C' symbol & debug info - as far as the assembler & linker are concerned, it's just another assembler file.
    Another reason why I say Don't use in-line Assembler!

    "do I need to go down to generating assembler files?"

    Yes - if you insist on doing inline assembler.
    But I say, Don't use in-line Assembler!

Children