FidoNet Echomail Archive

<<< Previous Index Next >>>

From: Frank Adam
To: Adam Fitzpatrick
Date: 1996-12-16 18:07:02
Subject: Auto string-length d

 G'Day Adam,
-=> Quoting Adam Fitzpatrick to Frank Adam <=-
 FA>It still bugs me, there HAS TO BE a table within DOS somewhere !      
 AF> There is. I can't remember how to find the start of the table (it's
 AF> documented in Ralf Brown's interrupt list), but the 16 bytes at
 AF> (q-1):0 (where q is the segment returned by the INT 21h call) are
 AF> called the Memory Control Block. They tell you about the block of
 AF> memory. The byte at q-1:0 is either 'M' or 'Z' (Z indicates it's the
 AF> last block in memory, M means there's another in the chain), the word
Easy, i'll just do a global search for 'M's and got my heapwalk(). ;-)

 AF> at q-1:1 is the segment of the PSP of the program that owns the block,
 AF> q-1:3 is the number of paragraphs (16 byte blocks) in the block (if
 AF> this number is X, the next block (if there is one) has its MCB at
This is vaguely familiar.., but the PSP header surely only has info on 
static variables.(?)  
One should have a fairly good clue about the sizes of those already. :-)   

My problem was/is with dynamicly allocated variables. 
I will look at that MCB again and see if i can make any sense of it.

  L8r Frank (fadam{at}
___ Blue Wave/DOS v2.21

 * Origin: Melbourne PC User Group BBS (3:632/309)
SEEN-BY: 633/267 270
@PATH: 632/309 107 360 50/99 635/728 633/267

<<< Previous Index Next >>>