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
  • Hans-Bernhard,

    you are, of course right. However, I suggest to all: if you get exposed to such code THROW IT AWAY.

    I have seen respossible programmers trying to add to/modify code like you refer to and always spending a lot of time attempting to "work with the code" before taking the unavoidable decision to throw it away. BTW for such code having the source often is not enough, you need the linker script or "surprises" is going to hit you again and again.

    Oh I have heard the "defenses" for writing as you state "avoid code thievery" and so on, but once I had to "rescue" a company where the "safe" programmer was no more available. This process cost the company more than the cost of someone getting hold of the object code.

    The problem i'm facing is, as i'm looking through the code written by my senior I REALLY wonder why this question is here in the forum, why does Tan not ask his "senior"


    Erik

Reply
  • Hans-Bernhard,

    you are, of course right. However, I suggest to all: if you get exposed to such code THROW IT AWAY.

    I have seen respossible programmers trying to add to/modify code like you refer to and always spending a lot of time attempting to "work with the code" before taking the unavoidable decision to throw it away. BTW for such code having the source often is not enough, you need the linker script or "surprises" is going to hit you again and again.

    Oh I have heard the "defenses" for writing as you state "avoid code thievery" and so on, but once I had to "rescue" a company where the "safe" programmer was no more available. This process cost the company more than the cost of someone getting hold of the object code.

    The problem i'm facing is, as i'm looking through the code written by my senior I REALLY wonder why this question is here in the forum, why does Tan not ask his "senior"


    Erik

Children