16795Srrh.data 0
2*6811Srrh	.asciz "	compat.s	4.1	82/05/12	"
36795Srrh.text
46795Srrh	.globl _regs
56795Srrh	.globl _psl
66795Srrh	.globl _pc
76795Srrh	.globl _compat
86795Srrh_compat:
96795Srrh	.word 0x0000
106795Srrh# fixup stack by doing rets from compat and the function
116795Srrh# which called it but modifying frame pc's to stay here
126795Srrh	moval l0,16(fp)	# fix first return address
136795Srrh	ret
146795Srrhl0:	moval l1,16(fp)	# fix first return address
156795Srrh	ret
166795Srrhl1:	moval l2,16(fp)	# fix next return address
176795Srrh	ret
186795Srrhl2:	movl _psl,4(sp)
196795Srrh	movl _pc,(sp)
206795Srrh# copy back saved register values
216795Srrh	movw _regs,r0
226795Srrh	movw _regs+02,r1
236795Srrh	movw _regs+04,r2
246795Srrh	movw _regs+06,r3
256795Srrh	movw _regs+010,r4
266795Srrh	movw _regs+012,r5
276795Srrh	movw _regs+014,r6
286795Srrh# go to compatability mode with rei assuming correct psl is setup
296795Srrh	rei
306795Srrh	.globl _getregs
316795Srrh_getregs:
326795Srrh	.word 0
336795Srrh# copy registers into known locations for examination or modification
346795Srrh	movw r0,_regs
356795Srrh	movw r1,_regs+02
366795Srrh	movw r2,_regs+04
376795Srrh	movw r3,_regs+06
386795Srrh	movw r4,_regs+010
396795Srrh	movw r5,_regs+012
406795Srrh	movw r6,_regs+014
416795Srrh	ret
42