	.text
	.even
	.globl _setjmp
_setjmp:
	movel	sp@(4),a0		| address of jmp_buf[]
	movel	sp@,a0@			| save return address
	moveml	d2-d7/a2-a7,a0@(4)	| save registers d2-d7/a2-a7
	clrl	d0			| return value is 0
	rts

	.globl _longjmp
_longjmp:
	movel	sp@(4),a0		| address of jmp_buf[]
	movew	sp@(8),d0		| value to return
	bne	L1			| may not be 0
	movel	#1, d0
L1:
	moveml	a0@(4),d2-d7/a2-a7	| restore saved reggies
	movel	a0@,sp@			| and the saved return address
	rts
