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

Calling function from library without lcall.

I have been programming in ASM some project, which, together with the source code will have to transfer to the customer. But this project contains some of the functions source code which I do not want give to customer. I went as follows: i create a library and needed for me function connect to my project with

EXTERN CODE(function name)

, and calling this function by

lcall function name

. But this solution is not best. When i call function from library many times each call using 5 CLK for lcall and 4 CLK fro ret, and this slows the program.
Maybe somebody knows call function from library without lcall and ret instruction. In C++(on PC),example, i using

inline

statement, maybe something similar is ASM(or Ax51).

Thanks for all!.

Parents
  • In fact, I'm probably too carefully described the whole problem, and it creates more questions than answers.
    The question is: Is it possible to call a function that has the label

    func_name:
    ;function source code
    func_end:
    

    ,
    without EXTRN (func_name) and Lcall statement, if this function was translated to object files.
    Most likely, this question relates directly to the linker, but i don't find like this problems, and any questions. Also i fully understand that this problem is not typical, and does not arise for most users. But this relay situation and maybe have some real reasons.

    Thanks to all who participate in the discussion!

Reply
  • In fact, I'm probably too carefully described the whole problem, and it creates more questions than answers.
    The question is: Is it possible to call a function that has the label

    func_name:
    ;function source code
    func_end:
    

    ,
    without EXTRN (func_name) and Lcall statement, if this function was translated to object files.
    Most likely, this question relates directly to the linker, but i don't find like this problems, and any questions. Also i fully understand that this problem is not typical, and does not arise for most users. But this relay situation and maybe have some real reasons.

    Thanks to all who participate in the discussion!

Children
  • If the question is "is the inlining functionality present in the linker" then the answer is "no."
    Normally, a linker is designed to resolve references, calculate and fill in addresses, and maybe perform some optimizations such as removal of unreferenced objects and replacement of far jumps with relative ones. Inlining is normally done by a compiler.