Microsoft KB Archive/21207

Calculating with COMP-0 Variables in Assembler

PSS ID Number: Q21207 Article last modified on 11-16-1992

2.00 2.10 2.20 3.00 3.00a 4.00 4.50 MS-DOS

Summary: The bytes in a COMP-0 variable are stored in reverse order from that expected by an assembly-language routine. Thus, to calculate from within the assembler routine, the bytes first must be reversed. Accordingly, the bytes must be reversed again before returning the result to the MS COBOL routine. This feature is by design. The assembly routine uses the INTEL 8088/8086 storage order, whereas MS COBOL uses storage methods as defined by the ANSI standard (the two differ by the order of the high- and low-order bytes). For more information, see Pages 100-104 of the “Microsoft COBOL Compiler for MS-DOS: User’s Guide.”

Copyright Microsoft Corporation 1992.