Monitoring the Stack Using Assembly or C (51294)
The information in this article applies to:
- Microsoft FORTRAN Compiler for MS-DOS 4.0
- Microsoft FORTRAN Compiler for MS-DOS 4.1
- Microsoft FORTRAN Compiler for MS-DOS 5.0
- Microsoft FORTRAN Compiler for MS-DOS 5.1
- Microsoft FORTRAN compiler for OS/2 4.0
- Microsoft FORTRAN compiler for OS/2 4.1
- Microsoft FORTRAN compiler for OS/2 5.0
- Microsoft FORTRAN compiler for OS/2 5.1
This article was previously published under Q51294 SUMMARY
If, for any reason, you believe that the stack in a FORTRAN program is
being corrupted, you can monitor the stack segment (SS) register and
stack pointer (SP) register by using either the Microsoft Assembler
package. Since CodeView may use the stack for its own purposes, this allows
a more direct monitoring method.
A function for each package is shown below along with the appropriate
interface statement. Each function returns an integer*4 to FORTRAN.
To extract the hexadecimal values from that integer, use a format
statement something similar to the following example:
write (*,'(1x,A7,1x,4Z,A1,4Z)')
+ 'seg:off',stackloc(),':',ISHC(stackloc(),16)
This write statement produces video output of the following form:
Modification Type: | Major | Last Reviewed: | 12/1/2003 |
---|
Keywords: | KB51294 |
---|
|