General Char Input Via BDOS - BIN Char Input Status Via BDOS - BIST Char Output Via BDOS - BOUT Char Input & Capitalize w/Echo - CAPIN, CAPINE Char Input - CIN, RIN Char Output - COUT, LOUT, POUT, SOUT Char Output with Control Chars - CCOUT, CLOUT, CPOUT, CSOUT Conditional Input - CONDIN New Line Output - CRLF, LCRLF, SCRLF Console Status - CST ------------------------------------------------------------- General This set of routines provides simple I/O capabilities with absolutely no side effects on any registers. Direct BIOS calls are used on all routines except for BIN, BIST, and BOUT, so functions such as ^P (which are implemented by the BDOS) will not work by-and-large. The I/O capabilities provided by these routines include: Character Input from Console and Reader Character Output to Console, Printer, and Punch Character Output to Console, Printer, and Punch with Control-Character Processing Console Input Status Conditional Input New Line (CRLF) Output Capitalized Character Input Switched Output is provided in this set of routines; these are called the S-series of routines, and are complementary to the S-series numeric print routines. The S-series of routines is different from the other series in that the S-series uses an external data byte to determine where the output is to be routed. This byte is referred to as SCTLFL (S Control Flag), and its switching function is illustrated in the following table: ----- SCTLFL ----- Binary Hex Outputs to 00000000B 00H Nothing 00000001B 01H Console 10000000B 80H Printer 10000001B 81H Console and Printer If you do not initialize the SCTLFL variable before using an S-routine, output will go to the console (the default is 01H). An example of code using S-routines is: EXT SCTLFL,SOUT ; SCTLFL flag, SOUT routine ... LD A,81H ; enable printer and console LD (SCTLFL),A ... LD A,'A' ; print character 'A' CALL SOUT ... LD A,80H ; enable printer only LD (SCTLFL),A ... LD A,'a' ; print character 'a' CALL SOUT ... BIN - BDOS Console Char Input Routine ENTER: None EXIT : A = Character input from CON: USES : AF Usage: This routine is used to input a character from the Console with normal BDOS processing (Echo, ^P/^S sensing). BIST - BDOS Character Input Status Routine ENTER: None EXIT : A <> 0, Zero Flag Clear (NZ) if Character ready A = 0, Zero Flag Set (Z) if No Char USES : AF Usage: This routine is used to return the console input status via BDOS Function 11. BOUT - BDOS Character Output Routine ENTER: A = Character to send to Console Display EXIT : None USES : None Usage: This routine is used to output a character to the Console via BDOS Function 2. CAPIN - Capitalized Character Input CAPINE - Capitalized Character Input with Echo ENTER: None EXIT : A = Capitalized Character input from Console USES : AF Usage: These routines wait for an input character from the Console, capitalize it, and return it to your program. CAPIN simply returns the capitalized character, while CAPINE also echoes it to the Console Display. CIN - Input a Character from the Console RIN - Input a Character from the Reader (Auxiliary) Device ENTER: None EXIT : A = Character from Console (CIN) or Reader (RIN) USES : AF Usage: These routines provide character input functions with BIOS-level interfaces avoiding BDOS processing. They are somewhat faster in response than their BDOS counterparts. COUT - Output a Character to the Console COUT7- Output a Character to the Console stripping MSB LOUT - Output a Character to the List Device (Printer) POUT - Output a Character to the Punch (Auxiliary) Device SOUT - Output a Character to the Switched (CON:/LST:) Output ENTER: A = Character to Send to Output Device EXIT : None (COUT7 returns Char in A with MSB clear) USES : AF Usage: These routines are used for direct BIOS-level output within a program. They avoid the BDOS character traps and processing, and are therefore somewhat faster than BDOS routines. COUT7 is identical to COUT except that the High- order bit is stripped from the Output Character before passing it to the driver. CCOUT - Output to Console with Control Char Display CLOUT - Output to List Device with Control Char Display CPOUT - Output to Punch Device with Control Char Display CSOUT - Output to Switched CON:/LST: with Control Char Display ENTER: A = Character to Output EXIT : None USES : Flags Usage: These routines should be used to control printing to devices which may be disturbed by non-printing (control) characters. They function as their primary counterparts for normal printable characters, but treat all ASCII codes less than a space (20H) except for , , , , and in a special manner. These values are output as an Uparrow (^) followed by the corresponding letter generated by adding 40H to the character value (i.e. 1 outputs as "^A", 2 as "^B", etc.). The following values are output directly: CONDIN - Conditional Console Input ENTER: None EXIT : A = Console Character, Zero Clear (NZ) if present A indeterminate, Zero Set (Z) if NO Character USES : AF Usage: This routine is used to test for any waiting character on the Console, and return it. If no character is waiting, the routine returns a flag indicating that no character was returned. CRLF - Send Carriage Return/Line Feed to Console LCRLF - Send Carriage Return/Line Feed to LST: (Printer) SCRLF - Send Carriage Return/Line Feed to Switched Output ENTER: None EXIT : None USES : None Usage: These routines simply send a New Line combination of Carriage Return/Line Feed to the CON: (CRLF), LST: (LCRLF), or switched output (SCRLF). CST - Return Console Status Routine ENTER: None EXIT : A = 0, Zero Flag Set (Z) if Console Data Available A = 1, Zero Clear (NZ) if NO Data Available USES : AF Usage: This routine is used to quickly sample the Console status with a direct BIOS interface.