CodeView Does Not Work with Grouped Code Segments

ID Number: Q40784

1.x 2.x 3.00 3.10 3.11 3.14 | 2.x 3.00 3.10 3.11 3.12 3.50

MS-DOS | OS/2

Summary:

Using the Microsoft Macro Assembler (MASM), it is possible to

associate various segments into a group; DGROUP is an example of this

technique. Grouped data or stack segments do not affect CodeView but

CodeView does not recognize grouped code segments. The program will

run correctly under CodeView but none of the CodeView functions will

be available on the second and subsequent segments in the code group.

The sample code below illustrates this behavior. Once the program

executes into the _TEXTB segment, all CodeView functionality is lost.

You cannot set any breakpoints or single step through the _TEXTB code.

Any attempt to single trace into _TEXTB will result in CodeView

running all the code in _TEXTB as if you had specified a go or a step

over the function call to SayHi.

Sample Code

-----------

; Assembler options needed: /Zi

DOSSEG

_TEXT GROUP _TEXTA, _TEXTB ; Code group _TEXT

_DATA SEGMENT WORD PUBLIC 'DATA'

msg DB "Hello, world.", 13, 10, "$"

_DATA ENDS

_TEXTA SEGMENT WORD PUBLIC 'CODE' ; First code segment - this

ASSUME cs:_TEXT,ds:_DATA ; code may be traced as

start: mov ax, _DATA ; expected.

mov ds, ax

call FAR PTR SayHi

mov ax, 4C00h

int 21h

_TEXTA ENDS

_TEXTB SEGMENT WORD PUBLIC 'CODE' ; You cannot trace through

SayHi PROC ; this code.

mov ah, 9h

mov dx, OFFSET msg

int 21h

ret

SayHi ENDP

_TEXTB ENDS

END start

Additional reference words: 1.0 1.00 1.1 1.10 1.11 2.0 2.00 2.1 2.10

2.2 2.20 2.30 2.30 2.35 3.0 3.00 3.1 3.10 3.11 3.12 3.14 3.5 3.50