changeset 922:b62985f61614

Added DOHELP conditional, montype now requires dash before options
author boisy
date Sun, 19 Jan 2003 14:15:02 +0000
parents 617c1b90e623
children 840aa54d6f45
files level2/cmds/montype.asm level2/cmds/wcreate.asm
diffstat 2 files changed, 62 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/level2/cmds/montype.asm	Sun Jan 19 14:04:37 2003 +0000
+++ b/level2/cmds/montype.asm	Sun Jan 19 14:15:02 2003 +0000
@@ -6,6 +6,7 @@
 * Ed.    Comments                                       Who YY/MM/DD
 * ------------------------------------------------------------------
 * 1      Original Tandy/Microware version
+* 2      Modified to require dash before option         BGP 03/01/20
 
          nam   MonType
          ttl   Change monitor type
@@ -19,17 +20,19 @@
 tylg     set   Prgrm+Objct   
 atrv     set   ReEnt+rev
 rev      set   $01
-edition  set   1
+edition  set   2
 
          mod   eom,name,tylg,atrv,start,size
 
-u0000    rmb   300
+         org   0
+         rmb   300
 size     equ   .
 
 name     fcs   /MonType/
          fcb   edition
 
 CurOn    fdb   $1B21
+         IFNE  DOHELP
 HelpMsg  fcb   C$CR
          fcb   C$LF
          fcc   "MonType - Set up the monitor type"
@@ -47,43 +50,52 @@
          fcc   "         m = monochrome monitor"
          fcb   C$CR
          fcb   C$LF
+         ENDC
 HelpMsgL equ   *-HelpMsg
 
-start    bsr   L00F3
+start    bsr   SkipSpcs
          cmpa  #C$CR
-         beq   L00FA
-         anda  #$5F
-         cmpa  #'R
+         IFNE  DOHELP
+         beq   ShowHelp
+         ELSE
+         beq   ExitOk
+         ENDC
+         andb  #$5F			make uppercase
+         cmpd  #$2D52			-R ?
          bne   L00C7
          ldx   #$0001
          bra   L00D7
-L00C7    cmpa  #'C
+L00C7    cmpd  #$2D43			-C ?
          bne   L00D0
          ldx   #$0000
          bra   L00D7
-L00D0    cmpa  #'M
-         bne   L00FA
+L00D0    cmpd  #$2D4D			-M ?
+         bne   ShowHelp
          ldx   #$0002
-L00D7    lda   #1
-         ldb   #SS.Montr
-         os9   I$SetStt 
-         bcs   L00F0
-         leax  >CurOn,pcr
-         lda   #1
-         ldy   #2
-         os9   I$Write  
-         bcs   L00F0
-L00EF    clrb  
-L00F0    os9   F$Exit   
-L00F3    lda   ,x+
+L00D7    lda   #1			standard output
+         ldb   #SS.Montr		monitor setstat
+         os9   I$SetStt 		do it!
+         bcs   Exit			branch if error
+         leax  >CurOn,pcr		point to cursor on
+         lda   #1			to stdout
+         ldy   #2			two bytes
+         os9   I$Write  		write it!
+         bcs   Exit			branch if error
+ExitOk   clrb  
+Exit     os9   F$Exit   
+
+SkipSpcs ldd   ,x+
          cmpa  #C$SPAC
-         beq   L00F3
+         beq   SkipSpcs
          rts   
-L00FA    lda   #1
+
+         IFNE  DOHELP
+ShowHelp lda   #1
          leax  >HelpMsg,pcr
          ldy   #HelpMsgL
          os9   I$Write  
-         bra   L00EF
+         bra   ExitOk
+         ENDC
 
          emod
 eom      equ   *
--- a/level2/cmds/wcreate.asm	Sun Jan 19 14:04:37 2003 +0000
+++ b/level2/cmds/wcreate.asm	Sun Jan 19 14:15:02 2003 +0000
@@ -16,6 +16,8 @@
          use   defsfile
          endc
 
+DOHELP   set   0
+
 tylg     set   Prgrm+Objct   
 atrv     set   ReEnt+rev
 rev      set   $01
@@ -35,7 +37,9 @@
 
 name     fcs   /WCreate/
          fcb   edition
-L0015    fcb   C$CR
+
+         IFNE  DOHELP
+HelpMsg  fcb   C$CR
          fcb   C$LF
          fcc   "WCreate <windpath> [-s=stype] xpos ypos width height fcol bcol [bord]"
          fcb   C$CR
@@ -55,7 +59,9 @@
          fcc   "         -?        receive help message"
          fcb   C$CR
          fcb   C$LF
-L0148    fdb   $1B21
+         ENDC
+
+CurOn    fdb   $1B21
 
 start    clr   <u000D
          clra  
@@ -66,17 +72,17 @@
          cmpa  #PDELIM
          bne   L015D
          bsr   L01B2
-         bra   L01AF
+         bra   Exit
 L015D    cmpa  #'-
-         lbne  L026B
+         lbne  ShowHelp
          leax  1,x
          lda   ,x+
          cmpa  #$3F
-         lbeq  L026B
+         lbeq  ShowHelp
          cmpa  #$7A
          beq   L0177
          cmpa  #$5A
-         lbne  L026B
+         lbne  ShowHelp
 L0177    lda   #$01
          sta   <u000D
 L017B    clra  
@@ -92,18 +98,19 @@
          cmpa  #C$CR
          beq   L01A0
          bsr   L01B5
-         bcs   L01AF
+         bcs   Exit
          bra   L017B
 L019C    cmpb  #$D3
-         bne   L01AF
+         bne   Exit
 L01A0    lda   #$01
          lbsr  L0254
          lda   <u000C
-         bmi   L01AE
+         bmi   ExitOk
          os9   I$Close  
-         bcs   L01AF
-L01AE    clrb  
-L01AF    os9   F$Exit   
+         bcs   Exit
+ExitOk   clrb  
+Exit     os9   F$Exit   
+
 L01B2    lbsr  L0260
 L01B5    clr   <u000A
          clr   <u0002
@@ -178,7 +185,7 @@
 L024E    lda   <u000B
          os9   I$Close  
 L0253    rts   
-L0254    leax  >L0148,pcr
+L0254    leax  >CurOn,pcr
          ldy   #$0002
          os9   I$Write  
          rts   
@@ -188,11 +195,14 @@
          leax  -1,x
          rts   
 L0269    leas  $02,s
-L026B    lda   #$01
-         leax  >L0015,pcr
+ShowHelp equ   *
+         IFNE  DOHELP
+         lda   #$01
+         leax  >HelpMsg,pcr
          ldy   #$0133
          os9   I$Write  
-         lbra  L01AE
+         ENDC
+         lbra  ExitOk
 L027B    pshs  b
          clrb  
          stb   ,y