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 (not entered in command) ^H Character delete (backspace) ^I Logical tab ^J New line (line feed) ^L Logical 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 Char 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