Avaya Logo

Previous Topic

Next Topic

Book Contents

Book Index

label

The label instruction is a subroutine call.

Synopsis

label([type.src] [,type.src])

Description

The label() subroutine call is used to call a subroutine found at the address indicated by the label. A return address and the values in all registers except r.0 are saved on a subroutine stack in the calling subroutine. The optional first and second arguments are stored in r.3 and r.2, respectively.

Example

In the following example, the integer variables FIRST and SECOND are set equal to 1 and 2, respectively. The subroutine ADDEM is called with two arguments.

Within ADDEM, the variable SUM is set to zero. Then the value of SUM is incremented by r.3 (which has been assigned the value of FIRST from the calling routine) and incremented by r.2 (which has been assigned the value of SECOND from the calling routine.

The subroutine return (rts) returns control to the tnum instruction following the ADDEM subroutine call.

load(int.FIRST,1)
load(int.SECOND,2)
ADDEM(int.FIRST,SECOND)
tnum(int.SUM)

ADDEM( )
load(int.SUM,0)
incr(int.SUM,r.3)
incr(int.SUM,r.2)
rts ( )

See also

© 2006 Avaya Inc. All Rights Reserved.