/ calledby(f) returns 1 if f is active but not the function directly
/ calling calledby; otherwise it returns 0

	.globl 	_calledby, csv, cret
_calledby:
	jsr	r5, csv
	clr	r0
	mov	4(r5), r3	/ address of function to be found on stack
	mov	(r5), r4
nextsp:	mov	(r4), r4
	beq	return
	mov	2(r4), r1	/ find activation for function
	cmp	$4737, -4(r1)	/ call from jsr pc, *$rout?
	bne	1f
	cmp	r3, -2(r1)
	beq	set
1:	cmp	$4767, -4(r1)	/ call from jsr pc, rout?
	bne	nextsp
	add	-2(r1), r1
	cmp	r1, r3
	bne	nextsp
set:	mov	$1, r0		/ function found
return:	jmp	cret



