HP 3000 Manuals

func symlen [ System Debug Reference Manual ] MPE/iX 5.0 Documentation


System Debug Reference Manual

func symlen 

Returns the length of a data structure in bits or bytes.

Syntax 

     symlen (path [units])

Formal Declaration 

     symlen:u32 (path:str [units:u32=$8])

Parameters 

 path            A path specification, as described in chapter 5,
                 "Symbolic Formatting/Symbolic Access."

 units           Specifies the units (that is, bit width) in which the
                 result is given.  1 means bits, 8 means bytes, 32 means
                 words.  The default is bytes.

                 The symbolic length is rounded up to the nearest whole
                 unit.

Examples 

     $nmdebug > symopen gradtyp.demo 

Opens the symbolic data type file gradtyp.demo.  It is assumed that the
Debug variable addr contains the address of a StudentRecord data
structure in virtual memory.  The following code fragment is from this
file:

     CONST     MINGRADES   = 1;     MAXGRADES   = 10;
               MINSTUDENTS = 1;     MAXSTUDENTS = 5;

     TYPE
        GradeRange    = MINGRADES .. MAXGRADES;
        GradesArray   = ARRAY [ GradeRange ] OF integer;
        Class         = ( SENIOR, JUNIOR, SOPHOMORE, FRESHMAN );
        NameStr       = string[8];

        StudentRecord = RECORD
                          Name      : NameStr;
                          Id        : Integer;
                          Year      : Class;
                          NumGrades : GradeRange;
                          Grades    : GradesArray;
                        END;

     $nmdebug > wl SYMLEN("StudentRecord") 
     $40

Returns the size of a complete StudentRecord in bytes.

     $nmdebug > wl SYMLEN("StudentRecord"  1) 
     $200

Returns the size of a complete StudentRecord in bits.

     $nmdebug > wl SYMLEN("StudentRecord.Grades" #32) 
     $a

Returns the size of grades field in a StudentRecord in words.

Limitations, Restrictions 

none



MPE/iX 5.0 Documentation