Microsoft KB Archive/21288

Calling Assembly from Assembly

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

2.00 2.10 2.20 MS-DOS

Summary:

Question: I have a number of assembly subprograms linked with RUNCOB. Each subprogram works correctly. How can I CALL one Assembly subprogram from another Assembly subprogram?

Response: The linker cannot correctly resolve the address of any but the first, CALLed, Assembly routines. However, it is possible to CALL another Assembly subprogram, via a “Near Call,” if both Assembly subprograms are in the same .OBJ module (by assembling them as one file), or in a library made up of several separate .OBJ modules. Additionally, it is important that each Assembly subprogram has a global entry point. Finally, be sure that you are allocating enough (of your own) stack space to handle multiple levels of CALLs. Both techniques ensure that the routines are in the same segment, as required by MS COBOL.

Additional reference words: 2.00 2.10 2.20 Copyright Microsoft Corporation 1993.