changeset 2213:0eaed2dfda42

Updated
author boisy
date Mon, 16 Mar 2009 15:20:10 +0000
parents 58ca25581f6d
children 33311c99276f
files level1/modules/clock2_dw3.asm level1/modules/scdwp.asm
diffstat 2 files changed, 37 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/level1/modules/clock2_dw3.asm	Mon Mar 16 14:59:09 2009 +0000
+++ b/level1/modules/clock2_dw3.asm	Mon Mar 16 15:20:10 2009 +0000
@@ -69,20 +69,18 @@
          clra
          os9     F$Link
          IFGT    Level-1
-         bcs     InitEx
-         sty     >D.DWSUB
-         jsr     ,y			call initialization routine
-InitEx  
          puls    x
          stx     <D.Proc
-         rts
+         bcs     InitEx
+         sty     <D.DWSUB
          ELSE
          bcs     ex
          sty     >D.DWSUB
-         jmp     ,y			call initialization routine
          ENDC
+         jsr     ,y			call initialization routine
+InitEx   rts
 
-         emod            
+         emod          
 eom      equ   *         
          end             
 
--- a/level1/modules/scdwp.asm	Mon Mar 16 14:59:09 2009 +0000
+++ b/level1/modules/scdwp.asm	Mon Mar 16 15:20:10 2009 +0000
@@ -74,7 +74,38 @@
 *    B  = error code
 *
 Init
-         rts
+* Check if D.DWSUB already holds a valid subroutine module pointer
+         IFGT  Level-1
+         ldx   <D.DWSUB
+         ELSE
+         ldx   >D.DWSUB
+         ENDC
+         bne   InitEx
+
+* If here, D.DWSUB is 0, so we must link to subroutine module
+         IFGT  Level-1
+         ldx   <D.Proc
+         pshs  x
+         ldx   <D.SysPrc
+         stx   <D.Proc
+         ENDC
+         clra
+         leax  dw3name,pcr
+         os9   F$Link
+         IFGT  Level-1
+         puls  x
+         stx   <D.Proc
+         ENDC
+         bcs   InitEx
+         IFGT  Level-1
+         sty   <D.DWSUB
+         ELSE
+         sty   >D.DWSUB
+         ENDC
+         jsr   ,y			call init routine
+InitEx   rts
+
+dw3name  fcs  /dw3/
 
 * Write
 *