User`s guide

The following example illustrates how a transient program calls a BDOS function.
This program reads characters continuously until it encounters an asterisk. Then it
termmates execution by returning to the system.
bdos equ 0005h ;BDOS entry Point in Page Zero
conin equ 1 ;BDOS console input function
;
org 100h ;Base of Transient Program Area
nextc: mvii c,conin
call bdos ;Return character in A
cpi '*' ;End of Processing?
jnz nextc ;Loop if not
ret ;Terminate Program
end
2.2 BDOS Serial Device I/O
Under CP/M 3, serial device I/O is simply input to and output from simple devices
such as consoles, line printers, and communications devices. These physical devices
can be assigned the logical device names defined below:
CONIN: logical console input device
CONOUT: logical console output device
AUXIN: logical auxiliary input device
AUXOUT: logical auxiliary output device
LST: logical list output device
If your system supports the BIOS DEVTBL function, the CP/M 3 DEVICE utility
can display and change the assignment of logical devices to physical devices. DEVICE
can also display the names and attributes of physical devices supported on your
system. If your system does not support the DEVTBL entry point, then the logical to
physical device assignments are fixed by the BIOS.
In general, BDOS serial I/O functions read and write an individual ASCII charac-
ter, or character string to and from these devices, or test the device's ready status.
For these BDOS functions, a string of characters is defined as zero to N characters
terminated by a delimiter. A block of characters is defined as zero to N characters
where N is specified by a word count field. The maximum value of N in both cases
is limited only by available memory. The following list summarizes BDOS serial
device I/O functions.
2-2
2.1 BDOS Calling Conventions CP/M 3 Programmer's Guide