FIX: No Stack Frame From CMACROS.INC cProc FORCEFRAMELast reviewed: September 16, 1997Article ID: Q94943 |
6.00 6.00a 6.00b 6.10 6.10a | 6.00 6.00a 6.00b
MS-DOS | OS/2kbtool kbfixlist kbbuglist The information in this article applies to:
SYMPTOMSWhen an application includes the CMACROS.INC file and specifies the FORCEFRAME option with the cProc macro, the assembler does not generate a stack frame.
CAUSEThe code to determine that the application specifies the FORCEFRAME option was omitted from the cProc macro.
RESOLUTIONTo correct this problem, add the following three lines to CMACROS.INC. Modify version 5.3 to add the following lines before line 876 or modify version 5.31 to add the following lines before line 1518.
ifidn <x>,<FORCEFRAME> ?ff=1 endifAlternately, modify the application source code to remove the cProc macro and in its place specify the PROC directive with the FORCEFRAME argument.
STATUSMicrosoft has confirmed this to be a problem in CMACROS.INC versions 5.3 and 5.31 distributed with MASM versions 6.0, 6.0a, 6.0b, 6.1, and 6.1a. This problem was corrected in the CMACROS.INC distributed with MASM for MS-DOS version 6.11.
MORE INFORMATIONThe corrected CMACROS.INC file is as follows:
ifidn <x>,<ATOMIC> ?nx=1 endif ifidn <x>,<FORCEFRAME> ?ff=1 endif ifidn <x>,<C> ?pcc=0 endifComments in the CMACROS.INC file version 5.31 document the cProc macro as follows:
cProc - define a 'c' procedure cProc is the procedure definition for procedures. format: cProc n,cf,a where: n is the name of the procedure cf controls certain definitions, and may be: NEAR proc is to be a near label FAR proc is to be a far label PUBLIC proc is to be defined as public SMALL call makeframe procedure NODATA don't create prolog code to setup DS ATOMIC don't link stack if not needed NODATA must be specified for ATOMIC FORCEFRAME Force generation of a frame C proc is to be a C procedure PLM proc is to be a PL/M procedure PASCAL proc is to be a PL/M procedure WIN proc is to be a Windows procedure NONWIN proc isn't to be a Windows procedure a is a list of registers that are to be saved whenever the procedure is invoked. makeframe procedure: If small is specified, then the "makeframe procedure" is invoked instead of generating normal prologues/epilogues A call is performed to the makeframe procedure. The call is followed by two bytes. the first byte is the number of locals to allocate for the frame, the second is the number of bytes of parameters. The makeframe procedure will in turn call the cProc routine at the address following the data bytes. When the cProc is finished, it will do a near return to the makeframe procedure to clean up the frame and exit. Note that register parameters and makeframe are incompatible and cannot be used together. The makeframe procedure will save SI, DI, and also DS if a far procedure. These registers will be removed from the autosave list if specified.The following code example demonstrates this problem.
Sample Code; Assemble options needed: none INCLUDE cmacros.inc sBegin code assumes cs, code assumes ds, data cProc my_proc, <FORCEFRAME, PUBLIC>, <> cBegin my_proc ; stack frame prologue code belongs here xor bx, bx cEnd ; stack frame epilogue code belongs here sEnd_text SEGMENT start: call my_proc mov ax, 4C00h int 21h_text ENDS END start
|
Additional reference words: 5.30 6.00 6.00a 6.00b 6.10 6.10a buglist6.00a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |