System information
Upon entry to a transient program, the CCP leaves the stack pointer set to an eight-level stack
area with the CCP return address pushed onto the stack, leaving seven levels before overflow
occurs. Although this stack is usually not used by a transient program (most transients return to
the CCP through a jump to location 0000H) it is large enough to make CP/M system calls
because the FDOS switches to a local stack at system entry. For example, the assembly-language
program segment below reads characters continuously until an asterisk is encountered, at which
time control returns to the CCP, assuming a standard CP/M system with BOOT = 0000H.
 BDOS  EQU 0005H  ;STANDARD CP/M ENTRY
 CONIN  EQU 1  ;CONSOLE INPUT FUNCTION
 ;
  ORG 0100H   ;BASE OF TPA
 NEXTC:  MVI C,CONIN  ;READ NEXT CHARACTER
  CALL BDOS   ;RETURN CHARACTER IN <A>
  CPI '*'   ;END OF PROCESS ING?
  JNZ NEXTC   ;LOOP IF NOT
  RET  ;RETURN TO CCP
  END
CP/M implements a named file structure on each disk, providing a logical organization that
allows any particular file to contain any number of records from completely emptv to the full
capacity of the drive. Each drive is logically distinct with a disk directory and file data area. The
disk filenames are in three parts: the drive select code, the filename (consisting of one to eight
nonblank characters), and the filetype (consisting of zero to three nonblank characters). The
filetype names the generic category of a particular file, while the filename distinguishes
individual files in each category. The filetypes listed in Table 5-1 name a few generic categories
that have been established, although they are somewhat arbitrary.
5.2 Call Conventions CP/M Operating System Manual
5-6










