CP/M Transient Commands
CP/M STAT Command
CP/M PIP Command
CP/M ED Command
CP/M ASM Command
CP/M LOAD Command
CP/M DDT Command
CP/M SYSGEN Command
CP/M BDOS -- Basic I/O Operations
CP/M BDOS -- Basic Disk Operations
CP/M File Types
CP/M BIOS Jump Vector
:CP/M Transient Commands

    The CP/M transient commands discussed here are --

         STAԠ     Lis� th� numbe� o�  byte�  o� storag�  and data o� th� �
                   currentl���� logged-i disk���� provid堠 statistica� �
                   informatio� abou� particula� files�� an� displa�� o� �
                   alter device assignment.

         PI�       Loa� th� Periphera� Interchang� Progra� fo� subsequen� �
                   disk file and peripheral transfer operations.

         ED        Load and execute the CP/M text editor program.

         AS͠      Loa� th� CP/� assemble� an�  assembl� th� specifie� �
                   program from disk.

         LOAĠ     Loa�  th� fil� i� Inte� "hex� machin� cod� forma� an� �
                   produc� � fil� i� machin� executabl� for� whic� ca� b� �
                   loade� int� th� TP� (thi� loade� progra� become� � ne� �
                   command under the CCP).

         DDT       Load the CP/M debugger into the TPA and execute it.

         SYSGEN    Create a new CP/M system diskette.

:CP/M STAT Command

    The STAT Command takes any of the following forms --

STA�      Calculat� th� storag� remainin� o� al� activ� drive� an� prin� � �
         message like
              x: R/W, SPACE: nnnK  -- if disk is Read/Write
              x: R/O, SPACE: nnnK  -- if disk is Read Only
STAT x:   Calculate the storage remaining on the specified drive and print
              BYTES REMAINING ON x: nnnK

STAT x:afn [$S]
         Sca� th� specifie� file� o� th� specifie� driv� (x� i� optional)� �
         an� lis� al� file� whic� satisf� th� unambiguou� referenc� i� �
         alphabetica� orde� wit� storag� requirements��  � tabl� lik� th� �
         following is generated --

              Size Recs Bytes Ext Acc
             sssss rrrr  nnnk  ee a/b d:pppppppp.sss

         where
              sssss -- number of virtual 128-byte records in file
                   This field is display if the optional $S is given
              rrrr -- number of 128-byte records in each extent of the file
              nnnK -- number of bytes (in K, K=1024) allocated to the file
              ee -- number of 16K extensions
              a/b -- access mode of file; R/O or R/W
              d:pppppppp.sss -- drive name (d may be A, B, C, D) and file
                        name

STAT x:=R/O
         Se� th� specifie� driv� t� Rea� Only��  Thi� i� cleare� b� � war� �
         boot.  When a disk is Read Only, the message
              BDOS ERR ON x: READ ONLY
         will appear if there is an attempt to write to it.
STAT VAL:
         Summarize the status commands.  STAT VAL: will print the list --

              Temp R/O Disk:  d:=R/O
              Set Indicator:  d:filename.typ $R/O $R/W $SYS $DIR
              Disk Status  :  DSK: d:DSK:
              User Status  :  USR:
              Iobyte Assign:
              CON: = TTY:  CRT:  BAT:  UC1:
              RDR: = TTY:  PTR:  UR1:  UR2:
              PUN: = TTY:  PTP:  UP1:  UP2:
              LST: = TTY:  CRT:  LPT:  UL1:

STAT DEV:
         Displa�� th� curren� logica� t� physica� devic� mapping��  Fo� �
         example, the list may appear as --

              CON: = CRT:         PUN: = PTP:
              RDR: = UR1:         LST: = TTY:

STAT d:afn [$R/O or $R/W or $SYS or $DIR]
         Se� th� variou� permanen� fil� indicators���  R/O=Read/Only� �
         R/W=Read/Write, SYS=System, DIR=Non-System

STAT ld1=pd1, ld2=pd2, ...
         Chang� th� logica� t� physica� devic� assignments��  Logica� �
         devic� ld� i� assigne� t� physica� devic� pd1�� etc��  Th� vali� �
         logical device names are --

              CON:      The system console device
              RDR:      The paper tape reader device
              PUN:      The paper tape punch device
              LST:      The output list device

         The valid physical device names are --

              TTY:      Slow speed output device (teletype)
              CRT:      High speed output device (cathode ray tube)
              BAT�      Batc� processin� (CON� inpu� i� RDR:�� CON� outpu� �
                        is LST:)
              UC1:      User-defined console
              PTR:      Paper tape reader
              PTP:      Paper tape punch
              UR1:      User-defined reader #1
              UR2:      User-defined reader #2
              UP1:      User-defined punch #1
              UP2:      User-defined punch #2
              LPT:      Line printer
              UL1:      User-defined list device #1


STAT d:DSK:
         Lis� th� characteristic� o� th� dis� name� "d:"�� i� "d:� i� no� �
specified, list the characteristics of all active disks.  A sample listing:

              d: Drive Characteristics
          65536: 128 Byte Record Capacity
           8192: Kilobyte Drive Capacity
            128: 32  Byte Directory Entries
              0: Checked  Directory Entries
           1024: Records/ Extent
            128: Records/ Block
             58: Sectors/ Track
              2: Reserved Tracks

STAT USR:
         Lis� th� Use� Numbe� th� use� i� currentl�� i� an� th� Use� �
Number� whic� hav� file� o� th� currentl�� addresse� disk��  �� sampl� �
listing:
              Active User : 0
              Active Files: 0 1 3
:CP/M PIP Command

    PIР (Periphera� Interchang� Program� i� th� CP/͠ transien� whic� �
implement� th� basi� medi� conversio� operation� necessar� t� load�� print� �
punch�� copy�� an� combin� dis� files��  PI� i� initiate� b� on� o� th� �
following forms --

         PIР           Engag�  PIP�� promp� th� use� wit� '*'�� an� rea� �
                        comman� line� directl� fro� th� console�  PI� use� �
                        i� thi� wa� i� exite� b� eithe� typin� a� empt� �
                        comman� lin� (jus� � carriag� return� o� � Ctrl-� �
                        as the first character of the line.
         PIР cmn�      Engag� PIP�� execut�  th� specifie� command�� an� �
                        return to CP/M.

    The form of each command line in PIP is --

         destination = source#1, source#2, source#3, ..., source#n


    The general forms of PIP command lines are --

         x:=y:af�      Cop�� al� file�  satisfyin� af� fro� driv� �� t� �
                        driv� x��  'y� ma� b� omitted�� and�� i� so�� th� �
                        currently logged-in drive is selected.
         x:ufn=y��      Cop�  th� fil� give� b� uf� fro� � t� x��  'x� ma� �
                        b� omitted�� and�� i� so�� th� currentl� logged-i� �
                        drive is selected.
         x:afn=y:af�    Lik� th� above� bu� � and/o� � ma� b� omitted� th� �
                        defaul� driv� i� selecte� fo� th堠 omitte� �
                        drive(s).
         ld=p�         Cop�� fro�  th� specifie� physica� devic� t� th� �
                        specifie� logica� device��  Vali� logica� device� �
                        are --
                             CON:, RDR:, PUN:, LST:
                        Valid physical devices are --
                             TTY:, CRT:, UC1:, PTR:, PTP:, UR1:, UR2:,
                             UP1:, UP2:, LPT:, UL1:


    Additional device names which may be used in PIP commands are --

         NUL:      Send 40 Nulls (ASCII 0) to the device.
         EOF:      Send a CP/M End of File character (ASCII Ctrl-Z).
         INP:      Special PIP input source to be patched (see manual).
         OUT��     Specia� PIР outpu�  destinatio� t� b� patche� (se� �
                   manual).
         PRN��     Sam� a� LST:�� bu�  tab� ar� expande� a� ever�� eight� �
                   characte� position� line� ar� numbered� an� pag� eject� �
                   are inserted every 60 lines with an initial eject.


    Th� use� ca� als� specif� on� o� mor� PIР parameter� enclose� i� �
square brackets separated by zero or more blanks.  These parameters are --

        Bloc� mod�  transfer��  Dat� i� buffere� b� PI� unti� a� ASCI� X-�
         Off character (Ctrl-S) is received from the source device.
    D�  Delet� character�  whic� exten� pas� colum� � i� th� transfe� o� �
         data to the destination from the character source.
    E    Echo all transfer operations to the console.
    F    Filter (remove) form feeds from the file.
    Gn   Get File from User Number n (n in the range 0 - 15)
    �    He� dat� transfer�  Al� dat� i� checke� fo� prope� Inte� he� fil� �
         format.
    I    Ignore ':00' records in the transfer of Intel hex format file.
    L    Translate upper case to lower case alphabetics.
    N    Add line numbers to each line transferred to the destination.
    O    Object file (non-ASCII) transfer.  Ignore End of File.

    Pn   Include page ejects at every n lines.
    Qs^ڠQui� copyin�  fro� th� sourc� devic� o� fil� whe� th� strin� � �
         (terminated by Ctrl-Z) is encountered.
    R    Read system files
    Ss^Z Start copying from the source file when the string s is seen.
    Tn   Expand tabs to every nth column.
    U    Translate lower case to upper case alphabetics.
    V    Verify that data has been copied correctly.
    W    Write over R/O files without console interrogation
    Z    Zero the parity bit on input for each ASCII character.
:CP/M ED Command

    Th� EĠ Progra� i� th� CP/͠ syste� contex� editor�� whic� allow� �
creatio� an� alteratio� o� ASCI� files��  Complet� detail� ar� give� i� th� �
user's manual.

    The following are the error indicators given by ED --

         ?    Unrecognized Command
         >    Memory buffer full
         #    Cannot apply command the number of times specified
         O    Cannot open LIB file in R command


    The following are the control characters recognized by ED --

         ^C        System reboot
         ^E        Physical <CR> <LF> (not entered in command)
         ^H        Character delete (backspace)
         ^I        Logical tab
         ^J        New line (line feed)
         ^L        Logical <CR> <LF> in search and substitute strings
         ^M        New line (carriage return)
         ^U        Line delete
         ^X        Line delete and backspace
         ^Z        String terminator
         Rubout    Character delete
         Break     Discontinue command


    The following are the commands recognized by ED --

         nA        Append lines
         +/- B     Beginning/Bottom of buffer
         +/- nC    Move character positions
         +/- nD    Delete characters
         E         Exit
         nFs^Z     Find string
         H         End edit, close and reopen files
         Is^Z      Insert characters
         nJ        Place strings in juxtaposition
         +/- nK    Kill (delete) lines
         +/- nL    Move down/up lines
         nM        Macro definition
         O         Return to original file
         +/- nP    Move and print pages
         Q         Quit with no file changes
         R         Read library file

         nSs1^Zs2^Z
                   Substitute s2 for s1
         +/- nT    Type lines
         +/- U     Translate lower to upper case if U; none if -U
         +/- V     Engage/disengage line numbers (verify)
         0V        Print memory buffer info (free/total usage)
         nW        Write lines
         nX        Transfer n lines to X$$$$$$$.LIB
         0X        Empty X$$$$$$$.LIB
         nZ        Sleep
         +/- n     Move and type (+/- nLT)
         n:        Move to absolute line (V engaged)
         :n        Process from current line to specified line (V engaged)
:CP/M ASM Command

    Th� AS� Comman� load� an� execute� th� CP/� 808� assembler��  I� i� o� �
the form --

         ASM filename.xyz

where

         filename  ... is the name of the file 'filename.ASM' to assemble
         x         ... designates the disk name which contains the source
         y         ... designates the disk name to contain the hex file
                        (y=Z suppresses generation of the hex file)
         z         ... designates the disk name to contain the print file
                        (y=X lists on CON:, y=Z suppresses listing)

    Refer to the ASM Manual for further details.
:CP/M LOAD Command

    Th� LOA� Comman� read� th� fil� specified� whic� i� assume� t� contai� �
Inte� he� forma� machin� cod� an� produce� � memor� imag� fil� whic� ca� b� �
subsequently executed (converts .HEX to .COM files).  It is of the form --

         LOAD filename

where filename is the name of the file 'filename.HEX'.
:CP/M DDT Command

    Th� DDԠ Progra� allow� dynami� interactiv� testin� an� debuggin� o� �
programs generated in the CP/M environment.  It is invoked by --

         DDT
         DDT filename.HEX
         DDT filename.COM

where 'filename' is the name of the program to be loaded or tested.

    DDT responds to the normal CP/M input line editing characters.


  DDT responds to the following commands --

    As   Perform inline assembly starting at the specified address s.
    D    Display memory from the current address for 16 display lines.
    Ds   Display memory from address s for 16 display lines.
    Ds,f Display memory from address s to address f.
    Fs,f,c
         Fill memory from start address s to final address f with byte c.

    G    Start execution at the current value of the PC.
    Gs   Start execution at the specified address s.
    Gs,�Star� executio�  a� th� specifie� addres� � an� se� � breakpoin� �
         at the address b.
    Gs,b,c
         Same as above with breakpoints at b and c.
    G,b  Start execution at the current value of the PC with breakpoint b.
    G,b,c
         Same as above with breakpoints at b and c.


    If   Insert a file name f into the default FCB.

    L    List 12 lines of disassembled code from the current address.
    Ls   List 12 lines from the specified address s.
    Ls,f List lines of disassembled code from s to f.

    Ms,f,d
         Move the block from address s to f to destination at address d.

    R    Read file in FCB into memory at 100H.
    Rb   Read file in FCB into memory with offset b from 100H.

    Ss   Set (examine and alter) memory starting at address s.


    T    Trace the next instruction.
    Tn   Trace the next n instructions.

    U    Untrace -- like Trace, but intermediate steps are not displayed.

    X    Examine all registers and flags.
    Xr   Examine specified registers or flag, where r may be --
              C    Carry flag
              Z    Zero flag
              M    Minus (sign) flag
              I    Interdigit Carry flag
              A    Accumulator
              B    BC Reg pair
              D    DE Reg pair
              H    HL Reg pair
              S    Stack pointer
              P    PC
:CP/M SYSGEN Command

    Th� SYSGE� transien� comman� allow� generatio� o� a� initialize� dis� �
containing the CP/M Operating System.

    It is invoked by typing

         SYSGEN

    Onc� invoked�� th� use� i� prompte� throug� th� session�  Refe� t� th� �
CP/M Manual for further details.
:CP/M BDOS -- Basic I/O Operations
    Function and Number      Input Parameters    Output Parameters

    System Reset      0      None                None
    Read Console      1      None                ASCII Char in A
    Write Console     2      ASCII Char in E     None
    Read Reader       3      None                ASCII Cha
r in A
    Write Punch       4      ASCII Char in E     None
    Write List        5      ASCII Char in E     None
    Direct Con I/O    6      ASCII Char in E     I/O Status in A if E=0FFH
    Get I/O Status    7      None                I/O Status in A
    Put I/O Status    8      I/O Status in E     None
    Print Buffer      9      Address of string   None
                              terminated by $
                              in DE
    Read Buffer      10      Address of Read     Read Buffer is filled
                              Buffer in DE
    Console Ready    11      None                LSB of A is 1 if char
                                                  ready
*All function numbers are passed in Reg C.

I/O Status Byte --

    Value     Bits 6&7  Bits 4&5  Bits 2&3  Bits 0&1

      00      CON:=TTY: RDR:=TTY: PUN:=TTY: LST:=TTY:
      01           CRT:      PTR:      PTP:      CRT:
      10           BAT:      UR1:      UP1:      LPT:
      11           UC1:      UR2:      UP2:      UL1:

Read Buffer --

    Byte      Function

      1       Maximum Buffer Length
      2       Current Buffer Length (returned value)
    3-n       Data (returned values)


:CP/M BIOS -- Basic Disk Operations

    Function and Number      Input Parameters    Output Parameters

    Return Version # 12      None                Version Info in HL
                                                 H=0 CP/M, H=1 MP/M
                                                 L=00 CP/M 1.x, 2x 2.x
    Init BDOS        13      None                None
    Log-In Disk      14      Value in Reg E      None
                              A=0, B=1, C=2,
                              D=3
    Open File        15      Address of FCB      Byte address of FCB
                              in DE               if found or 0FFH if not
    Close File       16      Address of FCB      Byte address of FCB
                              in DE               if found or 0FFH if not
    Search for File  17      Address of FCB      Byte address of FCB (0-3)
                              in DE               if found or 0FFH if not
    Search for Next  18      Address of FCB      Byte address of next FCB
                              in DE               if found or 0FFH if not
    Delete File      19      Address of FCB      Byte address of FCB (0-3)
                              in DE               if found or 0FFH if not

    Function and Number      Input Parameters    Output Parameters

    Read Next Record 20      Address of FCB      0=successful read
                              in DE              1=read past EOF
                                                 2=reading random data
    Write Next Rec   21      Address of FCB      0=successful write
                              in DE              1=error in extending
                                                 2=end of disk data
                                                 255=no more dir space
    Make File        22      Address of FCB      Byte address of FCB or
                              in DE               255 if no more dir space
    Rename FCB       23      Address of FCB      Byte Address of Dir entry
                              in DE               or 255 if no match
    Return Log Code  24      None                Login vector in HL
    Read Drive No    25      None                Number of logged-in drive
                                                  (A=0, B=1, C=2, D=3)
    Set DMA Address  26      Address of 128      None
                             byte buffer in DE

    Function and Number      Input Parameters    Output Parameters

    Ge�Allo� Vec�   2�      Non�                Allocatio�  Vec� Add� i� �
                                                  HL
    Write Prot Disk  28      None                None
    Get R/O Vect     29      None                HL=R/O Vect Val
    Set File Attrib  30      Ptr to FCB in DE    Dir code in A
    Get Disk Parms   31      None                HL=DPB Address
    Set/Get Usr Code 32      E=0FFH (get)/Code   A=Current code (get)/no
                              (set)               value (set)
    Read Random      33      DE=FCB addr         A=return code
                                                 1=reading unwritten data
                                                 2=(not used)
                                                 3=can't close curr ext
                                                 4=seek to unwritten ext
                                                 5=(not used)
                                                 6=seek past end of disk

    Function and Number      Input Parameters    Output Parameters

    Write Random     34      DE=FCB addr         A=return code
                                                 1=reading unwritten data
                                                 2=(not used)
                                                 3=can't close curr ext
                                                 4=seek to unwritten ext
                                                 5=dir overflow
                                                 6=seek past end of disk
    Compute File Siz 35      DE=FCB addr         Random Rec Field set
                                                  to file size
    Set Random Rec   36      DE=FCB addr         Random Rec Field set


*All function numbers are passed in Reg C

:CP/M File Types
    AIN   ALGOL 60 Intermediate   ALG   ALGOL 60 Source File
    ASM   Assembler Source File   BAK   Backup File
    BAS   BASIC Source File       C     C Source File
    COB   COBOL Source File       COM   "Command" File
    FOR   FORTRAN IV Source File  HEX   Intel "hex" code file
    HLP   HELP File               INT   BASIC Intermediate File
    LST   Listing File            MAC   MACRO-80 Source File
    PAS   PASCAL Source File      PRN   Assembler Listing File
    REL   Relocatable Module      SRC   PASCAL/MT Source File
    SUB   SUBMIT File             SYM   Symbol File
    TC    Tiny-C Source File      TFS   TFS Source File
    TXT   Text File               $$$   Temporary File
:CP/M BIOS Jump Vector

    Th� followin� i� � tabl� representin� th� entr� point� int� th� CP/� �
BIOS of the major routines accessable to the user --


    Routine   Relative Offset     Comment

    BOOT           00H            Cold Start
    WBOOT          03H            Warm Start
    CONST          06H            Console Status
                                   Reg A = 00 if no char ready
                                   Reg A = FF if char ready
    CONIN          09H            Console char in (Reg A)
    CONOUT         0CH            Console char out (Reg C)
    LIST           0FH            List out (Reg C)
    PUNCH          12H            Punch out (Reg C)
    READER         15H            Reader in (Reg A)

    Routine   Relative Offset     Comment

    HOME           18H            Move to track 00
    SELDSK         1BH            Select disk given by Reg C (A=0,B=1,...)
    SETTRˠ        1EȠ           Se� trac� addres� give� b�� Re� �
                                     (0...76)
    SETSEà        21Ƞ           Se� secto� addres� give� b�� Re� �
                                     (1...26)
    SETDMA         24H            Set subsequent DMA address (RP B&C)
    READ           27H            Read track/sector (block)
    WRITE          2AH            Write track/sector (block)
    LISTST         2DH            List Device Status
                                   Reg A = 00 if no char ready
                                   Reg A = FF if char ready
    SECTRAΠ       30�            Translat�  secto� numbe� i� Re� à usin� �
                                   tabl� pointe� t� b� DE� physica� secto� �
                                   number returned in Reg L