>     But I am still not clear as to what value this MAX primitive shall take.
>     PER encoding depends on the subconstraints and how do  I encode the
> following
>     value x using Basic Aligned PER.
>               x INTEGER(0..MAX):2
>
>       If two implementations have two different values of MAX ,then I guess there
> will be
>       interoperability problems.

In this case, MAX means, so to speak, no further restriction in that
direction. MAX is more a concept than a value (see further note at the
end). Thus, 0..MAX says there is a restriction in the negative direction,
but none in the positive direction. To make the point more clear: INTEGER
is the same as INTEGER(MIN..MAX), and I don't need to know the actual value
of MIN or MAX to encode it.

So what does INTEGER(0..MAX) say? Only that the integer is non-negative.
Since we are sure there are no negative integers, the value no longer
needs to be represented in two's complement (i.e., the sign bit is gone).
By way of example,

Regular ::= INTEGER
NonNeg  ::= INTEGER (0..MAX)

r Regular ::= 128  -- encodes as 020080
n NonNeg  ::= 128  -- encodes as 0180

Note: For the case just discussed, we have seen that MAX is more a
concept than a value. But it's not really so simple, since the concept
can indeed take a tangible value. For instance, in the sample below,

SmallRange   ::= INTEGER (1..25)
SmallerRange ::= SmallRange (20..MAX)

SmallerRange is constrained to the values from 20 through 25. MAX remains
a concept, namely, the largest value that SmallRange can represent, but
that largest value has an actual value.

=====================================================================
Conrad Sigona                         Toll Free      : 1-888-OSS-ASN1
OSS Nokalva                           Voice Mail     : 1-732-302-9669 x400
[EMAIL PROTECTED]                        Fax            : 1-419-831-5035
http://www.oss.com                    My direct line : 1-315-845-1773

Reply via email to