BCALL - call a B function from GMAP.

Usage:

bcall  routine[,numwords,stackbump]

Examples:

bcall  length,1
bcall  .write

Where:

routine
is the entry point name of a B function. A SYMREF will be generated for this name.
numwords
is the number of words of arguments the function is being called with. It defaults to zero.
stackbump
is the stack size for the calling function and should not normally be used. If the AUTO and ARGDEF macros have been used properly, the correct value is automatically calculated.

Description:

This is a standard method of calling a B function. At the time of the call, the first argument should be in the A register and the second in the Q register. The third and subsequent arguments should be in the stack at offsets "ARG.3,,sp", "ARG.4,,sp", etc. Stack offsets ARG.3, ARG.4, and ARG.5 are defined for this purpose. ARG.1 and ARG.2 are also available as offsets in which to store the A and Q registers, if needed.

The stack frame size is calculated by the BCALL macro to allow space for all the variables defined by use of the ARGDEF and AUTO macros plus room for the linkage area. At rare times this is not the desired value, in which case the "stackbump" parameter can be used to state the desired value explicitly.

Approximate equivalent code generated:

*      bcall   printf,4
       symref  printf
       tsx1    printf
       zero    .lcl,4

See Also:

expl b bmac incall
for function calls with address modification.

Copyright © 1996, Thinkage Ltd.