BSD 4_1_snap development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Wed, 6 Aug 1980 04:07:45 +0000 (20:07 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Wed, 6 Aug 1980 04:07:45 +0000 (20:07 -0800)
Work on file usr/src/games/compat/Original/compat.s

Synthesized-from: CSRG/cd1/4.1.snap

usr/src/games/compat/Original/compat.s [new file with mode: 0644]

diff --git a/usr/src/games/compat/Original/compat.s b/usr/src/games/compat/Original/compat.s
new file mode 100644 (file)
index 0000000..16e8539
--- /dev/null
@@ -0,0 +1,36 @@
+       .globl _regs
+       .globl _psl
+       .globl _pc
+       .globl _compat
+_compat:
+       .word 0x0000
+# fixup stack by doing rets from compat and the function
+# which called it but modifying frame pc's to stay here
+       moval l1,16(fp) # fix first return address
+       ret
+l1:    moval l2,16(fp) # fix next return address
+       ret
+l2:    pushl _psl
+       pushl _pc
+# copy back saved register values
+       movw _regs,r0
+       movw _regs+02,r1
+       movw _regs+04,r2
+       movw _regs+06,r3
+       movw _regs+010,r4
+       movw _regs+012,r5
+       movw _regs+014,r6
+# go to compatability mode with rei assuming correct psl is setup
+       rei
+       .globl _getregs
+_getregs:
+       .word 0
+# copy registers into known locations for examination or modification
+       movw r0,_regs
+       movw r1,_regs+02
+       movw r2,_regs+04
+       movw r3,_regs+06
+       movw r4,_regs+010
+       movw r5,_regs+012
+       movw r6,_regs+014
+       ret