# HG changeset patch # User boisy # Date 1043444593 0 # Node ID c8489e2f382deae0163ac79c23ce8cb944905f81 # Parent 345872d37e14fdcf8ef7e7a796979b70721511ed Virtually 100% working EXCEPT for -b option. also need to support -b=xxx diff -r 345872d37e14 -r c8489e2f382d level1/cmds/dsave.asm --- a/level1/cmds/dsave.asm Fri Jan 24 21:27:26 2003 +0000 +++ b/level1/cmds/dsave.asm Fri Jan 24 21:43:13 2003 +0000 @@ -5,7 +5,7 @@ * * Syntax: dsave [] * Opts : -* -b = include bootfile +* -b = include bootfile (doesn't work) * -e = execute files * -i = indent dir levels * -l = only one dir level @@ -28,7 +28,8 @@ * Here are some tweakable options DOHELP set 0 1 = include help info -STACKSZ set 128 estimated stack size in bytes +INDENTSZ set 2 number of spaces to indent when -i is used +STACKSZ set 1024 estimated stack size in bytes PARMSZ set 256 estimated parameter size in bytes * Module header definitions @@ -94,14 +95,6 @@ * Place constant strings here IFNE DOHELP HlpMsg fcb C$LF - fcc /Use: NGU [] [] []/ - fcb C$LF - fcc / -a option 1/ - fcb C$LF - fcc / -b option 2/ - fcb C$LF - fcc / -c=f option 3/ - fcb C$LF fcb C$CR HlpMsgL equ *-HlpMsg ENDC @@ -118,6 +111,9 @@ MakDir fcc "makdir" fcb C$CR +Cmp fcc "cmp" + fcb C$CR + TMode fcc "tmode" fcb C$CR TPause fcc ".1 pause" @@ -134,6 +130,8 @@ Copy fcc "copy" fcb C$CR +OS9Boot fcc "OS9BOOT " + DotDot fcc "." Dot fcc "." fcb C$CR @@ -216,7 +214,7 @@ sta HlpMsg,pcr point to help message ldy #HlpMsgL get length - lda #$02 std error + lda #INDENTSZ std error os9 I$WritLn write it ENDC ExitOk clrb clear carry @@ -430,6 +451,34 @@ CopyFnEx tfr u,d puls u,pc +* Compare two filenames to see if they match +* X = filename to compare against OS9boot +BootCmp pshs y,x + lbsr StrLen get length of passed filename + puls x get pointer to passed filename + cmpy #7 compare stlren of X against OS9Boot + bne FileCmpEx if not the same length, they aren't equal +* Here we know the filenames are the same length + ldb #6 +FIleCmp2 leay OS9Boot,pcr + lda b,x + bsr MakeUp + cmpa b,y + bne FileCmpEx + decb + bpl FileCmp2 + clrb clear carry + puls y,pc +FileCmpEx orcc #Carry + puls y,pc + +MakeUp cmpa #'a + blt MakeUpEx + cmpa #'z + bgt MakeUpEx + anda #$DF make uppercase +MakeUpEx rts + StrHCpy pshs u ldu #$0000 HCpyFnLp lda ,x+ @@ -507,7 +556,7 @@ os9 F$PErr Ret rts -WriteIt ldy #80 +WriteIt ldy #1024 lda #1 os9 I$WritLn Rts rts @@ -520,7 +569,18 @@ * Copy command into linebuff and put space after it * Entry: X = pointer to command to copy to linebuff CopyCmd leay linebuff,u and point Y to line buffer - lbsr StrCpy copy command +* Do level indention if specified + tst