Subroutine - History - Self-modifying Code

Self-modifying Code

The first use of subprograms was on early computers that were programmed in machine code or assembly language, and did not have a specific call instruction. On those computers, each subroutine call had to be implemented as a sequence of lower level machine instructions that relied on self-modifying code. By replacing the operand of a branch instruction at the end of the procedure's body, execution could then be returned to the proper location (designated by the return address) in the calling program (usually just after the instruction that jumped into the subroutine).

Read more about this topic:  Subroutine, History

Famous quotes containing the word code:

    Hollywood keeps before its child audiences a string of glorified young heroes, everyone of whom is an unhesitating and violent Anarchist. His one answer to everything that annoys him or disparages his country or his parents or his young lady or his personal code of manly conduct is to give the offender a “sock” in the jaw.... My observation leads me to believe that it is not the virtuous people who are good at socking jaws.
    George Bernard Shaw (1856–1950)