You are here: Tips and Tricks > How Field Values are Stored

How Field Values are Stored

Each FIELD (or GROUP FIELD) statement is compiled into a table that includes a 64-bit space for holding a field value. For any field that has a size of 64 or fewer bits, the field value is stored in this space. Note that, since no intrinsic numeric representation is specified for a value, no sign extension is performed when a value that is narrower than 64 bits is stored. Suppose, for example, that you have a FIELD statement for a 16-bit field defined by the protocol as containing a signed integer in twos complement notation. Then an instance of this field that contains ‐1 would have its value stored as (in hex) 0000FFFF not FFFFFFFF. The way around this is to use the SignExtension method in a RETRIEVE clause.

When a field wider than 64 bits, its value is not extracted. Any method that needs to process the value must read it directly from the raw layer data (the abytLayer array). This is how all the StringOfXxx Format Methods work

Knowledge of how values are stored may help you in understanding certain intricacies of the protocol analyzer. It will give additional insight as to why some format methods (Decimal, Hex, etc.) do not work appropriately for fields greater than 64 bits. Also it should be clear that if a FIELD is decoded more than once, say in a GROUP REPEAT, then each retrieved value for the field overwrites the previous one.