changeset 908:00afdd6aeb1f

Modified option code to look for - in front of U
author boisy
date Sat, 18 Jan 2003 16:44:46 +0000
parents c8d81664cb86
children af7f4c525648
files level1/cmds/verify.asm
diffstat 1 files changed, 104 insertions(+), 93 deletions(-) [+]
line wrap: on
line diff
--- a/level1/cmds/verify.asm	Sat Jan 18 16:23:55 2003 +0000
+++ b/level1/cmds/verify.asm	Sat Jan 18 16:44:46 2003 +0000
@@ -6,6 +6,7 @@
 * Ed.    Comments                                       Who YY/MM/DD
 * ------------------------------------------------------------------
 *   5    From Tandy OS-9 Level One VR 02.00.00
+*   6    Option modified to require dash in frot        BGP 03/01/18
 
          nam   Verify
          ttl   Verify a module's CRC
@@ -19,144 +20,154 @@
 tylg     set   Prgrm+Objct   
 atrv     set   ReEnt+rev
 rev      set   $01
-edition  set   5
+edition  set   6
 
          mod   eom,name,tylg,atrv,start,size
 
-u0000    rmb   1
-u0001    rmb   1
-u0002    rmb   1
-u0003    rmb   2
-u0005    rmb   1
-u0006    rmb   2
-u0008    rmb   2
-u000A    rmb   57
+crc1     rmb   1
+crc2     rmb   1
+crc3     rmb   1
+readcnt  rmb   2
+dovfy    rmb   1
+bufptr   rmb   2
+bufsiz   rmb   2
+bytesrd  rmb   57
 u0043    rmb   195
-u0106    rmb   1000
+buffer   rmb   1000
 size     equ   .
 
 name     fcs   /Verify/
          fcb   edition
 
-start    leas  >u0106,u
-         sts   <u0006
-         tfr   y,d
-         subd  <u0006
-         std   <u0008
-         clr   <u0005
-L0023    lda   ,x+
-         cmpa  #C$SPAC
-         beq   L0023
-         anda  #$5F
-         cmpa  #$55
+start    leas  >buffer,u		point S to buffer
+         sts   <bufptr			save pointer to buffer
+         tfr   y,d			transfer end of our mem to D
+         subd  <bufptr			subtract bufptr address
+         std   <bufsiz
+         clr   <dovfy
+L0023    ldd   ,x+			get two chars
+         cmpa  #C$SPAC			space?
+         beq   L0023			branch if so
+         andb  #$5F			make uppercase
+         cmpd  #$2D55			-U ?
          bne   L0031
-         inc   <u0005
-L0031    ldd   #$0009
-         std   <u0003
-         lbsr  L00F6
+         inc   <dovfy			we will do verify
+L0031    ldd   #M$IDSize		get module id size
+         std   <readcnt			save read count
+         lbsr  DoRead
          bcs   L004D
-         cmpy  #$0009
-         bne   L0055
-         ldd   ,x
-         cmpd  #M$ID12
-         bne   L0055
-         bsr   L0059
+         cmpy  #M$IDSize
+         bne   BadMod
+         ldd   ,x			get first two bytes
+         cmpd  #M$ID12			OS-9 module sync bytes?
+         bne   BadMod			branch if not
+         bsr   DoCRCChk			check header parity
          bra   L0031
-L004D    cmpb  #E$EOF
-         bne   L0052
-         clrb  
-L0052    os9   F$Exit   
-L0055    ldb   #M$ID2
-         bra   L0052
-L0059    clrb  
-         lda   #$08
+L004D    cmpb  #E$EOF			end of file error?
+         bne   Exit			branch if not
+         clrb  				else clear carry
+Exit     os9   F$Exit   		and exit
+
+BadMod   ldb   #E$BMID
+         bra   Exit
+
+* Here is where we check the module
+DoCRCChk clrb  
+* First we will check the header parity
+         lda   #M$Parity
 L005C    eorb  ,x+
          deca  
          bne   L005C
-         lda   <u0005
-         bne   L0079
+         lda   <dovfy			get verify flag
+         bne   UpdtHdrP			branch if we must do verify
          eorb  ,x
          incb  
          beq   L0070
-         leax  >L012F,pcr
+         leax  >HdrBad,pcr
          bra   L0074
-L0070    leax  >L0115,pcr
-L0074    lbsr  L010B
+L0070    leax  >HdrGood,pcr
+L0074    lbsr  WriteLn
          bra   L007C
-L0079    comb  
+UpdtHdrP comb  
          stb   ,x
-L007C    ldx   <u0006
+L007C    ldx   <bufptr
          ldy   $02,x
          leay  -$03,y
-         sty   <u0003
+         sty   <readcnt
          ldd   #$FFFF
-         std   <u0000
-         stb   <u0002
+         std   <crc1
+         stb   <crc3
          bsr   L00D6
-         lda   <u0005
-         bne   L00B6
+         lda   <dovfy
+         bne   UpdtCRC
          ldd   #$0003
-         std   <u0003
+         std   <readcnt
          bsr   L00D6
-         lda   <u0000
-         cmpa  #$80
+         lda   <crc1
+         cmpa  #CRCCon1
          bne   L00A8
-         ldd   <u0001
-         cmpd  #$0FE3
+         ldd   <crc2
+         cmpd  #CRCCon23
          beq   L00AE
-L00A8    leax  >L015C,pcr
+L00A8    leax  >CRCBad,pcr
          bra   L00B2
-L00AE    leax  >L014C,pcr
-L00B2    bsr   L010B
+L00AE    leax  >CRCGood,pcr
+L00B2    bsr   WriteLn
          bra   L00CF
-L00B6    com   <u0000
-         com   <u0001
-         com   <u0002
-         lda   #$01
-         leax  ,u
-         ldy   #$0003
-         os9   I$Write  
-         bcs   L0052
+UpdtCRC  com   <crc1
+         com   <crc2
+         com   <crc3
+         lda   #$01			to standard out
+         leax  ,u			point to CRCs
+         ldy   #$0003			3 bytes
+         os9   I$Write  		write it out
+         bcs   Exit			branch if error
          clra  
          os9   I$Read   
-         bcs   L0052
+         bcs   Exit
 L00CF    rts   
-L00D0    bsr   L00F6
-         lbcs  L0052
-L00D6    ldy   <u000A
+L00D0    bsr   DoRead
+         lbcs  Exit
+L00D6    ldy   <bytesrd
          beq   L00D0
          os9   F$CRC    
-         lda   <u0005
+         lda   <dovfy
          beq   L00EB
-         lda   #$01
-         os9   I$Write  
-         lbcs  L0052
-L00EB    ldd   <u0003
-         subd  <u000A
-         std   <u0003
+         lda   #$01			standard output
+         os9   I$Write  		write it
+         lbcs  Exit			branch if error
+L00EB    ldd   <readcnt
+         subd  <bytesrd
+         std   <readcnt
          bne   L00D0
-         std   <u000A
+         std   <bytesrd
          rts   
-L00F6    clra  
-         ldx   <u0006
-         ldy   <u0008
-         cmpy  <u0003
-         bls   L0104
-         ldy   <u0003
-L0104    os9   I$Read   
-         sty   <u000A
+
+DoRead   clra  
+         ldx   <bufptr			get buffer pointer
+         ldy   <bufsiz			get buffer size
+         cmpy  <readcnt			compare against read count
+         bls   ExecRead			if lower, use bufsiz
+         ldy   <readcnt			else read count
+ExecRead os9   I$Read   		read data
+         sty   <bytesrd			save read count
          rts   
-L010B    lda   #$02
-         ldy   #$0050
+
+WriteLn  lda   #$02
+         ldy   #80
          os9   I$WritLn 
          rts   
-L0115    fcc   "Header parity is correct."
+
+HdrGood  fcc   "Header parity is correct."
          fcb   C$CR
-L012F    fcc   "Header parity is INCORRECT !"
+
+HdrBad   fcc   "Header parity is INCORRECT !"
          fcb   C$CR
-L014C    fcc   "CRC is correct."
+
+CRCGood  fcc   "CRC is correct."
          fcb   C$CR
-L015C    fcc   "CRC is INCORRECT !"
+
+CRCBad   fcc   "CRC is INCORRECT !"
          fcb   C$CR
 
          emod