changeset 2061:b17559c279fe

sysgo strings now nul terminated
author boisy
date Tue, 25 Apr 2006 21:27:46 +0000
parents 1a29c44561b3
children 356279c3f8fd
files defs/os9defs level1/modules/init.asm level1/modules/sysgo.asm
diffstat 3 files changed, 33 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/defs/os9defs	Tue Apr 25 19:53:07 2006 +0000
+++ b/defs/os9defs	Tue Apr 25 21:27:46 2006 +0000
@@ -707,9 +707,9 @@
 OSMinor        RMB       1                   OS minor
 Feature1       RMB       1                   feature byte 1
 Feature2       RMB       1                   feature byte 2
-OSName         RMB       2                   OS name string
-MachineName    RMB       2                   machine name string
-               RMB       6                   reserved for future use
+OSName         RMB       2                   OS revision name string (nul terminated)
+InstallName    RMB       2                   installation name string (nul terminated)
+               RMB       4                   reserved for future use
 
                IFGT      Level-1
 * -- VTIO area -- (NitrOS-9 Level 2 and above) *
--- a/level1/modules/init.asm	Tue Apr 25 19:53:07 2006 +0000
+++ b/level1/modules/init.asm	Tue Apr 25 21:27:46 2006 +0000
@@ -59,7 +59,7 @@
          ENDC
          fcb   $00        feature byte #2
          fdb   OSStr
-         fdb   MachStr
+         fdb   InstStr
          fcb   0,0,0,0  reserved
 
          IFGT  Level-1
@@ -93,9 +93,9 @@
          fcb   '0+NOS9MAJ
          fcc   /.0/
          fcb   '0+NOS9MIN
-         fcb   C$CR
+         fcb   0
 
-MachStr  equ   *
+InstStr  equ   *
          IFNE   coco
          fcc    "Radio Shack Color Computer"
          ELSE
@@ -117,7 +117,7 @@
          ENDC
          ENDC
          ENDC
-         fcb   C$CR
+         fcb   0
 
          emod  
 eom      equ   *
--- a/level1/modules/sysgo.asm	Tue Apr 25 19:53:07 2006 +0000
+++ b/level1/modules/sysgo.asm	Tue Apr 25 21:27:46 2006 +0000
@@ -120,6 +120,21 @@
 
 Init     fcs   /Init/
 
+* Entry: X = pointer to start of nul terminated string
+* Exit:  D = length of string
+strlen   pshs  x
+         ldd   #-1
+go@      addd  #$0001
+         tst   ,x+
+         bne   go@
+         puls  x,pc
+
+WriteCR  pshs  y
+         leax  CrRtn,pcr
+         ldy   #$0001
+         os9   I$WritLn
+         puls  y,pc
+         
 * SysGo Entry Point
 start    leax  >IcptRtn,pcr
          os9   F$Icpt
@@ -135,15 +150,19 @@
          os9   F$Link
          bcs   SignOn
          stx   <InitAddr
-         ldd   OSName,u
-         leax  d,u						point to name
-         ldy   #80
+         ldd   OSName,u					point to OS name in INIT module
+         bsr   strlen         
+         tfr   d,y
          lda   #$01
-         os9   I$WritLn
-         ldd   MachineName,u
-         leax  d,u						point to name
+         os9   I$Write
+         bsr   WriteCR
+         ldd   InstallName,u
+         leax  d,u						point to install name in INIT module
+         bsr   strlen         
+         tfr   d,y
          lda   #$01
-         os9   I$WritLn
+         os9   I$Write
+         bsr   WriteCR
          
 * Show rest of banner
 SignOn