1) Initialization Functions
� Col� Boo� Initializatio� (whe� th� syste� i�
firs� turne� on)
o Warm Boot Initialization (performed periodically
after the system is turned on)
2) Character Input/Output Functions
o Console Status (check for availability of a
character at the console)
o Console Input
o Console Output
o List Status (check to see if List Device is
ready to output the next character)
o List (Printer) Output
o Punch Output
o Reader Input
3) Disk Input/Output Functions
o Home Disk (move head to Track 0)
o Select Disk (which disk to use)
o Select Track
o Select Sector
o Select Memory Address to Read Into or Write
From
o Read Block (at selected Track and Sector) into
Memory (at selected Memory Address)
o Write Block (to selected Track and Sector) from
Memory (at selected Memory Address)
o Logical-to-Physical Sector Translation (for
efficiency of disk use)
o Reset Disk System
o Select Disk
o Create File (actually, create a directory entry for
a file)
o Open File (make a file ready for reading or writing)
o Close File (terminate the read/write process)
o Delete File
o Rename File
o Set Memory Address to Read Into or Write From
o Read Next Block from File
o Write Next Block into File
----------------- ROOT -----------------------
| / \ |
ROBERT JEFF LINDA BOSS
| / | \ / | | \ | ||
HARDWORK JA CB JC LA CB LC LD WATCHJ |WATCHL
/ | | WATCHR
GAMES SCHOOL GAMES
Sample ZCPR2 Named Directory Structure
Notes:
ROOT is the base of the system
CB and GAMES under JEFF are the same directories as
CB and GAMES under LINDA
Depending on how the Named Directory files were set
up, it would be possible to readily move from
any directory to any other directory, or the
user could be forced to move along a tree
(i.e., you could go to JEFF directly from SCHOOL
or be forced to follow the path SCHOOL -> LA ->
LINDA -> ROOT -> JEFF in order to get there --
it is up to the person who sets up the Named
Directory system)
Functio� ZCPR� Comman� CC� Command
Display $DIR File Names DIR DU:afn DIR D:afn
Display $SYS File Names DIR DU:afn S No Equivalent
Display All File Names DIR DU:afn A No Equivalent
Erase Specified Files ERA DU:afn ERA D:afn
Erase with Verify ERA DU:afn V No Equivalent
Renam� Fil� RE� DU:ufn=ufn� RE� DU:ufn=ufn2
Rename Over Existing File REN DU:ufn=ufn2 No Equivalent
Print File on Console TYPE DU:ufn P TYPE D:ufn
Without Paging
Print File on Console TYPE DU:ufn No Equivalent
With Paging
Print File on Printer LIST DU:ufn No Equivalent
Save Memory into File SAVE n DU:ufn SAVE n D:ufn
Save Memory into File SAVE n DU:ufn No Equivalent
With Overwrite Warning
Save Memory into File SAVE nH DU:ufn No Equivalent
and Specify Size in Hex
Save Memory into File SAVE n DU:ufn S No Equivalent
and Specify Number of or
Blocks SAVE nH DU:ufn S
Load File Anywhere Into GET adr DU:ufn No Equivalent
Memory
Reexecute Last Transient GO params No Equivalent
Without Reloading It
Call Subroutine Anywhere in JUMP adr No Equivalent
Memory
Change Disk D: D:
Change User U: USER n
Change Disk and User at DU: No Equivalent
Same Time
Program Function Functional Changes
ASM Intel 8080 Assembler No Change
DDT Debugger No Change
DUMP File Dump No Change
ED Character-Oriented Text Editor No Change
LOAD HEX-to-COM File Converter No Change
MOVCP� Reconfigur� CP/� fo� Differen� Wil� Onl� Affec�
Memory Size BDOS -- ZCPR2
Mus� B�
Reassembled
PIP File and Peripheral Transfer No Change
STAT Statistics display, etc No Change
SUBMIT Batch Command Processor No Change
SYSGEN Get/Put System Image on Disk No Change
Standard ZCPR2 Transients
Program Function
CD Log Into Named Directory with Extended Preprocessing
COMPARE Utility to Compare Two Files
CRC Cyclic Redundancy Check Utility
DIFF Utility to List File Differences
DU2 Disk Utility, based on DU
ECHO Utility to Echo Its Command Line
ERASE File Erase Utility
FINDBAD Bad Block Scanner, based on FINDBD
GENINS Utility to Install Itself and Other Utilities
HELP Online Documentation System
LD Load Named Directory Buffer
LU/LRUNZ Command Library Utility and Extended Command Processor
MCHECK Menu File Syntax Checker
MCOPY File Copy Utility which can replace PIP in many cases
MENU Extended Command PreProcessor designed to create menus
MKDIR Create Named Directory File
PATH Define/Display ZCPR2 Paths
PROTECT Utility to Set File Attributes
PWD Print Current Named Directory Environment
RENAME File Rename Utility
STARTUP Initial Command Line Generator
SUB2 Extended SUBMIT Indirect Command File Facility
XDIR Directory Display and Scan Utility
ZEX Memory-Based Indirect Command File Facility and Monitor
Extended I/O Configuration Programs
Program Function
CONFIG TVI-950 CRT Configurator Program
DEVICE Mnemonic-based I/O Redirection Utility
IOLOADER Extended I/O System Loader
TINIT TVI-950 CRT Programmer
B1>ed demo.mac <-- Use ED to create simple program
<-- For this to run, ZCPR2 searched B1, B0,
<-- A1, and A0 for ED.COM, finding it on A0
<-- and ED placed DEMO.MAC on B1
NEW FILE
: *i
1: ext padc ;print A as decimal chars
2: ext print ;print string at return adr
3:
4: mvi b,10 ;set loop counter
5: mvi c,0 ;set display value
6: loop:
7: inr c ;add 1
8: call print
9: db 0dh,0ah,'This is line ',0
10: mov a,c ;get line number
11: call padc ;print as decimal
12: dcr b ;count down
13: jnz loop
14: ret ;return to OS
15:
16: end
17:
: *e
B1>dir <-- Display Local Files
DEMO .BAK | DEMO .MAC
B1>dir a:*.zex <-- Display ZEX Command Files on A1
M80 .ZEX | ASM2 .ZEX | M80-2 .ZEX | MAC .ZEX
B1>type a:m80.zex <-- Look at my M80 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>time;zex m80 demo;time <-- Run Command File with Timing
<-- Data; Note Multiple Commands
TIME Version 1.1 2:03:26 AM on Sunday December 19, 1982
<-- TIME was found on A0
ZEX, Version 1.1 <-- ZEX was found on A0, but then
(ZEX Active)
<-- ZEX searched the path and
<-- found M80.ZEX on A1 and
<-- processed it
B1>; M80.SUB -- MACRO-80 Assembler and Linker
B1>M80 =DEMO
No Fatal error(s)
(ZEX Active)
B1>; Please Type ^C if Error(s) Exist -
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 0210 < 272>
35838 Bytes Free
Data 0100 0210 < 272>
35838 Bytes Free
[0000 0210 2]
(ZEX Active)
B1>ERA DEMO.REL
DEMO .REL
B1>; Assembly Complete
B1>TIME
TIME Version 1.1 2:04:25 AM on Sunday December 19, 1982
B1>
(ZEX Completed)
By Your Command >demo <-- Now I run my program
This is line 1
This is line 2
This is line 3
This is line 4
This is line 5
This is line 6
This is line 7
This is line 8
This is line 9
This is line 10
B1>
B1>;
B1>; When my ZCPR2 system cold boots, it always runs the command
B1>; STARTUP -- notice what STARTUP does:
B1>startup s
STARTUP, Version 1.1
STARTUP Setup Command (?=Help)? ?
Setup Mode Commands are --
A -- Define Address of Multiple Command Buffer
C -- Define STARTUP Multiple Command Line
D -- Display STARTUP Values
S -- Define Size of Multiple Command Buffer
X -- Exit and Optionally Rewrite STARTUP
STARTUP Setup Command (?=Help)? D
**** STARTUP Settings ****
Multiple Command Buffer Address -- FF00H
Size of Multiple Command Buffer -- 200 Bytes
Multiple Command Line --
--->ioloader;ld ld;tinit;echo welcome to zcpr ii
**** STARTUP Settings ****
STARTUP Setup Command (?=Help)? X
Do you wish to update STARTUP (Y/N/<CR>=Y)? N
B1>;
B1>; As the reader can see, it uses the ZCPR2 Multiple Command
B1>; Line Buffer facility to store an initial command line which
B1>; runs the following commands:
B1>; IOLOADER -- loads I/O system
B1>; LD LD -- loads the named directory LD.DIR into the
B1>; memory-based Named Directory Buffer
B1>; TINIT -- programs my TVI 950 CRT terminal (function
B1>; keys, status line, etc)
B1>; ECHO -- prints the message "WELCOME ..." on my CRT
B1>;
�B1>;
B1>; Before proceeding, let's look at my command search path
B1>;
B1>path
PATH Version 2.2
Current Symbolic Path --
$$: --> $0: --> A$: --> A0:
Current Absolute Path --
B1: --> B0: --> A1: --> A0:
Current Named Path --
ASM: --> DEV-ROOT: --> R-ASM: --> ROOT:
B1>
B1>;
B1>; This is the path along which CD, PWD, LD, and many other
B1>; utilities search for the NAMES.DIR file. As I am
B1>; currently set up, I have only one NAMES.DIR file, and
B1>; it is located at A0.
B1>;
B1>
B1>;
B1>; Now let's see what directories are available to us:
B1>;
B1>pwd
PWD, Version 1.0
** Directory Display **
** Named Directory Memory-Based Definitions **
12 Directory Entries Total ( 2 Directories Hidden) --
A --
0: ROOT
B --
0: BROOT 1: ASM 2: BDSC 3: PAS
5: BASIC 7: WS 8: CAT 9: DBASE
C --
0: BACKUP
Strike Any Key to Continue -
** Named Directory Disk-Based Definitions **
20 Directory Entries Total ( 2 Directories Hidden) --
A --
0: ROOT 1: R-ASM 2: R-BDSC 3: R-PAS
5: R-BASIC 7: R-WS 8: R-CAT 9: R-DBASE
B --
0: DEV-ROOT 1: ASM 2: BDSC 3: PAS
4: SCRATCH 5: BASIC 7: WS 8: CAT
9: DBASE
C --
0: BACKUP
** Current Directory **
B 1: ASM
B1>;
B1>; As the reader can see, I have several more directories
B1>; defined in NAMES.DIR than in the memory buffer. I have
B1>; chosen to define only my more frequently used directories
B1>; in the memory buffer.
B1>; Also note that two directories are hidden in each case.
B1>; These are System Directories.
B1>;
B1>; Let's move around a little via CD to show you how it works:
B1>;
B1>cd root
CD, Version 2.1
A>;
A>; Since Root was found in memory, CD ran slightly faster
A>; than if it had to do a NAMES.DIR search:
A>;
A>cd r-asm:
CD, Version 2.2
A1>cd ws:
CD, Version 2.2
B7>cd zcpr
CD, Version 2.2
Access Password?
** Access Granted **
A11>;
A11>; Note that in this last example, I moved into a System
A11>; Directory which was hidden in the previous PWD display.
A11>; Now it is not:
A11>;
A11>pwd
PWD, Version 1.0
** Directory Display **
** Named Directory Memory-Based Definitions **
12 Directory Entries Total ( 0 Directories Hidden) --
A --
0: ROOT 10: SYS 11: ZCPR
B --
0: BROOT 1: ASM 2: BDSC 3: PAS
5: BASIC 7: WS 8: CAT 9: DBASE
C --
0: BACKUP
B4>;
B4>; First, I will set up the Named Directory Environments
B4>; LD will load the Global Directory, LD.DIR
B4>; NAMES.DIR will reside in ROBERT to define the subtree
B4>;
B4>mkdir
MKDIR, Version 1.0
MKDIR Command (? for Help)? ?
MKDIR Command Summary
A -- Set Address of ZCPR2 External Path
D -- Display Currently-Defined Directory Names
F -- Set Name of Directory File
I -- Initialize MKDIR
N -- Create a New Directory Name
Q -- Quit without Changing Program on Disk
R -- Read in Directory File from Disk
S -- Sort Directory by Disk and User Number
W -- Write Directory File to Disk
X -- Exit and Update Program on Disk
MKDIR Command (? for Help)? a
External Path Undefined
New Path Address (Hex)? 40.....
MKDIR Command (? for Help)? f
New Directory File? ld.dir......
MKDIR Command (? for Help)? n
System User Areas start at 10
Disk Letter and User (RETURN=Done or A-P 0-31, like A10)? a0
Directory Name (RETURN = Delete Old Name)? root....
Disk Letter and User (RETURN=Done or A-P 0-31, like A10)?
MKDIR Command (? for Help)? d
Directory File is ld.dir
External Path Address is 40 Hex
Defined Directory Names --
A --
A 0: ROOT
1 Directory Names Displayed
1 Directory Names Defined, Space Left for 63 More Names
Current Directory -- Not Defined by Name
MKDIR Command (? for Help)? w
Writing Directory File ld.dir to Disk ... Done
MKDIR Command (? for Help)? i Verify Initialization (Y/N)? y
All Directory Names Cleared
MKDIR Command (? for Help)? f
New Directory File? names.dir...
MKDIR Command (? for Help)? n
System User Areas start at 10
Disk Letter and User (RETURN=Done or A-P 0-31, like A10)? c7
Directory Name (RETURN = Delete Old Name)? robert..
Disk Letter and User (RETURN=Done or A-P 0-31, like A10)? c8
Directory Name (RETURN = Delete Old Name)? school..
Disk Letter and User (RETURN=Done or A-P 0-31, like A10)? c9
Directory Name (RETURN = Delete Old Name)? games...
Disk Letter and User (RETURN=Done or A-P 0-31, like A10)? c10
Directory Name (RETURN = Delete Old Name)? other...
Disk Letter and User (RETURN=Done or A-P 0-31, like A10)?
MKDIR Command (? for Help)? d
Directory File is names.dir
External Path Address is 40 Hex
Defined Directory Names --
C --
C 7: ROBERT C 8: SCHOOL C 9: GAMES C10: OTHER
4 Directory Names Displayed
4 Directory Names Defined, Space Left for 60 More Names
Current Directory -- Not Defined by Name
MKDIR Command (? for Help)? w
Writing Directory File names.dir to Disk ... Done
MKDIR Command (? for Help)? q Verify Abort (Y/N)? y
B4>;
B4>; We now have the Global and Subtree Directories Defined:
B4>;
B4>dir
LD .DIR | NAMES .DIR
B4>mcopy c7:=names.dir
MCOPY Version 2.2
Copy B 4: NAMES .DIR to C 7:
No Original File NAMES .DIR on Destination
!
Copy Complete, Verify Phase --
Verify Complete
**** MCOPY Complete ****
1 Files Copied
0 Copy Errors
B4>;
B4>; The Subtree Directory is now in its root at C7
B4>;
B4>ld ld
LD Version 1.0
Load Complete
B4>;
B4>; Global Directory is Now Loaded
B4>;
B4>cd robert
CD, Version 2.2
C7>;
C7>; I will now define the new path to be set up when logged
C7>; into ROBERT
C7>;
C7>startup s
STARTUP, Version 1.1
STARTUP Setup Command (?=Help)? C
Current Multiple Command Buffer Contents is --
ioloader;ld ld;tinit;echo welcome to zcpr ii, version 2.0
New Line? path $$ c7 a$ a0
STARTUP Setup Command (?=Help)? X
Do you wish to update STARTUP (Y/N/<CR>=Y)? Y
STARTUP will write file to current disk/user
STARTUP File is STARTUP .COM
Enter New File Name or <CR> if OK: st.com
STARTUP File is ST .COM
Enter New File Name or <CR> if OK:
Writing File ST .COM to Disk ... Done
C7>dir
NAMES .DIR | ST .COM
C7>;
C7>; We now have ST available to define the new environ
C7>;
C7>
C7>;
C7>; I will set up the MENU File for the GAMES directory
C7>;
C7>cd games
CD, Version 2.2
C9>;
C9>; I will create an ST.COM in GAMES to run MENU
C9>;
C9>startup s
STARTUP, Version 1.1
STARTUP Setup Command (?=Help)? C
Current Multiple Command Buffer Contents is --
ioloader;ld ld;tinit;echo welcome to zcpr ii, version 2.0
New Line? menu
STARTUP Setup Command (?=Help)? X
Do you wish to update STARTUP (Y/N/<CR>=Y)? Y
STARTUP will write file to current disk/user
STARTUP File is STARTUP .COM
Enter New File Name or <CR> if OK: st.com
STARTUP File is ST .COM
Enter New File Name or <CR> if OK:
Writing File ST .COM to Disk ... Done
C9>;
C9>; I'll set up a MENU.CPR file to
C9>; illustrate what can be done
C9>;
C9>ed menu.cpr
NEW FILE
: *i
1: -dx
2: #
3: This is a sample Menu -- I set the Global Menu
4: options to display menu and allow exit to ZCPR2
5:
6: Menu Commands --
7: X -- Display Directory (XDIR)
8: Z -- Run Any Command Line
9: Q -- Jump Out to ROBERT
10: #
11: x!xdir "Input Options --
12: z!"Input Command Line --
13: qcd robert
14: ##
15:
: *e
C9>dir
ST .COM | MENU .BAK | MENU .CPR
C9>era *.bak
MENU .BAK
�C9>;
C9>; I will now run MCHECK to perform a syntax check on the
C9>; MENU.CPR file
C9>;
C9>mcheck menu
MCHECK Version 1.0
Line Comment/Error Message
---- ---------------------
1 ** Global Options Detected **
2 ** Menu Number 0
14 ** End of Menu Check **
No Errors Detected
C9>;
C9>; We are now ready for a full demo --
C9>; Let's play like we are Robert, and he has just come up
C9>; (I will start at B4 since the NAMES.DIR defining ROBERT
C9>; is there, but he would start at A0)
C9>;
C9>b4:
B4>dir
LD .DIR | NAMES .DIR
B4>;
B4>; On powerup, STARTUP would run LD LD, among others
B4>;
B4>ld ld
LD Version 1.0
Load Complete
B4>;
B4>; Robert would now log into his directory
B4>;
B4>cd robert
CD, Version 2.2
PATH Version 2.2
Current Symbolic Path --
$$: --> C7: --> A$: --> A0:
Current Absolute Path --
C7: --> C7: --> A7: --> A0:
Current Named Path --
ROBERT: --> ROBERT: --> Noname: --> Noname:
C7>dir
NAMES .DIR | ST .COM
C7>;
C7>; We are now in ROBERT, and can access his world:
C7>;
C7>pwd
PWD, Version 1.0
** Directory Display **
** Named Directory Memory-Based Definitions **
1 Directory Entries Total ( 0 Directories Hidden) --
A --
0: ROOT
Strike Any Key to Continue -
** Named Directory Disk-Based Definitions **
4 Directory Entries Total ( 1 Directories Hidden) --
C --
7: ROBERT 8: SCHOOL 9: GAMES
** Current Directory **
C 7: ROBERT
C7>;
C7>; Like going to SCHOOL --
C7>;
C7>cd school
CD, Version 2.2
C8>dir
No File
C8>;
C8>; Or going into OTHER (which is a System Directory)
C8>;
C8>cd other
CD, Version 2.2
Access Password?
** Access Granted **
C10>dir
No File
C10>;
C10>; Or playing games -- note that by CDing into GAMES, we
C10>; automatically come up in a Menu Environment
C10>;
C10>cd games
CD, Version 2.2
MENU Version 1.1
This is a sample Menu -- I set the Global Menu
options to display menu and allow exit to ZCPR2
Menu Commands --
X -- Display Directory (XDIR)
Z -- Run Any Command Line
Q -- Jump Out to ROBERT
Command (<CR>=Menu Disp, ^C=CP/M) - X
Input Options -- *.dir...................................
�XDIR III, Version 1.3 Vertical Listing by File Type and Name
Disk: C User: 9, File Attributes: Non-System
No files selected
MENU Version 1.1 Strike Any Key -
This is a sample Menu -- I set the Global Menu
options to display menu and allow exit to ZCPR2
Menu Commands --
X -- Display Directory (XDIR)
Z -- Run Any Command Line
Q -- Jump Out to ROBERT
Command (<CR>=Menu Disp, ^C=CP/M) - Z
Input Command Line -- dir.....................................
ST .COM | MENU .CPR
MENU Version 1.1 Strike Any Key -
This is a sample Menu -- I set the Global Menu
options to display menu and allow exit to ZCPR2
Menu Commands --
X -- Display Directory (XDIR)
Z -- Run Any Command Line
Q -- Jump Out to ROBERT
Command (<CR>=Menu Disp, ^C=CP/M) - Q
CD, Version 2.2
PATH Version 2.2
Current Symbolic Path --
$$: --> C7: --> A$: --> A0:
Current Absolute Path --
C7: --> C7: --> A7: --> A0:
Current Named Path --
ROBERT: --> ROBERT: --> Noname: --> Noname:
MENU Version 1.1
Menu Not Found
C7>;
C7>; Note that MENU was still running, but it aborted gracefully
C7>; under the new directory
C7>;
C7>
C7>;
C7>; End of Demo
C7>;
4.1.4 The TYPE and LIST Commands
TYPŠ an� LIS� ar� use� t� displa� file� o� th� consol� an� �
printer�� resp� TYP� page� b� default� stoppin� afte� th� scree� �
is filled. These two commands have three basic forms --
Print File on Console TYPE DU:ufn P
Without Paging
Print File on Console TYPE DU:ufn
With Paging
Print File on Printer LIST DU:ufn
I� th� indicate� fil� alread� exists� SAV� wil� as� th� use� �
if he wishes to erase it with the prompt "ERA ufn?".
4.1.6 The GET Command
GEԠ i� use� t� loa� � fil� anywher� int� memory�� I� �
require� tw� arguments�� � numbe� (assume� t� b� hexadecimal� o� �
th� 256-byt� pag� i� memor� a� whic� t� star� th� loa� an� th� �
name of the file.
Load File Into Memory GET adr DU:ufn
4.1.7 The GO Command
Th
� G� comman� i� use� t� reexecut� th� las� progra� loade� �
into the TPA without having to reload it.
Reexecute Last Transient GO params
Without Reloading It
4.1.8 The JUMP Command
JUM� i� use� t� branc� t� anywher� i� memory� I� take� onl� �
on� argument�� whic� i� th� addres� a� whic� t� jump�� Thi� �
addres� ca� b� t� an� byt� i� memor� (i� i� � ful� 16-bi� �
address), and it is assumed to be a hexadecimal number.
Call Subroutine Anywhere in JUMP adr
Memory
4.1.9 The DU Form for Changing Disk and User
Th� D� for� standin� alon� i� use� t� lo� int� � differen� �
directory. There are three basic forms of this command --
Change Disk D:
Change User U:
Change Disk and User at DU:
Same Time
Program Function Functional Changes
ASM Intel 8080 Assembler No Change
DDT Debugger No Change
DUMP File Dump No Change
ED Character-Oriented Text Editor No Change
LOAD HEX-to-COM File Converter No Change
MOVCP� Reconfigur� CP/� fo� Differen� Wil� Onl� Affec�
Memory Size BDOS -- ZCPR2
Mus� B�
Reassembled
PIP File and Peripheral Transfer No Change
STAT Statistics display, etc No Change
SUBMIT Batch Command Processor No Change
SYSGEN Get/Put System Image on Disk No Change
. Disk Directory Display with Sizing Info
. Can Copy to Any Directory on Any Disk
. Supports Multiple Copy in which a group of
files can be copied to several disks by
simply loading one disk after another
without concerning the user with Warm
Booting the system
. Permits Disks to be changed on it at will
once it is loaded and begins running
. Supports an Inspect Mode
. Optional Verify via CRC's and Rereading
the files from the destination
. Can be run from the command line or from
an internal command processor
. Built-In Help
1. Scan first the memory-based named
directory buffer and then search
along the path and scan the first
disk-based NAMES.DIR file; this
is done to match the name given to
CD
2. Determine if the user number of the
desired directory is in the privil-
eged areas and, if so, ask for and
validate the access password
3. Once access right is determined, temp-
orarily log into the indicated directory
and look for ST.COM; if found, log in
permanently and execute it via the
Multiple Command Line Buffer facility;
if not found, simply log the user in
STARTU� i� mentione� her� because�� whe� rename� t� ST� �
i� provide� a� initia� comman� sequenc� t� b� execute� upo� �
enterin� � particula� directory�� Thi� comman� sequenc� ma�� b� �
used to perform functions like the following:
1. Load New I/O Drivers
2. Load a New Memory-Based Named Dir
3. Establish a New Command Search Path
4. Reprogram the User's Terminal
5. Run the MENU System
DIR - Directory Display
ERA - File Erase
REN - File Rename
TYPE - Print File on Console
LIST - Print File on Printer
SAVE - Save Memory Image on Disk
JUMP - Jump to Anywhere in Memory
GO - Reexecute Last Loaded Transient
Bytes 0 and 1: Address of Next Character in Buffer
Byte 2: Size of Buffer
Byte 3: Dummy used by BDOS Readln Function 10
Bytes 4-n: Buffer Contents, terminated by a binary 0
1� se� th� Addres� o� th� Nex� Cha� t� poin� t� Byt� 4
2) set the buffer size
3) initialize the buffer contents, making sure they are
terminated by a binary 0
FF00: 04 ; Low-Order Address of First Char
FF01: FF ; High-Order Address of First Char
FF02: 80 ; Size of Buffer (80H=128 Bytes)
FF03: xx ; Don't Care
FF04: 0 ; Buffer MUST be terminated by a 0
B1>;
B1>; This is a demo of chaining under ZCPR2
B1>; Note that SYSLIB is used extensively in this
B1>; example, and the reader is invited to refer
B1>; to the SYSLIB User's Guide and SYSLIB User
B1>; and Reference Manual if he really wants to see
B1>; how this program works
B1>;
B1>
B1>;
B1>; First, I have created a program that chains to itself,
B1>; printing its command line each time:
B1>;
B1>type me.mac p
;
; This program demonstrates the program chaining capability
; under ZCPR2.
;
cr equ 0dh ;<CR>
lf equ 0ah ;<LF>
ext cline ;SYSLIB routine to extract cmd line
ext pstr ;SYSLIB routine to print string
ext print ;SYSLIB routine to print ret string
ext bbline ;one of the SYSLIB input line editors
ext cin ;char in via SYSLIB
ext caps ;char caps via SYSLIB
ext cout ;char out via SYSLIB
ext crlf ;new line
;
; Print Banner
;
call print
db cr,lf,'Chaining Demo -- Command Line is: ',0
;
; Extract and Print Command Line
;
lxi h,80h ;pt to command line buffer
call cline ;extract it
call pstr ;print it
;
; Prompt User and Get Single-Char Input from him
;
call print
db cr,lf,'Do you want to chain to ME? ',0
call cin ;get response
call caps
call cout ;echo
call crlf ;new line
cpi 'Y' ;respond to Y only
jnz abort
;
; Set Buffer Ptr and
; Store ME Command into Multiple Command Line Buffer
;
lxi h,0ff00h ;address of multiple command line
; buffer in my ZCPR2 System
lxi d,0ff00h+4 ;address of first char in buffer
mov m,e ;set buffer ptr to first char
inx h
mov m,d ;store low, high address of first char
xchg ;HL pts to first char in buffer
lxi d,command ;store command name
call strput ;save command name
mvi m,' ' ;store <SPACE> after command name
inx h ;pt to char after space
xchg ;DE pts to next char in command line
;
; Prompt User for and Get Command Line
;
call print
db cr,lf,' Command Line? ',0
xra a ;don't capitalize input
call bbline ;get line from user
;
; Store Rest of Command Line into Multiple Command Line Buffer
;
xchg ;DE pts to user input string, HL pts to
;next char in command line
call strput ;save string
mvi m,0 ;store ending zero in command
ret ;return to OS and let it run the command
;
; Abort Program
;
abort:
call print
db cr,lf,'ME done',0
ret
;
; Utility Routine to Copy String pted to by DE to memory pted
; to by HL until end of string (binary 0) is encountered.
;
strput:
ldax d ;get char
ora a ;done?
rz ;return if so
mov m,a ;put it
inx h ;pt to next
inx d
jmp strput ;continue
;
; ME Command
;
command:
db 'me',0 ;name of this command
end
B1>;
B1>; Now to run the program -- all it does is store another
B1>; command into the multiple Command Line Buffer which
B1>; consists of its own name (ME) followed by the text input
B1>; by the user. When ME.COM runs, it prints the command
B1>; line (the user text) and asks the user if he wants to
B1>; do it again.
B1>;
B1>me
Chaining Demo -- Command Line is:
Do you want to chain to ME? Y
Command Line? this is the first run of ME
Chaining Demo -- Command Line is: THIS IS THE FIRST RUN OF ME
Do you want to chain to ME? Y
Command Line? this is another run of me
Chaining Demo -- Command Line is: THIS IS ANOTHER RUN OF ME
Do you want to chain to ME? Y
Command Line? this is the third run
Chaining Demo -- Command Line is: THIS IS THE THIRD RUN
Do you want to chain to ME? Y
Command Line? i'm bored, so let's quit now
Chaining Demo -- Command Line is: I'M BORED, SO LET'S QUIT NOW
Do you want to chain to ME? N
ME done
B1>;
B1>; End of Demo
B1>;
6.0 Paths, Command Processing, and Extended Command Processors
B1>;
B1>; This example illustrates paths under ZCPR2
B1>;
B1>
B1>;
B1>; First, I have this program:
B1>;
B1>type where.mac
ext retud
ext print
ext padc
ext cout
call retud ;get user/disk in C/B
call print
db 'You are logged into Disk ',0
mov a,b ;get disk
adi 'A' ;convert to letter
call cout
call print
db ' and User ',0
mov a,c ;get user
call padc ;print as decimal
ret
end
B1>;
B1>; ... which does this:
B1>;
B1>where
You are logged into Disk B and User 1
B1>
B1>;
B1>; There is currently only one copy of WHERE.COM, and that is
B1>; in B1
B1>;
B1>
B1>;
B1>; My path is:
B1>;
B1>path
PATH Version 2.2
Current Symbolic Path --
$$: --> $0: --> A$: --> A0:
Current Absolute Path --
B1: --> B0: --> A1: --> A0:
Current Named Path --
ASM: --> DEV-ROOT: --> R-ASM: --> ROOT:
B1>2:
B2>;
B2>; I do not cover B1 now, so WHERE.COM will not be found
B2>; when I issue the command:
B2>;
B2>where
WHERE?
B2>;
B2>; Unless, of course, I tell ZCPR2 where to look:
B2>;
B2>1:where
You are logged into Disk B and User 2
B2>;
B2>; OR ... I could change the path to cover B1
B2>;
B2>path $$ $0 a$ a0 b1
PATH Version 2.2
Current Symbolic Path --
$$: --> $0: --> A$: --> A0: --> B1:
Current Absolute Path --
B2: --> B0: --> A2: --> A0: --> B1:
Current Named Path --
BDSC: --> DEV-ROOT: --> R-BDSC: --> ROOT: --> ASM:
B2>;
B2>; Now, WHERE in B1 will ALWAYS be found, because B1 is
B2>; Specifically in the PATH!
B2>;
B2>where
You are logged into Disk B and User 2
B2>;
B2>; ... whereever I go, B1 is in the path, and WHERE.COM in
B2>; B1 will be found:
B2>;
B2>a10:;path
PATH Version 2.2
Current Symbolic Path --
$$: --> $0: --> A$: --> A0: --> B1:
Current Absolute Path --
A10: --> A0: --> A10: --> A0: --> B1:
Current Named Path --
SYS: --> ROOT: --> SYS: --> ROOT: --> ASM:
A10>where
You are logged into Disk A and User 10
A10>b15:
B15>where
You are logged into Disk B and User 15
B15>a0:;where
You are logged into Disk A and User 0
A>b1:
B1>;
B1>; Now, in a normal ZCPR2 working environment, it is nice to store
B1>; commands in one of the user areas you can't log into, and then
B1>; set up the path to go into it:
B1>;
B1>mcopy a16:=where.com
MCOPY Version 2.2
Copy B 1: WHERE .COM to A 16:
No Original File WHERE .COM on Destination
!
Copy Complete, Verify Phase --
Verify Complete
**** MCOPY Complete ****
1 Files Copied
0 Copy Errors
B1>path $$ $0 a$ a0 a16
PATH Version 2.2
Current Symbolic Path --
$$: --> $0: --> A$: --> A0: --> A16:
Current Absolute Path --
B1: --> B0: --> A1: --> A0: --> A16:
Current Named Path --
ASM: --> DEV-ROOT: --> R-ASM: --> ROOT: --> Noname:
B1>era where.com
WHERE .COM
B1>where
You are logged into Disk B and User 1
B1>b5:;where
You are logged into Disk B and User 5
B5>a14:
A14>where
You are logged into Disk A and User 14
A14>;
A14>; See the point? Now, if I take away WHERE.COM from A16,
A14>; it won't be found anymore:
A14>;
A14>era a16:where.com
WHERE .COM
A14>where
WHERE?
A14>b1:
B1>where
WHERE?
B1>;
B1>; End of Demo
B1>;
6.2 Command Processing
Comman� processin� unde� ZCPR�� follow� � ver�� logica� �
sequence of events each time a command is issued:
Th� SUB2�� ZEX�� an� LRUN� program� ar� describe� i� mor� �
detail in the User's Guide.
Th� followin� i� � termina� sessio� illustratin� th� us� o� �
ZEX as an Extended Command Processor:
B1>;
B1>; I will illustrate the use of ZEX as the Extended
B1>; Command Processor. To do this, CMDRUN.COM must be
B1>; created from the file ZEX.COM, and the name of the
B1>; desired command file(s) must be made different from any
B1>; corresponding COM file:
B1>;
B1>a0:
A>pip cmdrun.com=zex.com[r]
A>dir *.com
CMDRUN .COM
A>1:
A1>;
A1>; Since I have M80.ZEX and M80.COM, I want M80.ZEX to be
A1>; unique so that a COM file won't be picked up before the
A1>; ZEX file is run:
A1>;
A1>pip masm.zex=m80.zex
A1>b:
B1>;
B1>; Now to illustrate by creating and assembling a program
B1>;
B1>ed demo.mac
NEW FILE
: *i
1: ext cline
2: ext pstr
3: lxi h,80h ;pt to command line from OS
4: call cline ;get command line
5: call pstr ;print it
6: ret
7:
8: end
9:
: *e
B1>;
B1>; Now to use the MASM.ZEX file as tho it were a COM file.
B1>; In the next command line, "time" is TIME.COM and "masm"
B1>; is MASM.ZEX:
B1>;
B1>time;masm demo;time
TIME Version 1.1 7:18:55 AM on Tuesday December 21, 1982
ZEX, Version 1.1
(ZEX Active)
B1>; M80.SUB -- MACRO-80 Assembler and Linker
B1>M80 =DEMO
No Fatal error(s)
(ZEX Active)
B1>; Please Type ^C if Error(s) Exist -
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 02C4 < 452>
35668 Bytes Free
Data 0100 02C4 < 452>
35668 Bytes Free
[0000 02C4 2]
(ZEX Active)
B1>ERA DEMO.REL
DEMO .REL
B1>; Assembly Complete
B1>TIME
TIME Version 1.1 7:20:02 AM on Tuesday December 21, 1982
B1>
(ZEX Completed)
By Your Command >dir
DEMO .MAC | DEMO .COM
B1>demo this is a test
THIS IS A TEST
B1>;
B1>; End of Demo
B1>;
� Consol� (CON:)� whic� i� a� input/outpu� device
A Printer (LST:), which is an output-only device
A Reader (RDR:), which is usually an input-only device
A Punch (PUN:), which is usually an output-only device
Base of BIOS --> ------------------------------------
(Lower Memory) | Jump for Cold and Warm Boots |
| Console Status Jump to IOBASE+12 |
| Console Input Jump to IOBASE+15 |
| Console Output Jump to IOBASE+18 |
| List Output Jump to IOBASE+21 |
| Punch Output Jump to IOBASE+24 |
| Reader Input Jump to IOBASE+27 |
| Jumps for Disk I/O |
| List Status Jump to IOBASE+30 |
| Jump for Sector Translation |
End of Jump Table ->|----------------------------------|
| Body of BIOS, Containing: |
| Cold and Warm Boot Routines |
| Disk I/O Routines |
| Sector Translation Routine |
IOBASE -> |----------------------------------|
(On Page Boundary, | Jump to Status Routine |
1K Bytes in Size) | Jump to Device Select Routine |
| Jump to Device Name Routine |
| Jump to Package Init Routine |
IOBASE + 12 --> | Jump to Console Status |
IOBASE + 15 --> | Jump to Console Input |
IOBASE + 18 --> | Jump to Console Output |
IOBASE + 21 --> | Jump to List Output |
IOBASE + 24 --> | Jump to Punch Output |
IOBASE + 27 --> | Jump to Reader Input |
IOBASE + 30 --> | Jump to List Status |
IOBASE + 33 --> | Jump to New I/O Routine |
End of Jump Table ->|----------------------------------|
| Body of Redirectable I/O Driver |
| Package Containing the Routines |
| Jumped to Starting at IOBASE |
End of BIOS --> ------------------------------------
No Reader or Punch Devices are available
The LST: Device may be any of the following:
1) the Printing Terminal
2) the CRT
3) a Line Printer
4) a Modem
5) a Link to Another Computer
6) a Disk File
The CON: Device may be any of the following:
1) the Printing Terminal (TTY)
2) the CRT
3) a Modem
4) a Link to Another Computer
5) CRT Input and CRT and Modem Output
6) CRT Input and CRT and Remote Computer Output
7) CRT Input and CRT and Disk File Output
8) TTY Input and TTY and Modem Output
9) TTY Input and TTY and Remote Computer Output
10) TTY Input and TTY and Disk File Output
o Returns the Names of All Physical Devices
o Returns the Names of only the Physical Devices
Associated with a Particular Logical Device
o Allows the User to Assign a Physical Device to a
Logical Device
B7>;
B7>; This is a sample terminal session illustrating the DEVICE2
B7>; Program and how Redirectable I/O can work under ZCPR2
B7>;
B7>device2 //
DEVICE2, Version 1.0
DEVICE is a program which enables the user to
manipulate the extended ZCPR2 redirectable device
drivers. It allows the user to
perform the following
functions:
Display the Names of the Current Devices
Set One or More of the Current Devices
The format of the DEVICE command is:
DEVICE <-- Enter Interac
DEVICE // <-- Ask for Help
DEVICE Command,Command, ... <-- Issue Command
where "command" may take the following forms:
DISPLAY=ALL <-- Display Names of All Devices
DISPLAY=CON <-- Display Names of Consoles
DISPLAY=LST <-- Display Names of Printers
DISPLAY=RDR <-- Display Names of Readers
DISPLAY=PUN <-- Display Names of Punches
CON: Devices --
CRTREM Televideo 950 CRT Input and CRT/Remote Output
CRTMOD Televideo 950 CRT and Modem in Parallel
CRT Televideo 950 CRT
TTY Model 43 Printing Terminal
Current Assignment: CRTMOD Televideo 950 CRT and Modem in Paral
RDR: Devices --
CLOCK DC Hayes Chronograph
CRTMOD CRT or Modem Input with CRT Output
MODEM DC Hayes Smartmodem
REMOTE Remote Computer
Current Assignment: CLOCK DC Hayes Chronograph
Strike Any Key to Continue --
PUN: Devices --
CLOCK DC Hayes Chronograph
CRTREM CRT and Remote Computer Output
MODEM DC Hayes Smartmodem
REMOTE Remote Computer
Current Assignment: CLOCK DC Hayes Chronograph
LST: Devices --
MODEM DC Hayes Smartmodem
REMOTE Remote Computer
CRT Televideo 950 CRT
TTY Model 43 Printing Terminal
Current Assignment: TTY Model 43 Printing Terminal
B7>;
B7>; Interactive Mode allows the user to repeatedly perform
B7>; functions
B7>;
B7>device2
DEVICE2, Version 1.0
DEVICE2 Interactive Command System
Type ? and Strike RETURN for Help
DEVICE2 Command? ?
DEVICE2 Commands are of the form:
Command,Command, ... <-- Issue Commands
where "command" may take the following forms:
DISPLAY=ALL <-- Display Names of All Devices
DISPLAY=CON <-- Display Names of Consoles
DISPLAY=LST <-- Display Names of Printers
DISPLAY=RDR <-- Display Names of Readers
DISPLAY=PUN <-- Display Names of Punches
A command line beginning with a semicolon (;) is a comment.
The X Command Exits DEVICE2.
DEVICE2 Command? ; Note that DEVICE2 commands may be abbreviated
DEVICE2 Command? display=con
CON: Devices --
CRTREM Televideo 950 CRT Input and CRT/Remote Output
CRTMOD Televideo 950 CRT and Modem in Parallel
CRT Televideo 950 CRT
TTY Model 43 Printing Terminal
Current Assignment: CRTMOD Televideo 950 CRT and Modem in Paral
DEVICE2 Command? d=c
CON: Devices --
CRTREM Televideo 950 CRT Input and CRT/Remote Output
CRTMOD Televideo 950 CRT and Modem in Parallel
CRT Televideo 950 CRT
TTY Model 43 Printing Terminal
Current Assignment: CRTMOD Televideo 950 CRT and Modem in Paral
DEVICE2 Command? ; Note that DEVICE2 commands may be stacked
DEVICE2 Command? d=c,display list
CON: Devices --
CRTREM Televideo 950 CRT Input and CRT/Remote Output
CRTMOD Televideo 950 CRT and Modem in Parallel
CRT Televideo 950 CRT
TTY Model 43 Printing Terminal
Current Assignment: CRTMOD Televideo 950 CRT and Modem in Parallel
LST: Devices --
MODEM DC Hayes Smartmodem
REMOTE Remote Computer
CRT Televideo 950 CRT
TTY Model 43 Printing Terminal
Current Assignment: TTY Model 43 Printing Terminal
DEVICE2 Command? ; The Display command is delimited by space or =
DEVICE2 Command? ; The assignments commands are not, however
DEVICE2 Command? d punch
PUN: Devices --
CLOCK DC Hayes Chronograph
CRTREM CRT and Remote Computer Output
MODEM DC Hayes Smartmodem
REMOTE Remote Computer
Current Assignment: CLOCK DC Hayes Chronograph
DEVICE2 Command? pun:=modem
DEVICE2 Command? d p
PUN: Devices --
CLOCK DC Hayes Chronograph
CRTREM CRT and Remote Computer Output
MODEM DC Hayes Smartmodem
REMOTE Remote Computer
Current Assignment: MODEM DC Hayes Smartmodem
DEVICE2 Command? p=crtrem,d p
PUN: Devices --
CLOCK DC Hayes Chronograph
CRTREM CRT and Remote Computer Output
MODEM DC Hayes Smartmodem
REMOTE Remote Computer
Current Assignment: CRTREM CRT and Remote Computer Output
DEVICE2 Command? punch=clock,display punch
PUN: Devices --
CLOCK DC Hayes Chronograph
CRTREM CRT and Remote Computer Output
MODEM DC Hayes Smartmodem
REMOTE Remote Computer
Current Assignment: CLOCK DC Hayes Chronograph
DEVICE2 Command? x
B7>;
B7>; End of Demo
B7>;
�
7.4 Loading Redirectable I/O Drivers at Cold Boot Time
IOLOADER -- Load SYSIO.IO into the Redirectable I/O
Buffer Starting at IOBASE
LD LD -- Load the Named Directory LD.DIR into the
Memory-Based Named Directory Buffer
TINIT -- Program my Televideo 950 CRT with the
Configuration found in STD.CFG
ECHO msg -- Print a Welcome Message to the User