call - Call subroutine

call - Call subroutine

Calling Format

call label

Operands

Name Description
label Label name.

Overview

Control jumps to the address of the specified label name.
Once code has been executed up to the ret instruction following the label address, execution will return to the address immediately after this instruction. You cannot call a label unless a ret instruction has been set for it.

You can nest call instructions (call, callc, and callb) up to four times. Behavior is undefined if these are nested five or more times.
Behavior is also undefined when a nested call instruction is invoked immediately before a ret instruction.

Operation

retaddr = pc + 1
pc = get_label_address ( label )
while (1)
{
    execute_current_instruction ( )
    if ( current_instruction () == ret )
    {
        pc = retaddr
        break
    }
}

Code Example

call    subfunction0

subfunction0:
..
ret

Revision History

2011/12/20
Initial version.

CONFIDENTIAL