MarkType	proc	near
	mov	bx,es:[di].tsType.Segm
	mov	di,es:[di].tsType.Offs
	mov	es,es:[bx]
	jmp	@@1
MarkVar	label	near
	mov	bx,es:[di].vsType.Segm
	mov	di,es:[di].vsType.Offs
	mov	es,es:[bx]
_Mark	label	near
@@1:	mov	bx,es
	cmp	bx,d3cb2
	jne	@@4
	cmp	d3cbe,0
	je	@@2
	test	es:[di].tdNext,8000h
	jz	@@4
	and	es:[di].tdNext,7fffh
	jmp	short @@3
@@2:	test	es:[di].tdNext,8000h
	jnz	@@4
	or	es:[di].tdNext,8000h
@@3:	push	es di
	mov	bl,es:[di].tdType
	xor	bh,bh
	shl	bx,1
	call	cs:MarkSwitch[bx]
	pop	di es
@@4:	ret
MarkType	endp

MarkVoid	proc	near
	ret
MarkVoid	endp

MarkArray	proc	near
	push	es di es di
	mov	bx,es:[di].atBase.Segm
	mov	di,es:[di].atBase.Offs
	mov	es,es:[bx]
	call	_Mark
	pop	di es
	mov	bx,es:[di].atBounds.Segm
	mov	di,es:[di].atBounds.Offs
	mov	es,es:[bx]
	call	_Mark
	pop	di es
	ret
MarkArray	endp

MarkRecord	proc	near
	push	es
	push	di
	mov	si,es:[di].rtFirst
	jmp	short @@2
@@1:	push	bx
	mov	bl,es:[si].seName.B0
	xor	bh,bh
	lea	di,[si+size TSymbol+bx]
	pop	bx
	push	es:[di].vsNext
	call	MarkField
	pop	si
@@2:	or	si,si
	jnz	@@1
	pop	di es
	ret
MarkRecord	endp

MarkObject	proc	near
	push	es di
	mov	si,es:[di].rtFirst
	jmp	short @@3
@@1:	push	bx
	mov	bl,es:[si].seName.B0
	xor	bh,bh
	lea	di,[si+size TSymbol+bx]
	pop	bx
	mov	al,es:[si].seType
	and	al,not t_Private
	cmp	al,t_Proc
	je	@@2
	push	es:[di].vsNext
	call	MarkField
	pop	si
	jmp	short @@3
@@2:	mov	si,es:[di].psType.tdNext
@@3:	or	si,si
	jnz	@@1
	pop	di es
	ret
MarkObject	endp

MarkPointer	proc	near
	push	es di
	mov	bx,es:[di].ptBase.Segm
	mov	di,es:[di].ptBase.Offs
	mov	es,es:[bx]
	call	_Mark
	pop	di es
	ret
MarkPointer	endp

MarkField	proc	near
	push	es di
	mov	bx,es:[di].vsType.Segm
	mov	di,es:[di].vsType.Offs
	mov	es,es:[bx]
	call	_Mark
	pop	di es
	ret
MarkField	endp

MarkProc	proc	near
	ret
MarkProc	endp

ChooseType	proc	near
	mov	cl,cs:[bx]
	xor	ch,ch
	inc	bx
	mov	dl,cs:[bx]
	xor	dh,dh
	inc	bx
@@1:	cmp	al,cs:[bx]
	je	@@2
	add	bx,dx
	loop	@@1
	dec	cx
@@2:	ret
ChooseType	endp
