home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sd386v50.zip
/
sd386src.zip
/
TYPES.DOC
< prev
next >
Wrap
Text File
|
1996-03-26
|
59KB
|
1,183 lines
Type Records
------------
Record type | SD386 Internal type
-------------------------------------------
| | SD386 |Internal
Start Leaves| MS-16 | MS-32 | IBM | Internal |Designator
--------------------------------------------------------
Type Record | | | | |Trec
Structure | 0x79 | 0x79 | 0x79| 0x79 |T_STRUCT
Bit Fields | 0x5C | 0x5C | 0x5C| 0x5C |T_BITFLD
Type Defs | 0x5D | 0x5D | 0x5D| 0x5D |T_TYPDEF
Pointers | 0x7A | 0x7A | 0x7A| 0x7A |T_PTR
Enums | 0x7B | 0x7B | 0x7B| 0x7B |T_ENUM
Scalars | 0x7B | 0x7B | 0x51| 0x51 |T_SCALAR
Array | 0x78 | 0x78 | 0x78| 0x78 |T_ARRAY
List | 0x7F | 0x7F | 0x7F| 0x7F |T_LIST
Procedure | 0x75 | 0x75 | 0x75| 0x75 |T_PROC <--___these two records are identical in the IBM format.
Function | 0x54 | 0x54 | 0x54| 0x54 |T_FUNC <--
Skip | 0x90 | 0x90 | 0x90| 0x90 |T_SKIP
Null | 0x80 | 0x80 | 0x80| 0x80 |T_NULL
Class | - | - | 0x40| 0x40 |T_CLASS
Member Fcn | - | - | 0x45| 0x45 |T_MEMFNC
Class Member| - | - | 0x46| 0x46 |T_CLSMEM
Notes:
1. Trec is the representation of the first leaf of all type records.
2. In the IBM HL03 format, the rec id was removed from all records.
3. The doc contains the following abbreviations for the various leaves.
T = Trec.
N = 1 byte signed numeric leaf w/o a FID_SPAN prefix.
SN = Signed numeric leaf.
UN = Unsigned numeric leaf.
S = String leaf.
I = Index leaf.
4. In our Internal format, all string leaves will have a 2 byte length.
5. * => variable length name.
@ => variable length leaf.
6. Our Internal format documentation shows FID_x bytes in the leaves;however, they are there for documentation
purposes. We're going to rewrite the code and eliminate these fields.
7. IBM "type qualifier" will be mapped to our internal flags byte in those records that require a "Flags" leaf.
8. The MS format lumps scalars and enums into one scalar record. The
simplified form of the record only includes a primitive type index.
We will map the MS simplified form of the enums to our internal
T_SCALAR and will map the general form to our internal T_ENUM. We
have not seen the MS c compilers actually generate any simplified
forms of the enums;however, PLX which generates MS format records
does. PL/X also generates actual enum records. What we have to do
is distinguish between the actual enums and the "scalar" enums. We
will have to use the record length to distinguish between the two.
1------------------------------------------------------------------------------
Primitive types as taken from the MSC object module format doc.
Types 0-511 are reserved. Types 0-255(high byte = 0) have meaning
according to the decoding of the following bits:
xxxx xxxx x xx xxx xx
xxxx xxxx i md typ sz
i=0 ==> special type don't interpret md,typ,and sz.
i=1 ==> interpret low order 7 bits as follows.
md - Model
00 - Direct
01 - Near pointer
10 - Far pointer
11 - Huge pointer ( !!! We're stealing this one for our 0:16 )
type - base type
000 - signed
001 - unsigned
010 - real
011 -
100 -
101 - void in IBM format.
110 -
111 - void in Microsoft format.
sz - size
00 - 8-bit
01 - 16-bit
10 - 32-bit
11 - void in IBM format.
These are the primitives that we currently use. We may need to define others. Currently, there are definitions in
our $$type.h file that we do not use.
i md typ sz
7 65 432 10
-----------------------------------------------------
TYPE_CHAR 0x80 1 00 000 00 8-bit signed.
TYPE_SHORT 0x81 1 00 000 01 16-bit signed.
TYPE_LONG 0x82 1 00 000 10 32-bit signed.
TYPE_UCHAR 0x84 1 00 001 00 8-bit unsigned.
TYPE_USHORT 0x85 1 00 001 01 16-bit unsigned.
TYPE_ULONG 0x86 1 00 001 10 32-bit unsigned.
TYPE_FLOAT 0x88 1 00 010 00 32-bit real.
TYPE_DOUBLE 0x89 1 00 010 01 64-bit real.
TYPE_LDOUBLE 0x8A 1 00 010 10 80-bit real.
TYPE_VOID 0x97 1 00 101 11 void.
TYPE_PCHAR 0xA0 1 01 000 00 0:32 near ptr to 8-bit signed.
TYPE_PSHORT 0xA1 1 01 000 01 0:32 near ptr to 16-bit signed.
TYPE_PLONG 0xA2 1 01 000 10 0:32 near ptr to 32-bit signed.
TYPE_PUCHAR 0xA4 1 01 001 00 0:32 near ptr to 8-bit unsigned.
TYPE_PUSHORT 0xA5 1 01 001 01 0:32 near ptr to 16-bit unsigned.
TYPE_PULONG 0xA6 1 01 001 10 0:32 near ptr to 32-bit unsigned.
TYPE_PFLOAT 0xA8 1 01 010 00 0:32 near ptr to 32-bit real.
TYPE_PDOUBLE 0xA9 1 01 010 01 0:32 near ptr to 64-bit real.
TYPE_PLDOUBLE 0xAA 1 01 010 10 0:32 near ptr to 80-bit real.
TYPE_PVOID 0xB7 1 01 101 11 0:32 near ptr to void.
TYPE_FPCHAR 0xC0 1 10 000 00 far ptr to 8-bit signed.
TYPE_FPSHORT 0xC1 1 10 000 01 far ptr to 16-bit signed.
TYPE_FPLONG 0xC2 1 10 000 10 far ptr to 32-bit signed.
TYPE_FPUCHAR 0xC4 1 10 001 00 far ptr to 8-bit unsigned.
TYPE_FPUSHORT 0xC5 1 10 001 01 far ptr to 16-bit unsigned.
TYPE_FPULONG 0xC6 1 10 001 10 far ptr to 32-bit unsigned.
TYPE_FPFLOAT 0xC8 1 10 010 00 far ptr to 32-bit real.
TYPE_FPDOUBLE 0xC9 1 10 010 01 far ptr to 64-bit real.
TYPE_FPLDOUBLE 0xCA 1 10 010 10 far ptr to 80-bit real.
TYPE_FPVOID 0xD7 1 10 101 11 far ptr to void.
TYPE_N16PCHAR 0xE0 1 11 011 11 0:16 near ptr to 8-bit signed.
TYPE_N16PSHORT 0xE1 1 11 000 01 0:16 near ptr to 16-bit signed.
TYPE_N16PLONG 0xE2 1 11 000 10 0:16 near ptr to 32-bit signed.
TYPE_N16PUCHAR 0xE4 1 11 001 00 0:16 near ptr to 8-bit unsigned.
TYPE_N16PUSHORT 0xE5 1 11 001 01 0:16 near ptr to 16-bit unsigned.
TYPE_N16PULONG 0xE6 1 11 001 10 0:16 near ptr to 32-bit unsigned.
TYPE_N16PFLOAT 0xE8 1 11 010 00 0:16 near ptr to 32-bit real.
TYPE_N16PDOUBLE 0xE9 1 11 010 01 0:16 near ptr to 64-bit real.
TYPE_N16PLDOUBLE 0xEA 1 11 010 10 0:16 near ptr to 80-bit real.
TYPE_N16PVOID 0xF7 1 11 101 11 0:16 near ptr to void.
1------------------------------------------------------------------------------
Leaf definitions.
----------------
The following prefixes define the leaves:
FID_NIL 0x80
FID_STRING 0x82
FID_INDEX 0x83
FID_SPAN
Numeric Leaves
-----------------------
0x8B - 8 bit unsigned
0x85 - 16 bit unsigned
0x86 - 32 bit unsigned
0x88 - 8 bit signed
0x89 - 16 bit signed
0x8A - 32 bit signed
1
----
-----| |<--- 1 byte numeric value <= 127.
| | | (0x7F)
| ----
|
or if bit 7 of the first byte is set, then
|
| --FID_span byte
| |
| 1 |
| ---- ----
| |0x88| |<--1 byte number signed/unsigned.
| |0x8B| |
| ---- --------
| |0x85| |<--2 byte number signed/unsigned.
-----|0x89| |
---- ----------------
|0x86| |<--4 byte number signed/unsigned.
|0x8A| |
---- ----------------
1------------------------------------------------------------------------------
Structure
---------
Microsoft 16/32 bit.
-------------------
T UN UN I I S N
---------- --------- ---------- ---------- ---------- ---------- ----------
| Trec | Length | Number of| Type | Name | Tag | Packing |
| | in bits | members | List | List | Name | |
---------- --------- ---------- ---------- ---------- ---------- ----------
1 2 1 @ @ 1 2 1 2 1 1 * 1
---- -------- ---- ---- ---- ---- -------- ---- -------- ----- ----- ---------//--- -----
|rec |rec len |type|bit |num |FID |type lst|FID |name lst|FID |name |struct |pck'd|
|id | | |len |mems|indx|index |indx|index |strng|len |tag name | |
|0x01| |0x79| | |0x83| |0x83| |0x82 | | | |
---- -------- ---- ---- ---- ---- -------- ---- -------- ---------------------//--- -----
IBM HL01,HL02.
-------------
1 2 1 1 4 2 1 2 1 2 1 1 *
---- -------- ---- ---- ---------------- -------- ---- -------- ---- -------- ----- ----- ---------/
|rec |rec len |type|type| size of struct |items in|FID |type lst|FID |name lst|FID |name |struct
|id | | |qual| in bytes |struct |indx|index |indx|index |strng|len |tag name
|0x01| |0x79| | | |0x83| |0x83| |0x82 | |
---- -------- ---- ---- ---------------- -------- ---- -------- ---- -------- --------------------//
IBM HL03.
---------
2 1 1 4 2 1 2 1 2 1 1 *
-------- ---- ---- ---------------- -------- ---- -------- ---- -------- ----- ----- ---------/
|rec len |type|type| size of struct |items in|FID |type lst|FID |name lst|FID |name |struct
| | |qual| in bytes |struct |indx|index |indx|index |strng|len |tag name
| |0x79| | | |0x83| |0x83| |0x82 | |
-------- ---- ---- ---------------- -------- ---- -------- ---- -------- --------------------//
SD386 Internal.
--------------
L UN UN I I S
---------- --------- ---------- ---------- ---------- ----------
| Trec | Length | Number of| Type Lst | Name Lst | Tag |
| | in bytes| members | Index | Index | Name |
---------- --------- ---------- ---------- ---------- ----------
2 1 1 4 1 2 1 2 1 2 1 2 *
-------- ---- ---- ---------------- ---- -------- ---- -------- ---- -------- ----- -------- ---------/
|rec len |type|FID | size of struct |FID |num of |FID |type lst|FID |name lst|FID |name |struct
| | |span| in bytes |span|members |indx|index |indx|index |strng|len |tag name
| |0x79|0x86| |0x85| |0x83| |0x83| |0x82 | |
-------- ---- ---- ---------------- ---- -------- ---- -------- ---- -------- -----------------------//
Notes:
1. We will not map the "pck'd" field from the Microsoft format.
The "type qualifier" in HL01 and HL02 only contained "packing" information. It was removed in HL03.
So, the "type qualifier" can be mapped to 0x00.
2. In our internal format, the IBM "type qualifier" will be part of the Trec.
1------------------------------------------------------------------------------
Bit Fields
---------
Microsoft 16/32 bit.
-------------------
T UN UN I
---------- --------- ---------- ----------
| Trec | Bitfield| Bitfield | Bitfield |
| 0x5C | size | base type| offset |
---------- --------- ---------- ----------
1 2 1 1 1 1
---- -------- ---- ---- ---- ----
|rec |rec len |type|size|base|off-|
|id | | | |type|set |<--offset of the bitfield within the base type.
|0x01| |0x5C| | | |
---- -------- ---- ---- ---- ----
| |
numeric leaf of the-- ---- 0x6F - character
size of the bit 0x7C - unsigned
field. Allowed values 0x7D - signed
are 0x00 - 0x20. The Microsoft compilers will allow you to specify a char type for a bitfield;however,
it will get mapped to an int in the debug info.
IBM HL01,HL02.
------------- --FID_span byte
1 2 1 1 1 @ |
---- -------- ---- ---- ---- ---- 1 |
|rec |rec len |type|type|off-|size| ---- ----
|id | | |qual|set | |<---Numeric leaf of the size |0x88| |<--1 byte signed number.
|0x01| |0x5C| | | | | of the bit field in bits. | | | from 0x01 - 0x20.
---- -------- ---- ---- ---- ---- | ---- ----
| |
| | ---------
|<--------------|------------------ 4 3 2 1 0 <-bit
| | ---------
| | x x x x 0 - non-varying
| | x x x x 1 - varying
| | x x x 0 x - unsigned
| | x x x 1 x - signed
| | x x 0 x x - byte alignment
| | x x 1 x x - word alignment
| | x 0 x x x - display as string of 0 and 1
| | x 1 x x x - display as a value
| | 0 x x x x - no descriptor required
IBM HL03. | | 1 x x x x - descriptor required
-------- | |
2 1 1| 1 @ |
-------- ---- ---- ---- ---- |
|rec len |type|type|off-|size| |
| | |qual|set | |<-
| |0x5C| | | |
-------- ---- ---- ---- ----
SD386 Internal.
--------------
T N N N N
---------- --------- --------- ---------- ----------
| Trec | Flags | Bitfield| Bitfield | Bitfield |
| | | offset | size | base type|
---------- --------- --------- ---------- ----------
2 1 1 1 1 1 0x84 - 8 bit.
-------- ---- ---- ---- ---- ---- 0x85 - 16 bit.
|rec len |type|flgs|off-|size |base|<-- 0x86 - 32 bit.
| | | |set | |type|
| |0x5C| | | | |
-------- ---- ---- ---- ----- ----
Note:
1. We will have to map the Microsoft "base type" fields to our internal "base type" records. This will require some
trickery since a base type of 0x7C can be either 16 bits or 32 bits depending on whether the subsection is
Microsoft 16 bit or 32 bit.
1------------------------------------------------------------------------------
TypeDefs/UserDefs
-----------------
Microsoft 16/32 bit.
-------------------
T I S
---------- --------- ----------
| Trec | type | typedef |
| 0x5D | index | name |
---------- --------- ----------
1 2 1 1 2 1 1 *
---- -------- ---- ---- -------- ----- ----- ---------//---
|rec |rec len |type|FID |type |FID |name |typedef |
|id | | |indx|index |strng|len |name |
|0x01| |0x5D|0x83| |0x82 | | |
---- -------- ---- ---- -------- ---------------------//---
IBM HL01,HL02.
-------------
1 2 1 1 1 2 1 1 *
---- -------- ---- ---- ---- -------- ----- ----- ---------//---
|rec |rec len |type|type|FID |type |FID |name |typedef |
|id | | |qual|indx|index |strng|len |name |
|0x01| |0x5D| |0x83| |0x82 | | |
---- -------- --- ---- ---- -------- ----- ---------------//---
IBM HL03.
--------
2 1 1 1 2 1 1 *
-------- ---- ---- ---- -------- ----- ---- ---------//---
|rec len |type|type|FID |type |FID |name|typedef |
| | |qual|indx|index |strng|len |name |
| |0x5D| |0x83| |0x82 | | |
-------- --- ---- ---- -------- ----- --------------//---
SD386 Internal.
--------------
T I S
---------- --------- ----------
| Trec | type | typedef |
| 0x5D | index | name |
---------- --------- ----------
|
|
---This may be a primitive or a complex type number.
2 1 1 2 1 2 *
-------- ---- ---- -------- ----- -------- ---------//---
|rec len |type|FID |type |FID |name |typedef |
| | |indx|index |strng|len |name |
| |0x5D|0x83| |0x82 | | |
-------- --- ---- -------- ----- ------------------//---
Notes:
1. Microsoft compilers do not emit typedef records;however, we use the typedef record to support
the PL/X based variables.
2. All type index fields for IBM or Microsoft may be primitive or complex numbers.
1------------------------------------------------------------------------------
Pointers.
--------
Microsoft 16/32 bit.
-------------------
T N I I
---------- --------- ---------- ----------
| Trec | Model | type | ptr |
| 0x7A | | index | name |
---------- --------- ---------- ----------
------------------------------------------------- NEAR 0x74
1 2 1 1 | 2 1 1 * FAR 0x73
---- -------- ---- ----- ---- -------- ----- ----- ---------//--- HUGE 0x5E
|rec |rec len |type|Model|FID |type |FID |name |pointer |
|id | | | |indx|index |strng|len |name |
|0x01| |0x7A| |0x83| |0x82 | | |
---- -------- ---- ---------- -------- ----- ---------------//---
IBM HL01,HL02.
-------------
1 2 1 1 1 2 1 1 *
---- -------- ---- ----- ---- -------- ----- ----- ---------//---
|rec |rec len |type|type |FID |type |FID |name |pointer |
|id | | |qual |indx|index |strng|len |name |
|0x01| |0x7A| |0x83| |0x82 | | |
---- -------- ---- ---------- -------- ----- ---------------//---
| | |
| |<----optional------------>|
|
------------------------------------------------------------
|
|
IBM HL03. |
-------- |
2 1 1 1 2 1 1 * |
-------- ---- ----- ---- -------- ----- ----- ---------//--- |
|rec len |type|type |FID |type |FID |name |pointer | |
| | |qual |indx|index |strng|len |name | |
| |0x7A| |0x83| |0x82 | | | |
-------- ---- ---------- -------- ----- ---------------//--- |
| | Pointer Model
| | ------------
---------------------------------------------------------------> 2 1 0
| ------------
| x x 0 - 16 bit
| x x 1 - 32 bit
| x 0 x - near
| x 1 x - far
|
SD386 Internal. |
-------------- |
|
T N I S |
---------- --------- ---------- ---------- |
| Trec | Flags | type | ptr | |
| 0x7A | | index | name | |
---------- --------- ---------- ---------- |
|
---------------------------------------------------------
|
2 1 1 | 1 2 1 2 *
-------- ---- ----- ---- -------- ----- -------- ---------//---
|rec len |type|flgs |FID |type |FID |name |pointer |
| | | |indx|index |strng|len |name |
| |0x7A| |0x83| |0x82 | | |
-------- ---- ---------- -------- ----- ------------------//---
Notes:
1. We will have to map the Microsoft "model" leaf to our "type qual" in the Trec leaf.
2. The "Flags" leaf will be a combination of the IBM "type qualifier" and the Microsoft
"Model" leaf.
3. We will map all 0:16 pointers to a primitive type of "Ex." This is actually a huge
pointer, but since we don't support huge pointers, we will steal the type to serve our purpose.
So, when we are mapping Microsoft "type indexes", if we encounter an "Ax" type, then we
need to map it to an "Ex". We will have to perform this test for ALL type index fields, both in
symbols and in types.
1------------------------------------------------------------------------------
Enums.
-----
Microsoft 16/32 bit.
-------------------
T N N S I SN SN
---------- --------- --------- --------- --------- --------- ---------
| Trec | Length | base | name | name lst| lbnd | ubnd |
| | in bits | type | | index | | |
---------- --------- --------- --------- --------- --------- ---------
1 2 1 1 1 1 1 * 1 2 @ @
---- -------- ---- ---- ---- ----- ---- ---------//--- ---- -------- ---- ----
|rec |rec len |type|len |base|FID |name|enum tag name |FID |name lst|lbnd|ubnd|
|id | | | |type|strng|len | |indx|index | | |
|0x01| |0x7B| | |0x82 | | |0x83| | | |
---- -------- ---- ---- ---- ----- --------------//--- ---- -------- ---- ----
| | | |
numeric leaf of the - ---- 0x7C - unsigned numeric leaf of the - - numeric leaf of the
size of the scalar 0x7D - signed minimum value that maximum value that
in bits. This will be: 0x6F - character the scalar is
0x08 - 8 bits
0x10 - 16 bits
0x20 - 32 bits to take.
IBM HL01,HL02. ( The doc shows the name following the data type;however, the dumper shows it like this:)
-------------
1 2 1 1 1 2 1 2 @ @ 1 1 *
---- -------- ---- ----- ---- -------- ---- -------- ---- ---- ----- ---- ---------//---
|rec |rec len |type|type |FID |data |FID |member |lbnd|ubnd|FID |name|enum tag name |
|id | | |qual |indx|type |indx|list | | |strng|len | |
|0x01| |0x7B| |0x83| |0x83|index | | |0x82 | | |
---- -------- ---- ---------- -------- ---- -------- ---- ---- ----- --------------//---
| | |
One of the primitive ------- numeric leaf of the - - numeric leaf of the -
data types. minimum value that maximum value that
the scalar is allowed the scalar is allowed
to take. to take.
IBM HL03.
--------
2 1 1 1 2 1 2 @ @ 1 1 *
-------- ---- ----- ---- -------- ---- -------- ---- ---- ----- ---- ---------//---
|rec len |type|type |FID |data |FID |member |lbnd|ubnd|FID |name|enum tag name |
| | |qual |indx|type |indx|list | | |strng|len | |
| |0x7B| |0x83| |0x83|index | | |0x82 | | |
-------- ---- ---------- -------- ---- -------- ---- ---- ----- --------------//---
| | |
One of the primitive ------- numeric leaf of the - - numeric leaf of the -
data types. minimum value that maximum value that
the scalar is allowed the scalar is allowed
to take. to take.
SD386 Internal.
---------------
T I I SN SN S
---------- --------- --------- --------- --------- ---------
| Trec | Data | Name Lst| Lower | Upper | Tag |
| | type | index | bound | bound | name |
---------- --------- --------- --------- --------- ---------
2 1 1 2 1 2 1 4 1 4 1 2 *
-------- ---- ---- -------- ---- -------- ---- ---------------- ---- ---------------- ----- ------- ---------//---
|rec len |type|FID |data |FID |name |FID |lbnd |FID |ubnd |FID |name |enum tag name |
| | |indx|type |indx|list |span| |span| |strng|len | |
| |0x7B|0x83| |0x83|index |0x86| |0x86| |0x82 | | |
-------- ---- ---- -------- ---- -------- ---- ---------------- ---- ---------------- ----- -----------------//---
| | |
One of the primitive ---- numeric leaf of the- --- numeric leaf of the
data types. minimum value that maximum value that
the scalar is allowed the scalar is allowed
to take. to take.
Notes:
1. We will map the Microsoft "base type" field to "data type" by converting the Microsoft designators
to primitive types.
2. The IBM format supports a Scalar( 0x51 ) type in addition an enum type. The IBM enum type is
the same as the Microsoft Scalar record. We do not support the IBM Scalar type.
1------------------------------------------------------------------------------
Scalars ( simplified form of the enum record.)
-------
Microsoft 16/32 bit.
-------------------
T N N
---------- --------- ---------
| Trec | Length | base |
| | in bits | type |
---------- --------- ---------
1 2 1 1 1
---- -------- ---- ---- ----
|rec |rec len |type|len |base|
|id | | | |type|
|0x01| |0x7B| | |
---- -------- ---- ---- ----
| |
numeric leaf of the - ---- 0x7C - unsigned
size of the scalar 0x7D - signed
in bits. This should 0x6F - character
always be 0x10 for 16
bit and 0x20 for 32 bit.
IBM HL01,HL02.
------------- ---------
----------------------------------------------------------------------3 2 1 0
| --------
| x x x 0 - unpacked
1 2 1 1 | 1 2 1 1 1 x x x 1 - packed
---- -------- ---- ----- ---- -------- ---- -------- ----- x x 0 x - real
|rec |rec len |type|type |FID |data |FID |precis- |scale| x x 1 x - complex
|id | | |qual |indx|type |prec|ion |factr| x 0 x x - fixed
|0x01| |0x51| |0x83| |0x8C| | | x 1 x x - float
---- -------- ---- ---------- -------- ---- -------- ----- 0 x x x - binary
| |<----ignore these->| 1 x x x - decimal
One of the primitive ------- fields. Do
data types. not map.
IBM HL03.
--------
----------------------------------------------------------------------3 2 1 0
| --------
| x x x 0 - unpacked
2 1 1 | 1 2 1 1 1 x x x 1 - packed
-------- ---- ----- ---- -------- ---- -------- ----- x x 0 x - real
|rec len |type|type |FID |data |FID |precis- |scale| x x 1 x - complex
| | |qual |indx|type |prec|ion |factr| x 0 x x - fixed
| |0x51| |0x83| |0x8C| | | x 1 x x - float
-------- ---- ---------- -------- ---- -------- ----- 0 x x x - binary
| |<----ignore these->| 1 x x x - decimal
One of the primitive ------- fields. Do
data types. not map.
SD386 Internal.
---------------
T I
---------- ---------
| Trec | Data |
| | type |
---------- ---------
2 1 1 2
-------- ---- ---- --------
|rec len |type|FID |data |
| | |indx|type |
| |0x51|0x83| |
-------- ---- ---- --------
|
One of the primitive ----
data types.
Notes:
1. We will map the Microsoft 0x7B simplified scalar to our internal 0x51 scalar.
1------------------------------------------------------------------------------
Arrays.
------
Microsoft 16/32 bit.
-------------------
T UN I I S
---------- --------- --------- --------- ---------
| Trec | Size in | Element | Indexing| Array |<-- These last two fields are optional and probably
| 0x78 | bits | Type | Method | Name | won't be there.
---------- --------- --------- --------- ---------
1 2 1 @ 1 2 1 2 1 1 *
---- -------- ---- ---- ---- -------- ---- -------- ---- ----- ---------//---
|rec |rec len |type|len |FID |element |FID |indexing|FID |name |name |
|id | | | |indx|type |indx|method |indx|len | |
|0x01| |0x78| |0x83| |0x83| |0x82| | |
---- -------- ---- ---- ---- -------- ---- -------- ---- ----- ---------//---
| | optional.
| | |<------------------------------------->|
numeric leaf of the - |
size of the array | We do not use these in ( or see them in a dump of )
in bits. | the Microsoft format.
|
---This is a primitive type or an index of a complex type.
IBM HL01,HL02.
-------------
1 2 1 1 4 1 2 1 2 1 1 *
---- -------- ---- ---- -------------------- ---- -------- ---- -------- ---- ----- ---------//---
|rec |rec len |type|type|array size in bytes |FID |bounds |FID |elem |FID |name |array name |
|id | | |qual| |indx|index |indx|type |indx|len | |
|0x01| |0x78| | |0x83| |0x83| |0x82| | |
---- -------- ---- ---- -------------------- ---- -------- ---- -------- ---- ----- ---------//---
| | | |
| | | ---This is a primitive type or an index of a complex type.
| | |
| | --This is the type index for a record that
| | contains the array bounds.
| |
| --- note that this number is not a numeric leaf
| and it should be.
|
----- |
2 1 0 <-bit ----------
-----
x x 0 - row major
x x 1 - column major
x 0 x - unpacked
x 1 x - packed
0 x x - no descriptor required
1 x x - descriptor provided
IBM HL03.
--------
2 1 1 4 1 2 1 2 1 1 *
-------- ---- ---- -------------------- ---- -------- ---- -------- ---- ----- ---------//---
|rec len |type|type|array size in bytes |FID |bounds |FID |elem |FID |name |array name |
| | |qual| |indx|index |indx|type |indx|len | |
| |0x78| | |0x83| |0x83| |0x82| | |
-------- ---- ---- -------------------- ---- -------- ---- -------- ---- ----- ---------//---
| | | |
| | | ---This is a primitive type or an index of a complex type.
| | |
| | --This is the type index for a record that
| | contains the array bounds.
| |
| --- note that this number is not a numeric leaf
| and it should be.
|
----- |
2 1 0 <-bit ----------
-----
x x 0 - row major
x x 1 - column major
x 0 x - unpacked
x 1 x - packed
0 x x - no descriptor required
1 x x - descriptor provided
1------------------------------------------------------------------------------
SD386 Internal.
---------------
T N SN I I S
---------- --------- --------- ------------ --------- ---------
| Trec | Flags | Size in | Bounds | Element | Array |
| 0x78 | | Bytes | Type Index | Type | Name |
---------- --------- --------- ------------ --------- ---------
2 1 1 1 4 1 2 1 2 1 2 *
-------- ---- ---- ---- -------------------- ---- -------- ---- -------- ---- -------- ---------//---
|rec len |type|flgs|FID |array size in bytes |FID |bounds |FID |elem |FID |name |array name |
| | | |indx| |indx|typ indx|indx|type |indx|len | |
| |0x78| |0x8A| |0x83| |0x83| |0x82| | |
-------- ---- ---- ---- -------------------- ---- -------- ---- -------- ---- -------- ---------//---
Notes:
1. Set the bounds index = 0;
2. In the Microsoft records, the indexing method leaf and the name leaf are optional.
3. We assume that the "indexing method" specified in the Microsoft format is always "int" so
we will ignore this field.
4. In the IBM records, there will be a name leaf;however, it will have a zero length.
5. Example Microsoft dump:
523) Array : Bytes:40 Type:515
7885 4001 8303 02
6. Example IBM dump:
515) Array : RowMjr Unpacked No-Desc-Req Bytes:80 Bounds:0 Type:LONG
Name:**NoName**
7800 5000 0000 8300 0083 8200 8200
1------------------------------------------------------------------------------
Lists.
------
Microsoft 16/32 bit.
-------------------
Type List
T I I
---------- --------- --------- ----/...
| Trec | Type | Type |
| 0x7F | Index | Index |
---------- --------- --------- ----/...
1 2 1 1 2 1 2
---- -------- ---- ---- -------- ---- -------- ----/...
|rec |rec len |type|FID |type |FID |type |
|id | | |indx| |indx| |
|0x01| |0x7F|0x83| |0x83| |
---- -------- ---- ---- -------- ---- -------- ----/...
Name List
T S SN
---------- --------- --------- ----/...
| Trec | Name | Offset |
| 0x7F | | |
---------- --------- --------- ----/...
1 2 1 1 1 * @ 1 1 * @
---- -------- ---- ---- ----- ---------//--- ------ ---- ----- ---------//--- ------ ----/...
|rec |rec len |type|FID |name |member name |offset|FID |name |member name |offset|
|id | | |indx|len | | |indx|len | | |
|0x01| |0x7F|0x82| | | |0x82| | | |
---- -------- ---- ---- ----- ---------//--- ------ ---- ----- ---------//--- ------ ----/...
IBM HL01,HL02.
-------------
Type List
1 2 1 1 1 2 1 2
---- -------- ---- ---- ---- -------- ---- -------- ----/...
|rec |rec len |type|type|FID |type |FID |type |
|id | | |qual|indx| |indx| |
|0x01| |0x7F| |0x83| |0x83| |
---- -------- ---- ---- ---- -------- ---- -------- ----/...
|
| -----
|<----------------------------------------------- 2 1 0 <-bit
| -----
| 0 0 0 - not used
| 0 0 1 - type list
| 0 1 0 - name list
| 0 1 1 - enumerated list
| 1 0 0 - proc list
|
Name List |
1 2 1 1 1 1 * @ 1 1 * @
---- -------- ---- ---- ---- ----- ---------//--- ------ ---- ----- ---------//--- ------ ----/...
|rec |rec len |type|type|FID |name |member name |byte |FID |name |member name |byte |
|id | | |qual|indx|len | |offset|indx|len | |offset|
|0x01| |0x7F| |0x82| | | |0x82| | | |
---- -------- ---- ---- ---- ----- ---------//--- ------ ---- ----- ---------//--- ------ ----/...
|
--numeric leaf with the offset of the
member relative to the beginning
of the structure.
IBM HL03.
-------- -- see flags for HL01/HL02
|
Type List |
2 1 1 | 1 2 1 2
-------- ---- ---- ---- -------- ---- -------- ----/...
|rec len |type|type|FID |type |FID |type |
| | |qual|indx| |indx| |
| |0x7F| |0x83| |0x83| |
-------- ---- ---- ---- -------- ---- -------- ----/...
Name List
2 1 1 1 1 * @ 1 1 * @
-------- ---- ---- ----- ----- ---------//--- ------ ----- ----- ---------//--- ------ ----/...
|rec len |type|type|FID |name |member name |byte |FID |name |member name |byte |
| | |qual|strng|len | |offset|strng|len | |offset|
| |0x7F| |0x82 | | | |0x82 | | | |
-------- ---- ---- ----- ----- ---------//--- ------ ----- ----- ---------//--- ------ ----/...
|
--numeric leaf with the offset of the
member relative to the beginning
of the structure.
SD386 Internal.
---------------
Type List
T 1 I I
---------- ------ --------- --------- ----/...
| Trec |Flags | Type | Type |
| 0x7F | | Index | Index |
---------- ------ --------- --------- ----/...
2 1 1 1 2 1 2
-------- ---- ---- ---- -------- ---- -------- ----/...
|rec len |type|flgs|FID |type |FID |type |
| | | |indx| |indx| |
| |0x7F| |0x83| |0x83| |
-------- ---- ---- ---- -------- ---- -------- ----/...
|
| -----
---------------------------------------------- 2 1 0 <-bit
Name List | -----
| 0 0 0 - not used
T 1 S UN | 0 0 1 - type list
---------- ------ --------- --------- ----/... | 0 1 0 - name list
| Trec |Flags | Name | Byte | | 0 1 1 - enumerated list
| 0x7F | | | Offset | | 1 0 0 - proc list
---------- ------ --------- --------- ----/... |
|
-----------------------------------------
|
2 1 1 | 1 2 * 1 4 1 2 * 1 4
-------- ---- ---- ---- -------- ---------//--- ----------- ---- --------- ---------//--- ----------- ----/...
|rec len |type|flgs|FID |name |member name |FID |byte |FID |name |member name |FID |byte |
| | | |indx|len | |span|offset|indx|len | |span|offset|
| |0x7F| |0x82| | | | |0x82| | | | |
-------- ---- ---- ---- -------- ---------//--- ---- ------ ---- --------- ---------//--- ---- ------ ----/...
|
--numeric leaf with the offset of the
member relative to the beginning
of the structure.
1------------------------------------------------------------------------------
Procedures/Functions.
---------------------
Microsoft 16/32 bit.
-------------------
T I N N I
---------- --------- --------- --------- --------- ----------
| Trec | Null | Return | Calling | Num | Parm Type|
| 0x75 | | Type | conv | Parms | Index |
---------- --------- --------- --------- --------- ----------
1 2 1 1 1 2 1 1 1 2
---- -------- ---- ---- ---- -------- ---- ----- ---- --------
|rec |rec len |type|null|FID |ret type|call|num |FID |type |<-----type index of list of type indexes for the
|id | | | |indx|index |conv|parms|indx|index | parameter types.
|0x01| |0x75|0x80|0x83| | | |0x83| |
---- -------- ---- ---- ---- -------- ---- ----- ---- --------
|
|
----------------------------calling convention of
the procedure.
0x63 - c ( args pushed right to left, caller pops )
0x64 - c long
0x95 - near fastcall
0x96 - far fastcall
IBM HL01, HL02. ( IBM generates function(0x54) records.)
--------------
1 2 1 1 2 2 1 2 1 2
---- -------- ---- ---- ------------ ----------- ---- -------- ---- --------
|rec |rec len |type|type|num of parms|max parms |FID |ret type|FID |type |<----- type index of list of type indexes for the
|id | | |qual| | |indx|index |indx|index | | parameter types.
|0x01| |0x54| | | |0x83| |0x83| | |
---- -------- ---- ---- ------------ ----------- ---- -------- ---- -------- |
| |
| | -----------
|<-------------------------------------------------------- --- 5 4 3 2 1 0 <-bit
| | -----------
| | x x x x x 0 - args pushed left to right
| | x x x x x 1 - args pushed right to left
| | x x x x 0 x - callee pops
| | x x x x 1 x - caller pops
| | x x x 0 x x - 16 bit function
| | x x x 1 x x - 32 bit function
| | x x 0 x x x - near
| | x x 1 x x x - far
| | x 0 x x x x - fixed parms
| | x 1 x x x x - variable parms
| | 0 x x x x x - OS/2 calling convention
| | 1 x x x x x - private calling convention
| |
IBM HL03. | |
-------- | |
2 1 1| 2 2 1 2 1 2 |
-------- ---- ---- ------------ ----------- ---- -------- ---- -------- |
|rec len |type|type|num of parms|max parms |FID |ret type|FID |type | |
| | |qual| | |indx|index |indx|index |<-
| |0x54| | | |0x83| |0x83| |
-------- ---- ---- ------------ ----------- ---- -------- ---- --------
1------------------------------------------------------------------------------
SD386 Internal.
---------------
T N UN UN I I
---------- --------- --------- --------- --------- ----------
| Trec | Flags | Number | Max num | Return | Parm List|
| 0x75 | | of parms| of parms| Type | Index |
---------- --------- --------- --------- --------- ----------
2 1 1 1 2 1 2 1 2 1 2
-------- ---- ---- ---- ------------ ---------------- ---- -------- ---- --------
|rec len |type|flgs|FID |num of parms|FID |max parms |FID |ret type|FID |parm lst|<---type index of list of type indexes for the
| | | |span| |span| |indx|index |indx|index | parameter types.
| |0x75| |0x85| |0x85| |0x83| |0x83| |
-------- ---- ---- ---- ------------ ---- ----------- ---- -------- ---- --------
|
|
----------- |
5 4 3 2 1 0 <-bit ----
-----------
x x x x x 0 - args pushed left to right
x x x x x 1 - args pushed right to left
x x x x 0 x - callee pops
x x x x 1 x - caller pops
x x x 0 x x - 16 bit function
x x x 1 x x - 32 bit function
x x 0 x x x - near
x x 1 x x x - far
x 0 x x x x - fixed parms
x 1 x x x x - variable parms
0 x x x x x - OS/2 calling convention
1 x x x x x - private calling convention
Notes:
1. Map the Microsoft the calling convention to the IBM type qualifier byte.
2. Do not map the Microsoft "null" leaf.
1------------------------------------------------------------------------------
Skip.
----
Microsoft 16/32 bit.
-------------------
T 2 ?
---------- --------- ---------
| Trec | Next | padding |
| 0x90 | Index | |
---------- --------- ---------
1 2 1 2 *
---- -------- ---- -------- ----
|rec |rec len |type|new |pad |
|id | | |index | |
|0x01| |0x90| | |
---- -------- ---- -------- ----
|
|
-- this is the next sequential index.
IBM HL01,HL02,HL03.
-------------------
Not supported.
SD386 Internal.
--------------
T I
---------- ---------
| Trec | Next |
| 0x94 | Index |
---------- ---------
2 1 2
-------- ---- --------
|rec len |type|new |
| | |index |
| |0x90| |
-------- ---- --------
|
|
-- this is the sequential index.
1------------------------------------------------------------------------------
Null.
----
Microsoft.
---------
T
----------
| Trec |
| 0x80 |
----------
1 2 1
---- -------- ----
|rec |rec len |type|
|id | | |
|0x01| |0x80|
---- -------- ----
IBM HL01,HL02,HL03.
-------------------
Not supported.
SD386 Internal.
--------------
T
----------
| Trec |
| 0x80 |
----------
2 1
-------- ----
|rec len |type|
| | |
| |0x80|
-------- ----
Notes:
1. All records that we don't support will be mapped to this record.
2. There is no "Flags" leaf for this record.
1------------------------------------------------------------------------------
Class
-----
Microsoft 16/32 bit.
-------------------
IBM HL01,HL02,HL03.
------------------
- Not supported.
IBM HL04.
---------
2 1 1 4 2 2 1 1 *
-------- ---- ---- ---------------- -------- -------- ----- ----- ---------/
|rec len |type|type| size of class |num |item lst|ENC |ENC |class
| | |qual| in bytes |class |index |1st |2nd |name
| |0x40| | |members | |Byte |Byte |
-------- ---- ---- ---------------- -------- -------- --------------------//
SD386 Internal.
--------------
2 1 1 4 2 2 2 *
-------- ---- ---- ---------------- -------- -------- -------- ---------/
|rec len |type|type| size of class |num |item lst|name |class
| | |qual| in bytes |class |index |len |tag name
| |0x79| | |members | | |
-------- ---- ---- ---------------- -------- -------- -----------------//
1------------------------------------------------------------------------------
Member Function
---------------
Microsoft 16/32 bit.
-------------------
IBM HL01,HL02,HL03.
------------------
- Not supported.
IBM HL04.
---------
non-virtual member
------------------
2 1 1 1 2 1/2 *
-------- ---- ---- ---- -------- ----- ----- ---------/
|rec len |type|type|pro-|sub |ENC |member
| | |qual|tect|record |Length |name
| |0x45| |ion |index |Prefix |
-------- ---- ---- ---- -------- --------------------//
virtual member
--------------
2 1 1 1 2 @ @ *
-------- ---- ---- ---- -------- --------------- --------- ---------/
|rec len |type|type|pro-|sub |FID_span/virtno| ENC |member
| | |qual|tect|record | | |name
| |0x45| |ion |index | | |
-------- ---- ---- ---- -------- ----------------------------------//
SD386 Internal.
--------------
2 1 1 1 2 4 2 *
-------- ---- ---- ---- -------- --------------- --------- ---------/
|rec len |type|type|pro-|sub |vTableIndex | name |member
| | |qual|tect|record | | len |name
| |0x45| |ion |index | | |
-------- ---- ---- ---- -------- ----------------------------------//