Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!ukma!rutgers!iuvax!bsu-cs!ibmbin
From: cgs@umd5.umd.edu (Chris Sylvain)
Newsgroups: comp.binaries.ibm.pc
Subject: switch, demonstrates how to read command line switches
Summary: switch.arc, demonstrates how to read command line switches
Message-ID: <4091@bsu-cs.UUCP>
Date: 24 Sep 88 11:01:04 GMT
Sender: ibmbin@bsu-cs.UUCP
Followup-To: comp.binaries.ibm.pc.d
Organization: University of Maryland, College Park
Lines: 95
Approved: dhesi@bsu-cs.UUCP

[ One of three programs received as a single package.  I edited the
submitter's description.  -- R.D. ]

SWITCH demonstrates one way to read single-letter switches from the
command line.  The command line switches are received by the program
from the program segment prefix (PSP) beginning at offset 80h.  The
executable and assembly source are supplied.

The program uses a single memory word (one bit per switch) to store
information for 16 switches, assumed to be /A through /P.  All switches
are treated as toggles.  The code commenting, wording of printing
messages and some of the code itself have been changed in a number of
places.

This is one of three programs, being posted consecutively to this
newsgroup, that was written using MASM 5.0 by Hardin Brothers for the
April 1988 issue of PC Resource magazine, (C) Copyright 1988 by IDG
Communications/Peterborough, Inc.

Hardin Brothers is a freelance programmer and technical writer. Write
to him at 280 N. Campus Ave., Upland, CA  91786. Enclose a self-
addressed, stamped envelope for a reply.

[
Uudecode this article normally or feed to the "combine" script.

checksum     size (bytes)  file
   49901         3545      this uuencoded posting
   61009         2552      switch.arc

-- R.D.
]

BEGIN--cut here--cut here
begin 644 switch.arc
M&@A35TE40T@N05--`%Y>N0@``"41U&5JCX<.```,8]ZT:5/	T$?!HH4)B`
M"IHTB:=R29DN8#&V:L;<3=G5=MMDF)DQF$T'GL$00=N%<<984M$DT$F9Y:75&P,*
MQ1D;#J(1QEJ.E5&04R;>Q!8(-E4&@AO=/?939G*Q$09:?$'%W$@I#-#;$&W#D,21ZE^W99Y0,)>!J$D0<
M`<*H`]4AV1B6/??1"U!TYIL8MHF)7G9)N#&&CPQ-N:"15[Z19400R8B4BCH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