REGS - B program register usage conventions.

x1       Holds return address across call
x0,x2,   User scratch not preserved across call
x3,x4
x5       Save before use, restore before return
x6=cp    Pointer to current co-routine header
x7       Holds display pointer across call
ar0,ar1, User scratch not preserved across call
ar2,ar3
ar4=rd   Pointer to current read IO vector
         Use, but change only by call to .READ
ar5=wr   Pointer to current write IO vector
         Use, but change only by call to .WRITE
ar6      Reserved for co-routine package
ar7=sp   Stack pointer changed by entry/exit code

Register x1 is used hold the return address. If the routine uses the standard entry sequence, this is saved on the stack and x1 may be used as scratch in the function.

In Pascal environments, x7 may contain a display pointer. If so, the display (not x7) must be copied to a safe place before x7 may be used as scratch.

Note that the standard function entry sequence destroys x0, x1, and x2. On function entry, the AQ contains the first two words of arguments to the function.

See Also:

expl b environment
for a more detailed description of the environment.

Copyright © 1996, Thinkage Ltd.