!head('calling sequence')
note: this information is of little interest to Fortran programmers, but is
required for writing assembler language programs callable from Fortran:
!pt the calling sequence used is compatible with that used by the C compiler,
and also the DEC "PC" calling sequence. for example, to call the Fortran
subroutine SUB with parameters (a,b,c) one would use
)l2a
mov	$c,-(sp)
mov	$b,-(sp)
mov	$a,-(sp)
mov	$3,-(sp)
mov	sp,r5
jsr	pc,_sub
add	$8.,sp
) !p in the above calling sequence note that the parameter's addresses are 
pushed onto the stack in reverse order, followed by the number of arguments.
this results in a stack organized compatibly with C. the C function SUB that
could be called with the above calling sequence might be:
)l2a
sub(n,a,b,c) int *a, *b, *c;
{
...
}
) !p here "n" is the number of arguments, and "a", "b", "c" are the addresses
(pointers) to the values required. 
!head('rules for assembler subroutines')
the following rules must be followed in assembler language programs called
from Fortran:
!pt registers R2, R3, R4, and R5 must be preserved. R0 and R1 may be destroyed.
!pt function results are returned in R0 for INTEGER*2, LOGICAL*2, and LOGICAL*1;
in FR0 for REAL; in FR0 and FR1 for COMPLEX; in R0 and R1 for INTEGER*4.
!pt floating point registers need not be preserved. the floating point processor
is set to double mode so as to be compatible with C routines.
!pt since Fortran routines set R5 as a pointer to the argument list (as well
as passing the list on the stack, assembler routines may access arguments
by using an offset off R5. 
however, this will result in routines that will not function properly when
called from C subroutines. they will however, be compatible with DEC
subroutines. Routines compatible with the C calling sequence with not
also be compatible with the DEC Fortran calling sequence. 
