Contents    Page-10    Prev    Next    Page+10    Index   

Operations by Subroutine

Functions may be specified in source code either as operators or as function calls; the compiler may generate either form as instructions or as a subroutine call.

A function can be compiled inline if the code is short:


abs(x)   -->  (if (>= x 0) x (- x))
or the code generator can generate a special instruction sequence, e.g. to float an integer.

An operator can be compiled as a subroutine call if the operation does not exist as a machine instruction.


X**Y   -->   qq8rtor(x,y)

cout << "Hello\n"
On small machines without floating point hardware, all floating ops may be done by subroutine calls.