home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
zcpr2
/
cfiles.hlp
< prev
next >
Wrap
Text File
|
1994-07-13
|
22KB
|
560 lines
Command File Processing
Disk-Based Command Files -- SUB2
SUB2 Error Messages
SUB2 Command Summary
Memory-Based Command Files -- ZEX
ZEX Control Commands
Restrictions on Command Files
SUB2 and ZEX as Extended Command Processors Under ZCPR2
:Command File Processing
┴ CommanΣ Filσ i≤ ß filσ containinτ commands¼á witΦ optiona∞ ì
paramete≥á substitution¼á whicΦ caε bσ executeΣ b∙ ZCPR2«á Thesσ ì
command≤á arσá exactl∙ thσ samσ kind≤ oµ command≤á a≤á yo⌡á woulΣ ì
issuσá a⌠á thσ console¼á anΣ an∙ commanΣ yo⌡ caε issuσá froφá thσ ì
consolσá caεá bσ issueΣ froφ withiε ß CommanΣ Filσ (witΦá jus⌠á ß ì
couple of restrictions).
Thσá CommanΣ Filσ Facilitie≤ oµ SUB▓ anΣ ZE╪á arσá availablσ ì
unde≥ ZCPR2«á Simila≥ iε concep⌠ t∩ thσ SUBMI╘ facilit∙ oµ CP/M¼ ì
botΦá SUB▓ anΣ ZE╪ arσ upward-compatablσ t∩ SUBMI╘ (an∙ SU┬á filσ ì
caε ruε unde≥ theφ witΦ fe≈ restrictions).
BotΦá SUB▓á anΣá ZE╪á begiε processinτá b∙á translatinτá thσ ì
commanΣ file≤ the∙ arσ giveε int∩ slightl∙ differen⌠ forms« BotΦ ì
d∩ paramete≥ substitution¼ extractinτ parameter≤ froφ thσ commanΣ ì
line≤á anΣ placinτ theφ int∩ thσ tex⌠ oµ thσ commanΣ streaφá the∙ ì
arσ building«á SUB▓ build≤ thσ commanΣ streaφ t∩ bσ executeΣá oε ì
disδá drivσ ┴ unde≥ thσ curren⌠ use≥ number¼á anΣ ZE╪ build≤á thσ ì
commanΣ streaφ iε memory.
A≤á thσ use≥ caε guess¼á ZE╪ i≤ generall∙ preferreΣ t∩ SUB2« ì
Unde≥ ZEX¼á thσ commanΣ streaφ i≤ executeΣ mucΦ morσ quickl∙ thaε ì
unde≥ SUB▓ sincσ ZE╪ jus⌠ goe≤ int∩ memor∙ fo≥ thσ nex⌠ characte≥ ì
whilσ ZCPR▓ ha≤ t∩ g∩ t∩ disk« ZEX¼ however¼ doe≤ takσ u≡ memor∙ ì
space¼ anΣ tha⌠ i≤ it≤ maiε drawback« Thσ TP┴ (Transien⌠ Prograφ ì
Area⌐á unde≥á ZE╪ i≤ smalle≥ thaε wha⌠ i≤á availablσá t∩á commanΣ ì
file≤á runninτ unde≥ SUB2«á Thi≤ i≤ you≥ basiπ trade-ofµ betweeε ì
thσ tw∩ CommanΣ Filσ Processors.
Anothe≥ differencσ betweeε SUB▓ anΣ ZE╪ i≤ tha⌠ SUB▓ commanΣ ì
stream≤ arσ line-orienteΣ anΣ extracteΣ onl∙ b∙ ZCPR2«á Tha⌠ is¼ ì
SUB▓á build≤ ß commanΣ filσ nameΣ $$$.SU┬ likσ SUBMI╘á does¼á anΣ ì
ZCPR▓á extract≤á ßá linσ froφ thσ $$$.SU┬ filσ eacΦá timσá i⌠á i≤ ì
entered« Wheε ZCPR▓ i≤ entereΣ b∙ eithe≥ ß ColΣ Boot¼ Warφ Boot¼ ì
o≥á simplσ RETurε froφ ß loadeΣ program¼á i⌠ check≤ thσá Multiplσ ì
CommanΣ Linσ Buffe≥ fo≥ ß pendinτ command«á Iµ i⌠ find≤á it¼á i⌠ ì
execute≤ it« Iµ not¼ i⌠ check≤ thσ A║ drivσ (curren⌠ user⌐ fo≥ ß ì
$$$.SU┬á file«á Iµ i⌠ find≤ one¼á i⌠ extract≤ thσ nex⌠ linσ froφ ì
thσ $$$.SU┬ file¼á processe≤ it¼á anΣ begin≤ executioε oµ i⌠ froφ ì
thσ Multiplσ CommanΣ Linσ Buffer«á Finally¼á iµ thσ $$$.SU┬ filσ ì
is not found, ZCPR2 prompts the user for input.
Tha⌠á i≤á ho≈á commanΣá streaφá processinτá unde≥á SUB▓áá i≤ ì
performed« ZEX¼ however¼ act≤ a≤ ß combinatioε oµ SUB▓ anΣ XSUB« ì
Oncσ commanΣ streaφ processinτ begin≤ unde≥ ZEX¼ thσ ZE╪ monitor¼ ì
locateΣ unde≥ ZCPR▓ witΦ thσ associateΣ commanΣ stream¼á supplie≤ ì
ßá characte≥ eacΦ timσ thσ BIO╙ Consolσ Inpu⌠ Routinσ i≤á called« ì
ZE╪ extract≤ thσ nex⌠ characte≥ froφ thσ commanΣ stream¼ examine≤ ì
i⌠á t∩á seσá iµ i⌠ i≤ ß ZE╪ commanΣ anΣ execute≤ i⌠á iµá so¼á anΣ ì
returns it to the calling program if it is not a ZEX command.
Hence¼á ZCPR▓á itselµ doe≤ no⌠ realizσ tha⌠ ZE╪ i≤á running« ì
Neithe≥á d∩á thσá transien⌠á program≤á iεá general«á ZE╪á simpl∙ ì
intercept≤ al∞ call≤ t∩ thσ BIO╙ Consolσ Inpu⌠ (anΣ Inpu⌠ Status⌐ ì
routinσ anΣ provide≤ aε inpu⌠ characte≥ iε it≤ place«á Therσ arσ ì
exceptions to this case, but they will be discussed later.
BotΦ SUB▓ anΣ ZE╪ fi⌠ int∩ thσ ZCPR▓ Systeφ nicely¼ anΣ the∙ ì
caεá bσá useΣ t∩ ac⌠ a≤ ExtendeΣ CommanΣ Processor≤á iµá desired« ì
This is discussed later.
:Disk-Based Command Files -- SUB2
SUB2¼á commonl∙á calleΣá SUB¼á i≤á invokeΣá b∙á onσá oµá thσ ì
following command lines:
SUB or SUB // <-- Print Help Message
SUB /A Text <-- Abort $$$.SUB File
Processing at User's
Discretion
SUB /AB Text <-- Same as /A but Ring Bell
to Alert User
SUB /D commands <-- Perform Commands following
the /D
SUB /I <-- Enter Interactive Input
Mode
SUB filename params <-- As in Standard SUBMIT
Thσá "SU┬á /Aóá anΣá "SU┬á /ABóá form≤á allo≈á thσá use≥á t∩ ì
gracefull∙á abor⌠ ß $$$.SU┬ file«á ^├ a⌠ thσ consolσ caε bσ useΣ ì
t∩á abor⌠ sucΦ processinτ a≤ unde≥ CP/M¼á bu⌠ thσ /┴ forφá allow≤ ì
thσá luxur∙á oµá startinτá ß commanΣ streaφá anΣá stoppinτá a⌠á ß ì
critica∞ poin⌠ t∩ allo≈ thσ use≥ t∩ takσ hi≤ time¼á inspec⌠á wha⌠ ì
ha≤ happened¼ anΣ theε decidσ whethe≥ t∩ proceeΣ o≥ not.
Thσá "SU┬á /Dóá forφá ha≤á littlσá utilit∙á unde≥á ßá fully-ì
implementeΣá ZCPR▓á System«á Yo⌡ caε obtaiε ß bette≥á effec⌠á b∙ ì
simpl∙á issuinτá ßá conventiona∞ ZCPR▓ commanΣá stream«á Thσá /─ ì
optioεá i≤á gooΣ onl∙ iε environ≤ whicΦ d∩ no⌠á suppor⌠á multiplσ ì
commands.
Thσ "SU┬ /Ió forφ eliminate≤ thσ neeΣ fo≥ thσ use≥ t∩ usσ aε ì
edito≥ t∩ creatσ ß .SU┬ file«á Iµ thσ use≥ ha≤ ß commanΣá streaφ ì
hσá want≤ t∩ executσ immediatel∙ anΣ doesn'⌠ carσ t∩ d∩ i⌠ again¼ ì
hσ caε usσ thi≤ option«á Iε response¼á SUB▓ allow≤ hiφ t∩á ente≥ ì
hi≤á commanΣá streaφ (sorry¼á n∩ paramete≥ passing⌐ ß linσá a⌠á ß ì
time«á Wheεá i⌠ i≤ al∞ entereΣ (use≥ enter≤ aε empt∙ line)¼á thσ ì
$$$.SU┬ filσ i≤ buil⌠ anΣ executed.
Thσ fina∞ form¼á "SU┬ filenamσ params"¼ i≤ identica∞ iε forφ ì
t∩á thσá SUBMI╘á commanΣá supplieΣá witΦá CP/M«á Thσá "filenameó ì
specifie≤á thσá namσá oµ thσ .SU┬ filσ t∩ bσá executed¼á anΣá thσ ì
parameter≤ arσ associateΣ witΦ thσ substitutioε variable≤ oµá $1¼ ì
$2¼á etc«á U≡á t∩ 2░ parameter≤ ma∙ bσ specified«á Thσ sequencσ ì
"$$óá place≤á ßá "$ó int∩ thσ commanΣá line¼á anΣá thσá characte≥ ì
sequencσá "^cóá place≤ thσ indicateΣ contro∞ characte≥á int∩á thσ ì
commanΣ linσ (uparro≈ ├ place≤ Control-C).
Thσá SUB▓ commanΣ ma∙ bσ nesteΣ int∩ ß $$$.SU┬ file«á Iµá ß ì
"SU┬á filenamσ paramsó commanΣ i≤ encountereΣ iε ß $$$.SU┬á file¼ ì
SUB▓á runs¼á realize≤á tha⌠ thi≤ ha≤ happened¼á anΣá insert≤á thσ ì
indicateΣá commanΣ file¼á witΦ paramete≥ substitution¼á int∩á thσ ì
runninτá commanΣá streaφ a⌠ thσ appropriatσ place«á Thi≤ ma∙á bσ ì
nesteΣ a≤ man∙ level≤ dee≡ a≤ desired.
Unde≥ ZCPR2¼á iµ SUB▓ i≤ executeΣ witΦ thσ Multiplσá CommanΣ ì
Linσá Facilit∙ invokeΣ anΣ morσ command≤ follo≈ thσ SUB▓ command¼ ì
theε thσ res⌠ oµ thσ Multiplσ CommanΣ Linσ i≤ inserteΣ a⌠ thσ enΣ ì
of the generated $$$.SUB file.
Finally¼á SUB▓ follow≤ thσ ZCPR▓ patΦ wheε searchinτ fo≥ thσ ì
indicateΣá commanΣ file«á I⌠ i≤ full∙ integrateΣ int∩ thσá ZCPR▓ ì
Systeφá anΣá i≤á ablσ t∩ emplo∙ thσ Externa∞á PatΦá anΣá Multiplσ ì
Command Line Buffer features of ZCPR2.
:SUB2 Error Messages
SUB▓á provide≤á ß numbe≥ oµ informativσ diagnostic≤á t∩á thσ ì
user«á Iε particular¼á wheε processinτ ß CommanΣ File¼á wheεá aε ì
erro≥ i≤ encountered¼ thσ use≥ i≤ informeΣ oµ thσ linσ numbe≥ thσ ì
error occurs at.
Thσá followinτá summarize≤ thσ erro≥ message≤á presenteΣá b∙ ì
SUB2:
Disk Full
There is no room to write the $$$.SUB file
Directory Full
There is no directory space for the $$$.SUB file
Memory Full
There is not enough memory in which to build the
command stream to be placed into the $$$.SUB file
SUB2 Error Messages, Con't
SUBMIT File Not Found
The .SUB file specified in the command line could
not be found along the ZCPR2 path
Parameter
Invalid Parameter Specified
Too Many Parameters
More than 20 parameters were on the command line
Line too Long
The current line in the command stream exceeds
128 bytes
SUBMIT File Empty
The .SUB file specified in the command line was
found to be empty
SUB2 Error Messages, Con't
Control Character
The ^c form was not followed by a letter A-Z
:SUB2 Command Summary
The following are valid SUB2 command line forms:
SUB or SUB // <-- Print Help Message
SUB /A Text <-- Abort $$$.SUB File
Processing at User's
Discretion
SUB /AB Text <-- Same as /A but Ring Bell
to Alert User
SUB /D commands <-- Perform Commands following
the /D
SUB /I <-- Enter Interactive Input
Mode
SUB filename params <-- As in Standard SUBMIT
:Memory-Based Command Files -- ZEX
Thσá Memory-BaseΣ CommanΣ Filσ Processo≥ oµ ZCPR2¼á ZEX¼á i≤ ì
invoked by the following forms:
ZEX // <-- Print Help
ZEX <-- Enter Interactive Mode
ZEX filename params <-- Process .ZEX or .SUB
file as with SUBMIT
Thσá Interactivσ Modσ oµ ZE╪ execute≤ likσá thσá Interactivσ ì
Modσá oµá SUB2«á Thσá use≥á enter≤ commanΣá line≤á unti∞á hσá i≤ ì
satisfieΣá anΣá theε terminate≤ thσ proces≤ b∙ enterinτ aεá empt∙ ì
linσ (simpl∙ hittinτ RETURN)«á ZE╪ theε execute≤ thσ command≤ iε ì
thσ sequencσ entered«á N∩ paramete≥ passinτ i≤ permitteΣ iε thi≤ ì
mode of operation.
Thσá "ZE╪á filenamσ paramsó forφ i≤ likσá thσá correspondinτ ì
SUB▓ form«á ZE╪ wil∞ searcΦ alonτ thσ ZCPR▓ Externa∞ PatΦ fo≥á ß ì
commanΣá filσá oµ thσ forφ filename.ZE╪ o≥á filename.SUB«á Iµá ß ì
director∙ i≤ entereΣ whicΦ contain≤ botΦ sucΦ files¼á thσ filσ oµ ì
type ZEX will be executed.
Oncσá ZE╪ ha≤ beguε execution¼á i⌠ place≤ ß ZE╪ Monito≥ jus⌠ ì
unde≥á ZCPR▓á anΣ build≤ thσ commanΣ streaφá unde≥á thσá monitor« ì
Oncσá complete¼á thσ addres≤ oµ thσ BDO╙ i≤ adjusteΣ s∩ tha⌠á thσ ì
ZE╪á monito≥á anΣ it≤ commanΣ streaφ wil∞ no⌠ bσá overwritteεá b∙ ì
transien⌠á programs¼á anΣ executioε begins«á EacΦ timσ thσá BIO╙ ì
Consolσáá Inpu⌠á routinσá i≤á called¼áá ZE╪á supplie≤á thσá inpu⌠ ì
character.
A≤ witΦ SUB2¼á ß ^├ froφ thσ consolσ wil∞ abor⌠ executioε oµ ì
ß ZE╪ commanΣ stream«á Also¼á a≤ witΦ SUB2¼ iµ ß commanΣ follow≤ ì
ZE╪á iε ß Multiplσ CommanΣ Line¼á ZE╪ append≤ thi≤ commanΣ t∩ thσ ì
command stream.
Unlikσ SUB2¼á ZE╪ doe≤ no⌠ permi⌠ nestinτ oµ commanΣá files« ì
ZE╪á wil∞á simpl∙á abor⌠ iµ ß ZE╪ commanΣ i≤ encountereΣá iεá thσ ì
commanΣ streaφ i⌠ i≤ processing.
Unlikσá SUB2¼á ZE╪á support≤ man∙á morσá embeddeΣá commands« ì
Combininτá thσá facilitie≤á oµ SUB▓ anΣ XSU┬ iεá thi≤á case¼á thσ ì
embeddeΣá command≤ oµ ZE╪ reflec⌠ thσ XSUB-likσá capabilitie≤á oµ ì
ZE╪ a≤ wel∞ a≤ somσ ne≈ ideas.
Thesσá extendeΣá contro∞ command≤ arσ discusseΣ iε thσá nex⌠ ì
information section.
:ZEX Control Commands
The following summarizes the ZEX Control Commands:
Cmd Meaning Cmd Meaning
| insert <CR> ^| insert <CRLF>
^║ reruε commanΣ streaφ ^« togglσ prin⌠ suppress
^# toggle ZEX messages ^$ define default params
^? wait for user input ^/ ring bell and ^?
^* ring bell ^" accept user input
^< display chars only ^> stop display
;; ZEX comment $n 1<=n<=9 for param
$$ $ $^ ^
$| | ^c control char
This summary is also displayed via the built-in ZEX help.
Thσ followinτ command≤ simpl∙ inser⌠ character≤ int∩ thσ ZE╪ ì
command stream and will not be discussed in any greater detail.
| inserts a <CR> ^| inserts a <CR> <LF> pair
$$ inserts a single $ $^ inserts a single ^
$| inserts a single | ^c inserts a control character
Thσ ^¬ commanΣ simpl∙ cause≤ ZE╪ t∩ rinτ thσ bell«á I⌠ doe≤ ì
no⌠á inser⌠á ßá BEL╠ characte≥ int∩ thσ commanΣ filσá likσá ßá ^╟ ì
sequencσáá would«áá I⌠á simpl∙á ring≤á thσá bel∞á anΣá continue≤ ì
processing.
Thσá ;╗á commanΣá i≤ ß ZE╪ comment«á I⌠ anΣ al∞á character≤ ì
followinτá i⌠á u≡á t∩ anΣ includinτ thσ followinτá <LF╛á arσá no⌠ ì
includeΣ iε thσ ZE╪ commanΣ stream« The∙ arσ simpl∙ treateΣ a≤ ß ì
commen⌠á iεá thσá ZE╪á CommanΣá Filσá anΣá ignored«áá Unlikσáá ß ì
conventiona∞á ZCPR▓á comment¼á thσ ZE╪ commen⌠ doe≤ no⌠á takσá u≡ ì
spacσá iε thσ commanΣ streaφ anΣ doe≤ no⌠ appea≥ wheε thσ commanΣ ì
stream is executed.
Thσ ^╝ anΣ ^╛ command≤ arσ useΣ t∩ bracke⌠ character≤á whicΦ ì
arσá simpl∙ echoeΣ b∙ thσ ZE╪ monito≥ anΣ no⌠ passeΣ bacδ t∩á thσ ì
callinτá program«á Thi≤á cause≤á thσá character≤á betweeεá thesσ ì
command≤á t∩á bσá echoeΣá t∩ thσ use≥ durinτá executioεá bu⌠á no⌠ ì
processeΣá b∙á an∙á program«á Thi≤á featurσá i≤á ver∙á gooΣá fo≥ ì
embeddinτá comment≤á t∩á bσ printeΣ a⌠ executioεá timσá int∩á thσ ì
commanΣ stream«á Unlikσ thσ ZCPR▓ commen⌠ form¼á whicΦ i≤ ß linσ ì
beginninτá witΦ ß semicolon¼á comment≤ encloseΣ b∙ ^╝ anΣ ^╛á ma∙ ì
appea≥ anywhere¼ sucΦ a≤ withiε aε edito≥ session.
Thσá ^ú commanΣ toggle≤ suppressioε oµ informativσá message≤ ì
generated by ZEX.
Thσ ^« commanΣ cause≤ consolσ outpu⌠ t∩ ceasσ unti∞ thσ nex⌠ ì
^«áá i≤á encountered«á Characte≥á inpu⌠á froφá thσá ZE╪á Monito≥ ì
continues¼ bu⌠ thσ use≥ doe≤ no⌠ seσ wha⌠ i⌠ is.
Thσ ^║á commanΣ cause≤ thσ ZE╪ monito≥ t∩ restar⌠á executioε ì
oµá thσá loadeΣ commanΣ stream«á Thσ entirσ commanΣá stream¼á a≤ ì
initiall∙ processeΣ b∙ ZEX¼ i≤ executeΣ agaiε froφ thσ beginning.
$n¼á wherσá 1<=n<=9¼á wil∞ causσ thσ indicateΣ specifieΣá o≥ ì
default parameter to be substituted from the command line.
Thσá ^ñá commanΣá i≤ useΣ t∩ definσ o≥ redefinσ thσá se⌠á oµ ì
inpu⌠ commanΣ parameters«á Thσ res⌠ oµ thσ linσ followinτ thσ ^ñ ì
i≤ treateΣ a≤ ß se⌠ oµ parameter≤ separateΣ b∙ blanks.
Thσá ^┐á anΣ ^» command≤ replacσ thσ /┴ anΣ /A┬á option≤á oµ ì
SUB2«á ^┐ cause≤ ZE╪ t∩ sto≡ processinτ anΣ wai⌠ fo≥ thσ use≥ t∩ ì
strikσá eithe≥ thσ spacσ ba≥ o≥ thσ RETUR╬ ke∙ beforσ continuing« ì
Thσ use≥ caε takσ hi≤ timσ anΣ examinσ thσ display¼á and¼á iµá hσ ì
doe≤á no⌠ wisΦ t∩ continue¼á ß ^├ wil∞ abor⌠ thσ commanΣá stream« ì
Thσ ^» commanΣ i≤ likσ ^?¼á bu⌠ i⌠ periodicall∙ ring≤ thσ bel∞ a⌠ ì
the console, summoning the user in an alarm fashion.
Finally¼á thσá ^ó commanΣ cause≤ ZE╪ t∩ sto≡ providinτ inpu⌠ ì
froφá thσ commanΣ streaφ anΣ allo≈ thσ use≥ t∩ inpu⌠ whateve≥á hσ ì
wishe≤á unti∞ ß specia∞ characte≥ i≤ output¼á a⌠ whicΦá timσá ZE╪ ì
wil∞ resumσ providinτ input« Iε thi≤ case¼ ZE╪ caε bσ intimatel∙ ì
linkeΣ witΦ ZCPR2¼á anΣ i⌠ i≤ intendeΣ tha⌠ thσ specia∞ characte≥ ì
tha⌠ ZE╪ i≤ waitinτ fo≥ i≤ associateΣ witΦ thσ ZCPR▓ prompt«á Iε ì
m∙á case¼á ╔ madσ thσ ZCPR▓ promp⌠ t∩ bσ ß ">ó characte≥ witΦ thσ ì
mos⌠ significan⌠ bi⌠ set«á Thi≤ i≤ uniquσ anΣ appear≤ onl∙á wheε ì
the prompt comes up on my system.
No≈á tha⌠á ╔á havσá beateε thσ subjec⌠ oµá thσá ZE╪á Contro∞ ì
Command≤ t∩ death¼ thσ followinτ example≤ illustratσ application≤ ì
employinτ them«á M∙ comment≤ appea≥ ou⌠ t∩ thσ side¼ prefixeΣ b∙ ì
<--.
B1>zex
ZEX, Version 1.3
1: ^$ this is fun <-- I Define 3 params
2: echo $1 $2 $3
3: ^$ hello from happy acres <-- I Define 4 params
4: echo $1 $2 $3 $4
5:
(ZEX Active) <-- ZEX is running now
B1>echo this is fun
THIS IS FUN
B1>echo hello from happy acres
HELLO FROM HAPPY ACRES
B1>
(ZEX Completed)
By Your Command >
B1>ed demo.zex <-- Demo Command File
NEW FILE
: *i
1: ed demo.txt <-- Edit DEMO.TXT
2: i <-- Insert text while in ED
3: This is a test
4: This is only a test
5: This is a demo of ZEX Control
6: ^Z <-- ^Z is 2 chars, xlated into
7: b0lt <-- Ctrl-Z by ZEX
8: 1l
9: 0lt
10: i <-- Input More Text
11: ^" <-- I now input text myself
12: type demo.txt <-- When ZEX continues, this
13: era demo.txt <-- is what it does next
14:
: *e
B1>zex demo <-- Run the command file
ZEX, Version 1.3
(ZEX Active)
B1>ed demo.txt
NEW FILE
: *i <-- ZEX is typing this in
1: This is a test
2: This is only a test
3: This is a demo of ZEX Control
4:
: *b0lt
1: This is a test
1: *1l
2: *0lt
2: This is only a test
2: *i <-- Now my input begins
2: I am now typing this line of my own volition <-- I type
3: ZEX will allow me to continue doing this until
4: it sees the ZCPR2 prompt
5: <-- I type Ctrl-Z
5: *e <-- I type "e"
(ZEX Active)
B1>type demo.txt <-- ZEX resumes
This is a test
I am now typing this line of my own volition
ZEX will allow me to continue doing this until
it sees the ZCPR2 prompt
This is only a test
This is a demo of ZEX Control
B1>era demo.txt
DEMO .TXT
B1>
(ZEX Completed)
By Your Command >
B1>ed demo.mac <-- Now to use ZEX for
<-- program assembly
NEW FILE
: *i <-- I type program
1: ext print
2:
3: call print
4: db 'Hello, World ... It''s Another Day',0
5: ret
6:
7: end
8:
: *e
B1>type a:m80.zex <-- My M80.ZEX command file
; M80.SUB -- MACRO-80 Assembler and Linker
M80 =$1
; Please Type $^C if Error(s) Exist - ^?
ERA $1.BAK
ERA $1.COM
L80 /P:100,$1,A:SYSLIB/S,$1/N,/U,/E
ERA $1.REL
; Assembly Complete
B1>zex m80 demo <-- Run command file on my pgm
ZEX, Version 1.3
(ZEX Active)
B1>; M80.SUB -- MACRO-80 Assembler and Linker
B1>M80 =DEMO
No Fatal errr(s)
(ZEX Active)
B1>; Please Type ^C if Error(s) Exist - <-- I can abort now
<-- if I wish
B1>ERA DEMO.BAK
DEMO .BAK
B1>ERA DEMO.COM
No File
B1>L80 /P:100,DEMO,A:SYSLIB/S,DEMO/N,/U,/E
Link-80 3.44 09-Dec-81 Copyright (c) 1981 Microsoft
Data 0100 01C5 < 197>
35936 Bytes Free
Data 0100 01C5 < 197>
35936 Bytes Free
[0000 01C5 1]
(ZEX Active)
B1>ERA DEMO.REL
DEMO .REL
B1>; Assembly Complete
B1>
(ZEX Completed)
By Your Command>demo <-- I run pgm now
Hello, World ... It's Another Day
B1>
:Restrictions on Command Files
Thσá followinτá restriction≤á arσ applieΣ t∩á commanΣá file≤ ì
processed by SUB2 and ZEX.
SUB2 Restrictions
1«á Yo⌡ ma∙ no⌠ loτ int∩ use≥ area≤ othe≥ thaε thσ onσá yo⌡ ì
begaεá processinτ thσ commanΣ filσ in«á Iµ yo⌡ do¼á ZCPR▓ loose≤ ì
tracδá oµá thσ $$$.SU┬ filσ anΣ executioε i≤á aborteΣá unti∞á yo⌡ ì
reenter the original user area, at which time execution resumes.
2«á U≡á t∩ 2░ parameter≤ arσ permitteΣ oε thσ SUB▓á commanΣ ì
line.
3. You may nest SUB2 command files to any depth.
ZEX Restrictions
1«á Yo⌡á ma∙ movσ int∩ an∙ director∙ yo⌡ desirσ whilσ ß ZE╪ ì
command stream is being executed.
2«á U≡á t∩á ╣ parameter≤ arσ permitteΣ oε thσá ZE╪á commanΣ ì
line.
3. You may NOT nest ZEX command files.
:SUB2 and ZEX as Extended Command Processors Under ZCPR2
BotΦá SUB▓á anΣá ZE╪ makσ nicσ ExtendeΣá CommanΣá Processor≤ ì
unde≥á ZCPR2«á Wσá havσá alread∙á seeεá ho≈á SUB▓á anΣá ZE╪á arσ ì
intimatel∙á linkeΣ witΦ ZCPR2«á BotΦ usσ thσ Externa∞á PatΦá anΣ ì
Multiplσá CommanΣá Linσ Buffe≥ Facilitie≤ oµ ZCPR2¼á anΣá ZE╪á i≤ ì
further prompted for input by the ZCPR2 prompt if desired.
T∩á refresΦ thσ reader¼á anΣ ExtendeΣ CommanΣ Processo≥ i≤ ß ì
prograφ invokeΣ b∙ ZCPR▓ wheε i⌠ fail≤ t∩ finΣ thσ commanΣá alonτ ì
it≤á path«á ZCPR2¼á upoεá failinτá t∩ finΣ thσá CO═á filσá whicΦ ì
correspond≤á t∩á thσ commanΣ namσ giveε t∩ it¼á caε bσ se⌠ u≡á t∩ ì
eithe≥ searcΦ thσ patΦ o≥ g∩ directl∙ t∩ thσ roo⌠ oµ thσ patΦ anΣ ì
looδá fo≥á aεá ExtendeΣá CommanΣá Processor«áá Iµá found¼á ZCPR▓ ì
simulate≤áá ßá commanΣá t∩á tha⌠á ExtendeΣáá CommanΣáá Processor¼ ì
substitutinτ thσ user'≤ commanΣ linσ a≤ thσ argument≤ t∩ it.
To illustrate my point, consider the following example:
╔á havσ ß ZE╪ filσ nameΣ MASM.ZEX¼á anΣ i⌠ perform≤ thσ samσ ì
set of commands that my M80.ZEX file did above, namely:
; MASM.ZEX -- MACRO-80 Assembler and Linker
M80 =$1
; Please Type $^C if Error(s) Exist - ^?
ERA $1.BAK
ERA $1.COM
L80 /P:100,$1,A:SYSLIB/S,$1/N,/U,/E
ERA $1.REL
; Assembly Complete
╔ typσ iε m∙ program¼á nameΣ DEMO.MAC¼ anΣ issuσ thσ commanΣ ì
"MAS═ DEMO"«á WitΦ ZE╪ a≤ m∙ ExtendeΣ CommanΣá Processor¼á ZCPR▓ ì
look≤ alonτ thσ patΦ fo≥ thσ commanΣ MASM¼á fail≤ t∩ finΣ it¼ anΣ ì
theεá simulate≤ thσ commanΣ "ZE╪ MAS═ DEMO"«á Thσ abovσá commanΣ ì
file is then executed with DEMO as its passed parameter!
╔á thinδá tha⌠ thσ abovσ examplσ illustrate≤ thσ utilit∙á oµ ì
employinτ ZE╪ (o≥ SUB2⌐ a≤ aε ExtendeΣ CommanΣá Processor«á Thi≤ ì
i≤ donσ ver∙ simpl∙ iε thσ ZCPR▓ environment« T∩ d∩ this¼ simpl∙ ì
makσ ß cop∙ oµ ZEX.CO═ anΣ namσ i⌠ CMDRUN.COM« Sincσ thi≤ i≤ thσ ì
namσá iε thσ ZCPRHDR.LI┬ filσ anΣ thσ facilit∙ i≤ turneΣ on¼á yo⌡ ì
now have ZEX as the Extended Command Processor.