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
  • You don't really have a choice.

    If the functions are so time-critical that the time for call/return matters, then I wonder if you haven't drawn the divisor line at the wrong place.

    If the function is seldom called, then call/return times shouldn't matter.

    If function is called from a tight loop, then you should consider including the loop with the code.

    An issue here - what function is so small that the call/return times represents a significant amount of time, and still complex enough that you want to protect the source code?

    Using db statements will not be a good idea since the bytes must either use 100% relative references, or perform absolute references to already fixed locations.

Reply
  • You don't really have a choice.

    If the functions are so time-critical that the time for call/return matters, then I wonder if you haven't drawn the divisor line at the wrong place.

    If the function is seldom called, then call/return times shouldn't matter.

    If function is called from a tight loop, then you should consider including the loop with the code.

    An issue here - what function is so small that the call/return times represents a significant amount of time, and still complex enough that you want to protect the source code?

    Using db statements will not be a good idea since the bytes must either use 100% relative references, or perform absolute references to already fixed locations.

Children
  • 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!

  • 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.