microsoft library (.lib) format

    技术2022-05-20  50

    product: microsoft basic compilertitle: microsoft library (.lib) format, created by lib.exeupdated: 27-dec-1991operating system versions: 6.00 6.00b 7.00 7.10operating systems: ms-dossummary:this article describes the components of the microsoft library format(for .lib files created by the lib.exe library manager). the microsoftlibrary format is consistent between compatible microsoft languages.while future library utilities will remain backward- compatible withthe older library formats, the actual library format itself is subjectto change. this information is taken from chapter 5 of the "microsoftc developer's toolkit reference," which contains more in-depthinformation on the microsoft library format.this information applies to microsoft quickbasic versions 4.0, 4.0b,and 4.5 for ms-dos, to microsoft basic compiler versions 6.0 and 6.0bfor ms-dos, and to microsoft basic professional development system(pds) versions 7.0 and 7.1 for ms-dos.more information:library header record---------------------object code library .lib files under ms-dos always contain blocks ofdata in multiples of 512 bytes. the first record in the library is alibrary header. this record is structured the same as a microsoftobject-module-format (ms omf) record. that is, the first byte of therecord identifies the record's type, and the next two bytes specifythe number of bytes remaining in the record. note that the lengthfield is byte-swapped (in other words, the low-order byte precedes thehigh-order byte). the record type for this library header is f0 hex(240 decimal).modules in a library always start at the beginning of a page. pagesize is determined by adding three (one for the record type byte andtwo for the record length field itself) to the value in the recordlength field; thus the library header record always occupies exactlyone page. legal values for page size are given by the range of 2through the n, where n is a value from 4 through 15.the four bytes immediately following the length field are a byte-swapped long integer specifying the byte offset within the library ofthe first block of the dictionary. the next two bytes are a byte-swapped word field that specifies the number of blocks in thedictionary. (note: the library manager, lib.exe for ms-dos, cannotcreate a library whose dictionary requires more than 251 512-bytepages.)the next byte contains flags describing the library. one current flagdefinition is "0x01 = case sensitive". this applies to both regularand extended dictionaries. all other values are reserved for futureuse and should be 0. the remaining bytes in the library header recordare not significant. this record deviates from the typical microsoftomf record in that the last byte is not used as a checksum on the restof the record.object modules--------------the first object module in the library immediately follows the header.the first object module is followed in turn by all other objectmodules in the library. each module is in microsoft omf. individualmodules are aligned so that they start at the beginning of a new page.if, as is commonly the case, a module does not occupy a number ofbytes that is exactly a multiple of the page size, then its last blockis padded with as many null bytes as are required to fill it. thisspecial format is covered in detail in the "c developer's toolkitreference."dictionary blocks-----------------the remaining blocks in the library compose the dictionary. the numberof blocks in the dictionary is given in the library header. dictionarylength is in 512-byte blocks. detailed information on the exactcontent and format of the dictionary are contained in the "cdeveloper's toolkit reference."extended dictionary-------------------the extended dictionary is optional and indicates dependencies betweenmodules in the library. versions of lib.exe earlier than version 3.09do not create an extended dictionary. the extended dictionary isplaced at the end of the library. again, see the "c developer'stoolkit reference" for details on the structure of the extendeddictionary.additional reference words: 6.00 6.00b 7.00 7.10 4.00 4.00b 4.50


    最新回复(0)