A tail call
is a subroutine
call just before the end of a subroutine.
In assembly language, this construct can be optimized away. For example, in 6502 assembly, if a subroutine looks like:
the last two lines can be optimized to a jump instruction:
The subroutine othersub will then return to the return address of sub. If the call stack does not just contain the return address, but also parameters for the subroutine, it may need to be adjusted.
If a subroutine performs a tail call on itself, this is called tail recursion. This can be optimized to a form of iteration, an optimization performed by interpreters of functional programming languages.