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

Invoking a function

An assembly question here.

Whenever we want to invoke a function, say "TESTING", we would have to use the commands like CALL, JMP ...ETC..


TESTING:
MOV R0,#33
;
;
;

Is it possible that a function is invoked without using any of the instruction sets like CALL, JMP...etc

The problem i'm facing is, as i'm looking through the code written by my senior, i found some functions that isnt invoked by any instruction sets.

I've confirmed this because i've search thru the code using search function and the result that contain the function's name is only in the function itself.

Parents
  • Is it possible that a function is invoked without using any of the instruction sets like CALL, JMP...etc

    Possible, sure, but almost never a good idea. Unless you're looking at code that has been obfuscated on purpose, there's only one possibly important exception to this rule: returning from a pre-emptive scheduler to a task, for which a "directed return" as explained in the other response is a common technique.

    Frankly, the only good answer to this kind of question is the suggestion to ask that "senior" of yours who wrote the code.

Reply
  • Is it possible that a function is invoked without using any of the instruction sets like CALL, JMP...etc

    Possible, sure, but almost never a good idea. Unless you're looking at code that has been obfuscated on purpose, there's only one possibly important exception to this rule: returning from a pre-emptive scheduler to a task, for which a "directed return" as explained in the other response is a common technique.

    Frankly, the only good answer to this kind of question is the suggestion to ask that "senior" of yours who wrote the code.

Children
No data