CP/M Plus (CP/M® Version 3) Operating System Programmer's Guide

 

Appenix A

System Control Block

The System Control Block (SCB) is a CP/M 3 data structure located in the BDOS. CP/M 3 uses this region primarily for communication between the BDOS and the BIOS. However, it is also available for communication between application programs, RSXs, and the BDOS. Note that programs that access the System Control Block are not version independent. They can run only on CP/M 3.

The following list describes the fields of the SCB that are available for access by application programs and RSXs. The location of each field is described as the offset from the start address of the SCB (see BDOS Function 49). The RW/RO column indicates if the SCB field is Read-Write or Read-Only.

Table A-1. SCB Fields and Definitions

Offset RW/RO Definition
00 - 04 RO Reserved for system use.
05 RO BDOS Version Number.
06 - 09 RW Reserved for user use. Use these four bytes for your own flags or data.
0A - 0F RO Reserved for system use.
10 - 11 RW Program Error Return Code. This 2-byte field can be used by a program to pass an error code or value to a chained program. CP/M 3's conditional command facility also uses this field to determine if a program executes successfully. The BDOS Function 108 (Get/Set Program Return Code) is used to get/set this value.
1A RW Console Width. This byte contains the number of columns, characters per line, on your console relative to zero. Most systems default this value to 79. You can set this default value by using the GENCPM or the DEVICE utility. The console width value is used by the banked version of CP/M 3 in BDOS Function 10, CP/M 3's console editing input function. Note that typing a character into the last position of the screen, as specified by the Console Width field, must not cause the terminal to advance to the next line.
1B RO Console Column Position. This byte contains the current console column position.
1C RW Console Page Length. This byte contains the page length, lines per page, of your console. Most systems default this value to 24 lines per page. This default value may be changed by using the GENCPM or the DEVICE utility (see the CP/M Plus (CP/M Version 3) Operating System User's Guide).
1D - 21 RO Reserved for system use.
22 - 2B RW Redirection flags for each of the five logical character devices. If your system's BIOS supports assignment of logical devices to physical devices, you can direct each of the five logical character devices to any combination of up to 12 physical devices. The 16-bit word for each device represents the following:
Each bit represents a physical device where bit 15 corresponds to device zero and bit 4 corresponds to device 11. Bits zero through 3 are reserved for system use. You can redirect the input and output logical devices with the DEVICE command (see CP/M Plus (CP/M Version 3) Operating System User's Guide).
22 - 23 RW CONIN Redirection Flag.
24 - 25 RW CONOUT Redirection Flag.
26 - 27 RW AUXIN Redirection Flag.
28 - 29 RW AUXOUT Redirection Flag.
2A - 2B RW LSTOUT Redirection Flag.
2C RW Page Mode. If this byte is set to zero, some CP/M 3 utilities and CCP built-in commands display one page of data at a time; you display the next page by pressing any key. If this byte is not set to zero, the system displays data on the screen without stopping. To stop and start the display, you can press CTRL-S and CTRL-Q, respectively.
2D RO Reserved for system use.
2E RW Determines if CTRL-H is interpreted as a rub/del character. If this byte is set to 0, then CTRL-H is a backspace character (moves back and deletes). If this byte is set to 0FFH, then CTRL-H is a rub/del character, echoes the deleted character.
2F RW Determines if rub/del is interpreted as CTRL-H character. If this byte is set to 0, then rub/del echoes the deleted character. If this byte is set to OFF, then rub/del is interpreted as a CTRL-H character (moves back and deletes).
30 - 32 RO Reserved for system use.
33 - 34 RW Console Mode. This is a 16-bit system parameter that determines the action of certain BDOS Console I/O functions. (See Section 2.2.1 and BDOS Function 109, Get/Set Console Mode, for a thorough explanation of Console Mode.)
35 - 36 RO Reserved for system use.
37 RW Output delimiter character. The default output delimiter character is $, but you can change this value by using the BDOS Function 110, Get/Set Output Delimiter.
38 RW List Output Flag. If this byte is set to 0, console output is not echoed to the list device. If this byte is set to 1, console output is echoed to the list device.
39 - 3B RO Reserved for system use.
3C - 3D RO Current DMA Address. This address can be set by BDOS Function 26 (Set DMA Address). The CCP initializes this value to 0080H. BDOS Function 13, Reset Disk System, also sets the DMA address to 0080H.
3E RO Current Disk. This byte contains the currently selected default disk number. This value ranges from 0-15 corresponding to drives A-P, respectively. BDOS Function 25, Return Current Disk, can be used to determine the current disk value.
3F - 43 RO Reserved for system use.
44 RO Current User Number. This byte contains the current user number. This value ranges from 0-15. BDOS Function 32, Set/Get User Code, can change or interrogate the currently active user number.
45 - 49 RO Reserved for system use.
4A RW BDOS Multi-Sector Count. This field is set by BDOS Function 44, Set Multi-Sector Count.
4B RW BDOS Error Mode. This field is set by BDOS Function 45, Set BDOS Error Mode. If this byte is set to 0FFH, the system returns to the current program without displaying any error messages. If it is set to 0FEH, the system displays error messages before returning to the current program. Otherwise, the system terminates the program and displays error messages. See description of BDOS Function 45, Set BDOS Error Mode, for discussion of the different error modes.
4C - 4F RW Drive Search Chain. The first byte contains the drive number of the first drive in the chain, the second byte contains the drive number of the second drive in the chain, and so on, for up to four bytes. If less than four drives are to be searched, the next byte is set to 0FFH to signal the end of the search chain. The drive values range from 0-16, where 0 corresponds to the default drive, while 1-16 corresponds to drives A-P, respectively. The drive search chain can be displayed or set by using the SETDEF utility (see CP/M Plus (Version 3) Operating System User's Guide).
50 RW Temporary File Drive. This byte contains the drive number of the temporary file drive. The drive number ranges from 0-16, where 0 corresponds to the default drive, while 1-16 corresponds to drives A-P, respectively.
51 RO Error drive. This byte contains the drive number of the selected drive when the last physical or extended error occurred.
52 - 56 RO Reserved for system use.
57 RO BDOS Flags. Bit 7 applies to banked systems only. If bit 7 is set, then the system displays expanded error messages. The second error line displays the function number and FCB information. (See Section 2.3.13).
Bit 6 applies only to nonbanked systems. If bit 6 is set, it indicates that GENCPM has specified single allocation vectors for the system. Otherwise, double allocation vectors have been defined for the system. Function 98, Free Blocks, returns temporarily allocated blocks to free space only if bit 6 is reset.
58 - 59 RW Date in days in binary since 1 Jan 78.
5A RW Hour in BCD (2-digit Binary Coded Decimal).
5B RW Minutes in BCD.
5C RW Seconds in BCD.
5D - 5E RO Common Memory Base Address. This value is zero for nonbanked systems and nonzero for banked systems.
5F - 63 RO Reserved for system use.

End of Appendix A

Continue in...
Top of this document
Index
Appendix B
Section 0
Main

page URL: www.bigfoot.com/~c128page/cpm3-prg/cpm3prga.htm
contact: c128page@bigfoot.com