MCB: Memory Control Block

 This structure is used internally by DOS when it allocates memory.

MemBlockRec
  Offset Size Contents
  ▀▀▀▀▀▀ ▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  +0       1  bSignature   'M' (4dH)=valid; 'Z'(5aH)=last block in list
  +1       2  wOwnerID     segment address of PSP of owner (0=owns self)
  +3       2  wSizeParas   allocation size in 16-byte paragraphs
  +5       3  res          (reserved)
  +8       8  szOwnerName  ASCIIZ name of owner (DOS 4.0+)
          16               size of a MemBlockRec
 +10H      ?  abBlockData  allocation starts here and extends for
                           wSizeParas*16 bytes.  Another MemBlockRec will be
                           at that address.

   Notes: ■ Memory blocks always start and end on a paragraph boundary.

          ■ After fn 4bH Exec, a Z block begins at (PSP-1):0 of the new
            process (16 bytes before the PSP).

          ■ sZOwnerName is 7 or fewer bytes, followed by 00H.  When DOS
            loads a program, this field is filled-in with (part of)
            filename of the program.  Subsequent allocations are not
            labeled by name (but the wBlockID is valid, so the owner name
            can be tracked down with a little effort).

            Note: Prior to DOS 4.0, this field contained garbage.

          ■ It can be entertaining to trace the MCBs and figure out how
            much memory is used by TSRs and so forth.  An undocumented way
            to find the first or 'base' MemBlockRec to use DOS Fn 52H.
            See DosVarsRec (aka List Of Lists) for related info.

See Also: Memory Control Functions
          DosVarsRec
          Data Structures
                                    -♦-