;Pass_Par.ACT›;›;Copyright 1994 by Tom Hunt›;All rights reserved.›;›;You may use this routine in your own›;programs, as long as the executable›;of that program is NOT to be sold.›;Shareware, freeware, and public domain›;executables are not covered by this›;restriction.›;›;The purpose of this routine is to›;interface with the Sparta Dos 3.2d›;command line. It should work on›;other variants of Sparta Dos also.›;›PROC RTS=*()›;Just in case.›[$60]›Module›byte Parm=[255]›;A flag.›;›card Crunch_Buffer›;Used when calculating the COMTAB›;offset to the crunch buffer.›;›byte array This_Fn(20),› Flags(20),› Zip_File(20),› Out_Mask(20),› This_Parm(20)›;Strings to hold the parameters on›;the command line.››byte Parm_Number=[0] ›;Which parameter number we are›;currently processing.›;››proc To_Upper(card p)›byte i,j›i=0:j=0›;This routine will parse the command›;line (or anywhere that p contains›;the address for), and turn the›;entire line into upper case letters,›;up to the EOL.›;›do › i=peek(p)› if i>$60 and i<$7B then› i==-$20› poke(p,i)› fi› p==+1›until i=155›od›return››››proc cpp=*() ›;This is the assembler routine which›;actually interfaces to the Sparta›;crunch routine.›;›[$20$00$00] ;JSR to DOS Crunch›[$08] ;PHP, save processor status.›[$68] ;PLA, return PS.›[$8D] ;STA absolute.›[Parm]›[$60] ;RTS.››return›;Command line parm puller›;›proc pull_parm()›;p=pull_parm()›;If p= 0 then there are no more parms.›;If p=255 then this function has been›;called for the first time.›;It is important that p be set to 255›;at the very beginning of the program,›;in order to signal this function that›;it has to initialize itself.›;›;Actually, let's call p "parm", ok?›;›byte i›card a,Dos_Crunch,Bufoff›if Parm=255 then›;Here if 1st time entry.› a=peekc($000A) ;Find COMTAB.› Dos_Crunch=a› Dos_Crunch==+3›;This calculates the address of the›;crunch routine.› pokec(cpp+1,Dos_Crunch)›;Sets up the assembler interface to›;the Sparta crunch routine.› Bufoff=a› Bufoff==+10› poke(Bufoff,0)›;Set BUFOFF to zero.››fi›Crunch_Buffer=a+33›;NOTE: This routine expects parameter›;input like this-›;ZIP [-FLAGS] ZIPFILE.ZIP [OUTFILE.COM]›;›;This calculates the offset to the›;Sparta crunched output buffer.›cpp()›;Below is how we extract the PC FLAG›;for ZERO. The ZERO flag is inverted›;to make things look better in action.›Parm==!$FF›Parm==&2›return ››proc Get_Parms()›byte i,j›while Parm>0›do›; print("Parm# = ")›; printbe(Parm_Number)› Pull_Parm()› i=0:j=0› do › i=peek(Crunch_Buffer+j)› poke(This_Parm+1+j,i)› j==+1› until i=155› od› poke(This_Parm,j)› To_Upper(This_Parm)›; pute()›; printe(This_Parm)› if Parm_Number=0 then›;Parm 0 is this filespec.› elseif Parm_Number=1 then› if This_Parm(4)='/ or This_Parm(4)='- then› SCopy(Flags,This_Parm)› else› poke(Flags,0)› SCopy(Zip_File,This_Parm)› fi› elseif Parm_Number=2 then› if Flags(0)>0 then› SCopy(Zip_File,This_Parm)› else› SCopy(Out_Mask,This_Parm)› fi› elseif Parm_Number=3 then› if Flags(0)>0 then› SCopy(Out_Mask,This_Parm)› fi› fi›› Parm_Number==+1›od›printe(Flags)›printe(Zip_File)›printe(Out_Mask)›››return››