xref: /csrg-svn/lib/libcompat/4.1/vax/reset.s (revision 21412)
113790Ssam/*
2*21412Sdist * Copyright (c) 1980 Regents of the University of California.
3*21412Sdist * All rights reserved.  The Berkeley software License Agreement
4*21412Sdist * specifies the terms and conditions for redistribution.
5*21412Sdist */
6*21412Sdist
7*21412Sdist#ifndef lint
8*21412Sdiststatic char sccsid[] = "@(#)reset.s	5.1 (Berkeley) 05/30/85";
9*21412Sdist#endif not lint
10*21412Sdist
11*21412Sdist/*
1213790Ssam * C library -- reset, setexit
1313790Ssam *
1413790Ssam *	reset(x)
1513790Ssam * will generate a "return" from
1613790Ssam * the last call to
1713790Ssam *	setexit()
1813790Ssam * by restoring r6 - r12, ap, fp
1913790Ssam * and doing a return.
2013790Ssam * The returned value is x; on the original
2113790Ssam * call the returned value is 0.
2213790Ssam *
2313790Ssam * useful for going back to the main loop
2413790Ssam * after a horrible error in a lowlevel
2513790Ssam * routine.
2613790Ssam */
2713790Ssam#include "DEFS.h"
282039Swnj
2913790SsamENTRY(setexit)
302039Swnj	movab	setsav,r0
312039Swnj	movq	r6,(r0)+
322039Swnj	movq	r8,(r0)+
332039Swnj	movq	r10,(r0)+
342039Swnj	movq	8(fp),(r0)+		# ap, fp
352039Swnj	movab	4(ap),(r0)+		# sp
362039Swnj	movl	16(fp),(r0)		# pc
372039Swnj	clrl	r0
382039Swnj	ret
392039Swnj
4013790SsamENTRY(reset)
412039Swnj	movl	4(ap),r0	# returned value
422039Swnj	movab	setsav,r1
432039Swnj	movq	(r1)+,r6
442039Swnj	movq	(r1)+,r8
452039Swnj	movq	(r1)+,r10
462039Swnj	movq	(r1)+,r12
472039Swnj	movl	(r1)+,sp
482039Swnj	jmp 	*(r1)
492039Swnj
502039Swnj	.data
512039Swnjsetsav:	.space	10*4
52