changeset 3055:35db67ca1302

level1 krn: Fix signal dispatch code to use R$ macros And also add comments to it!
author Tormod Volden <debian.tormod@gmail.com>
date Sun, 25 Jan 2015 22:36:02 +0100
parents 22ddd48b4ec2
children dde1b2fc79fc
files level1/modules/kernel/krn.asm
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/level1/modules/kernel/krn.asm	Sun Jan 25 22:36:02 2015 +0100
+++ b/level1/modules/kernel/krn.asm	Sun Jan 25 22:36:02 2015 +0100
@@ -506,14 +506,15 @@
          ldu   <P$SigVec,x             get signal handler addr
          beq   L02AC                   branch if none
          ldy   <P$SigDat,x             get data addr
-         ldd   $06,s
-         pshs  u,y,b,a
-         ldu   $0A,s
-         lda   <P$Signal,x
-         ldb   $09,s
-         tfr   d,y
-         ldd   $06,s
-         pshs  u,y,b,a
+         ldd   R$Y,s
+* set up new return stack for RTI
+         pshs  u,y,d            new PC (sigvec), new U (sigdat), same Y
+         ldu   6+R$X,s          old X via U
+         lda   <P$Signal,x      signal ...
+         ldb   6+R$DP,s         and old DP ...
+         tfr   d,y              via Y
+         ldd   6+R$CC,s         old CC and A via D
+         pshs  u,y,d            same X, same DP / new B (signal), same A / CC
          clrb
 L02FC    stb   <P$Signal,x
 L02FF    ldd   <P$SWI2,x