1*6789Srrh#
2*6789Srrh# 	compat.s	1.1	82/05/12
3*6789Srrh#
4*6789Srrh	.globl _regs
5*6789Srrh	.globl _psl
6*6789Srrh	.globl _pc
7*6789Srrh	.globl _compat
8*6789Srrh_compat:
9*6789Srrh	.word 0x0000
10*6789Srrh# fixup stack by doing rets from compat and the function
11*6789Srrh# which called it but modifying frame pc's to stay here
12*6789Srrh	moval l1,16(fp)	# fix first return address
13*6789Srrh	ret
14*6789Srrhl1:	moval l2,16(fp)	# fix next return address
15*6789Srrh	ret
16*6789Srrhl2:	pushl _psl
17*6789Srrh	pushl _pc
18*6789Srrh# copy back saved register values
19*6789Srrh	movw _regs,r0
20*6789Srrh	movw _regs+02,r1
21*6789Srrh	movw _regs+04,r2
22*6789Srrh	movw _regs+06,r3
23*6789Srrh	movw _regs+010,r4
24*6789Srrh	movw _regs+012,r5
25*6789Srrh	movw _regs+014,r6
26*6789Srrh# go to compatability mode with rei assuming correct psl is setup
27*6789Srrh	rei
28*6789Srrh	.globl _getregs
29*6789Srrh_getregs:
30*6789Srrh	.word 0
31*6789Srrh# copy registers into known locations for examination or modification
32*6789Srrh	movw r0,_regs
33*6789Srrh	movw r1,_regs+02
34*6789Srrh	movw r2,_regs+04
35*6789Srrh	movw r3,_regs+06
36*6789Srrh	movw r4,_regs+010
37*6789Srrh	movw r5,_regs+012
38*6789Srrh	movw r6,_regs+014
39*6789Srrh	ret
40