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

Compiler is not specifying subroutines as relocatable

The compiler is generating the following sub-routine call:

019C DA000000 CALLS SEG (WriteString),WriteString

I am translating this to be an Inter-Segment Subroutine Call, where the compiler is passing the dummy address DA000000 to the linker. In other places, it calls the same routine as follows:

070E DA000000 R CALLS SEG (WriteString),WriteString

Notice, that here it is inserting the relocatable R I believe I need. Any ideas what I may be doing wrong? Thanks in advance. Jt

Parents
  • Thank you Jon.

    Yes, I did prototype. When I said

    Both subroutine calls are in the same module and I have declared the function at the beginning of the module

    in my previous message, I should have said

    Both subroutine calls are in the same module and I have prototyped all the functions at the beginning of the module

Reply
  • Thank you Jon.

    Yes, I did prototype. When I said

    Both subroutine calls are in the same module and I have declared the function at the beginning of the module

    in my previous message, I should have said

    Both subroutine calls are in the same module and I have prototyped all the functions at the beginning of the module

Children
  • As Andrew asked, is this actually causing you a problem? Is it possible that it's just an error in the listing but the generated code is correct?
    - Mike

  • I do know the subroutine works when the relocatable reference is there, and it does not work when it is not there. Doesn't the reference tell the linker that the address needs to be updated when it is linked? How could it work if the reference isn't there?

    It just seems odd to me that I can get the relocation reference simply by putting the routines in a different order. Shouldn't the routines be mapped by the function prototypes at the top of the program? Thereby it shouldn't matter what order the functions are written, should it?

  • If it is what it seems it is, then you should send the description of the problem and the project verifying it to Keil Support.
    Before you do that check once again that the generated code contains the error, that is, check the disassembly listing after linking (in the simulator's disassembly window.)
    Regards,
    - Mike