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