Standalone Logtool for MPE/iX
NAME x4.0 @ C.0 <- Note compiler added
32 bits for string
header and 32 bits
for string trailer.
STUFF x10.0 @ 4.0
F1 x14.0 @ 4.0
F2 x14.0 @ 1.0
my_record = RECORD
field1 : integer; { 32 bits }
CASE select : boolean OF { 8 bits + 12 bits pad}
true : (true_case : some_other_type); { 32 bits }
false : (false_case : yet_another_type);{ 192 bits (max) }
END; { SIZEOF = 256 bits }
MY_RECORD MAX RECORD SIZE = x20 BYTES
FIELD1 x0.0 @ 4.0
SELECT x4.0 @ 1.0 <- Note: compiler padded
to next word.
TRUE_CASE x8.0 @ 4.0
FALSE_CASE x8.0 @ 18.0
The following would define the above structures:
COMMENT This defines MY_RECORD "
RECORD`ID 1
RECORD`LENGTH 256
RECORD`LABEL "MY_REC"
N`FIELDS 2
FIELD`FORMAT {field1} (32,INT,10)
{select} (8,INT,10,TAG,216)
VAR`LABELS [ 1 ] "field 1 :"
[ 2 ] "select code : "
VALUE`LABELS [ 2 ] (0,"False"; 1, "True" )
COMMENT " This defines the case variant "TRUE"
(SOME_OTHER_TYPE) from the above record
TAG`ID 1 {This tag is to be used with RECORD`ID 1}
RECORD`LENGTH 216 {Must match length given in FIELD`FORMAT}
RECORD`LABEL
VARIANT [ 2 ] (1)
N`FIELDS 3
FIELD`FORMAT {compiler filler} (24,junk)
{some_other_type} (32,INT,10)
(160, junk) {Total # bits must match RECORD`LENGTH}
VAR`LABELS [ 1 ] "True Case"
COMMENT " This defines the case variant "FALSE"
(YET_ANOTHER_TYPE) from the above record "
TAG`ID 1 {This tag is to be used with RECORD`ID 1}
RECORD`LENGTH 216 {Must match length given in FIELD`FORMAT}
RECORD`LABEL
VARIANT [ 2 ] (0) {Use this TAG`ID for RECORD`ID 1, when}
{the second field has a value of zero}
N`FIELDS 4
FIELD`FORMAT (24,junk) (32,INT,10) (96,STRING) (32,INT,16,TAG,32)
VAR`LABELS [ 1 ] "Count :"
[ 2 ] "Name : "
[ 3 ] "Stuff tag : "
COMMENT " This defines the case variant "0" of
(YET_ANOTHER_TYPE) from the above record "
TAG`ID 1 {This tag is to be used with RECORD`ID 1}
RECORD`LENGTH 32 {Must match length given in FIELD`FORMAT}
RECORD`LABEL
VARIANT [ 2 ] (0)
[ 4 ] (0) {Use this TAG`ID when field 3 of}
{previous TAG`ID has a value of zero}
N`FIELDS 1