Microsoft KB Archive/33731

How to Input/Output Bytes from/to Hardware Ports; COBOL 3.0

PSS ID Number: Q33731 Article last modified on 04-21-1993

3.00 | 3.00 MS-DOS | OS/2

Summary: To send/receive bytes from a hardware port (i.e., the “COM1:” or “COM2:” communications device), COBOL Version 3.0 has four “Subprograms for Special Functions,” written in assembly language, which reside in the run-time routines. The following subprograms send/receive one- and two-byte values to/from the hardware port: CALL X“87” USING port, data-value (receive one-byte) CALL X“96” USING port, data-value (receive two-bytes) CALL X“88” USING port, data-value (send one-byte) CALL X“97” USING port, data-value (send two-bytes) where port is a PIC 9(4) field containing the port from which to input, and data-value is a PIC X field for sending/receiving one byte, or a PIC XX field for sending/receiving two bytes. This information is detailed on Pages 8-7 in the “Microsoft COBOL Compiler Version 3.0: Operating Guide.”

More Information: Micro Focus has supplied the Microsoft COBOL Version 3.0 compiler with several “Subprograms for Special Functions.” These subprograms are not guaranteed to be supported in future releases. They are designed to be used “as is.” Microsoft COBOL Versions 2.2 and earlier do not have these types of subprograms.

Additional reference words: 3.00 Copyright Microsoft Corporation 1993.