]> pd.if.org Git - mmurtl/commitdiff
autocommit for file dated 1995-02-09 12:09:16
authorRichard Burgess <>
Thu, 9 Feb 1995 12:09:16 +0000 (12:09 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Mon, 17 Oct 2016 14:03:48 +0000 (14:03 +0000)
mscode16/readobj/readobj.doc [new file with mode: 0644]

diff --git a/mscode16/readobj/readobj.doc b/mscode16/readobj/readobj.doc
new file mode 100644 (file)
index 0000000..468e331
--- /dev/null
@@ -0,0 +1,189 @@
+Object Module Reader V1.0\r
+(Q & A)\r
+(c) 1992 R.A. Burgess\r
+\r
+------------------------------------------------------------------\r
+\r
+Q.  What is the Object Module Reader??\r
+\r
+A.  The Object Module Reader breaks out all the records in an Intel\r
+"object module" so they so they can be anaylzed.  It breaks them \r
+out in "raw" form which is a hexidecimal dump format, or it expands \r
+some of the records and fields for more information.\r
+\r
+Q.  What can you use if for?\r
+\r
+A.  People that are interested in the format or content of\r
+object modules from Intel based assemblers and compilers can use this\r
+to analyze each of the records.  It also provides insight into\r
+tools such as linkers and object module librarians.\r
+\r
+Q.  OK, so what.  What are object modules anyway??\r
+\r
+A.  A programmer writes a program.  This program is in a "source"\r
+language such as Assembler, C or Pascal.  Most assemblers and compilers\r
+turn the source language into sections of machine code the processor\r
+can execute or data the processor can manipulate called Object Records.\r
+\r
+The machine code and data are broken into these records that can be stored\r
+in libraries or combined to make executable programs.\r
+\r
+A single group of these records is produced from each source file and\r
+is called an Object Module.  Each record inside an object module is\r
+further divided into fields that describe the code or data associated\r
+with that particular record.\r
+\r
+Q.  Ok, this make sense so far. But what are these records and what do they\r
+describe?\r
+\r
+A.  Some of the records contain machine code and data that will be\r
+placed in the executable program file, while others contain information\r
+to tell the linker where and how to combine the code and data records\r
+with other object module records.\r
+\r
+Q.  So, do they just throw these records in the object module file any old\r
+way, or is there a method to their madness???\r
+\r
+A.  There is definately a method to their madness...  Back in prehistoric\r
+microcomputer times (1979), when Intel was building their now\r
+famous 8086 processor, they designed the Object Module formats for the\r
+80x86 series of processors and language tools.  All versions (that I\r
+have run across) of the 80x86 object modules are based on this design\r
+which was documented in a book called 8086 Relocatable Object Module Formats\r
+(which, incidently, is still available from Intel in it's original 1981 form).\r
+\r
+Some additions beyond those documented in the Intel manual were required\r
+when the 32 bit processors were introduced.  These additions can be found\r
+in object modules that are generated from IBM's CSet/2 32 bit compiler\r
+for OS/2 (v2.x) and also from other compilers and assemblers that produce 32\r
+bit code. Borland's Turbo assembler with the /3 option and MASM generate\r
+additional record types also).  See "Object Module Record Descriptions"\r
+following the Q & A portion of this manual.  Most (if not all) of the earlier\r
+language and programming tool vendors followed the format very closely. This\r
+is NOT the case with some vendors later extensions (mostly 32 bit).\r
+\r
+Q.  Can this thing take apart object module "libraries?"\r
+\r
+A.  No, you should get a cross reference listing using your librarian\r
+and extract the module you are interested in, then run ReadObj against\r
+it.\r
+\r
+Q. OK, now that I know all this, how do I execute the Object Module Reader?\r
+\r
+A.  The Object Module Reader is a single executable file (DOS or OS/2)\r
+and has two command line parameters and one switch.  The paramters are\r
+INPUT FILE (your object module filename), and OUTPUT FILE (the text file\r
+that the data is put into).  The single switch is /R for RAW data only.\r
+Normally, the object module reader gives you as much data as possible\r
+from the object module, which means it breaks out some of the more confusing\r
+fields from the records.  The /R option forces it to present only the\r
+record type, offset in the obj file, the size, and the records data (hex dump).\r
+\r
+Example of the command line:\r
+\r
+C:\> ReadObj MyBad.Obj MyBad.txt /R\r
+\r
+This would take an object file named MyBad.Obj and put the text\r
+descriptions into a file called MyBad.txt in RAW form. If you leave\r
+off the /R it will expand some of fields in the records.\r
+If you do not specifiy an output file it will send the text data\r
+to the screen.\r
+\r
+To test it, try this:\r
+\r
+C:\mscode16\readobj> ReadObj ReadObj. Obj  Obj.txt\r
+\r
+then edit Obj.TXT\r
+\r
+----------------------------------------------------------------\r
+Sample Object Module Record Descriptions\r
+\r
+The following section contains a description of a few of the most\r
+commonly found Object Module Records. Some are all but obsolete.\r
+The Intel publication should be purchased if you're really interested.\r
+\r
+Each of the record types found in an object module is described\r
+as a record (pseudo language).  Several of the field types use\r
+simple names to describe the types.  They are as follows:\r
+\r
+LString                A string of characters preceeded by a single byte which\r
+                       contains the length of characters in this string.\r
+\r
+Byte           An 8 bit unsigned value\r
+\r
+Word           A 16 bit unsigned value\r
+\r
+DWord          A 32 bit unsigned value\r
+\r
+BitField       One or more bits in a byte that have a special meaning\r
+\r
+RecID          A single byte which is the first byte in a record that\r
+                       identifies it's type.\r
+\r
+CheckSum       1 single byte containing all the bytes in the record\r
+                       added up modulo 128 (less the Record ID byte and Size Word)\r
+\r
+RecSize                A Word that has the size of the record minus the RecID,\r
+                       RecSize, and Checksum.\r
+\r
+--------------------------\r
+Translator Header (THEADR)\r
+       This is the first record in an object module usually containing\r
+       the name of the source module that this object module was derived\r
+       from.\r
+\r
+Record\r
+       RecID                   : 80h\r
+       RecSize                 : Word\r
+       Name of Module  : LString\r
+       Checksum                : Byte\r
+End\r
+       Raw Data Example:\r
+       07 43 4F 4D 33 32 2E 43                           .COM32.C\r\r
+\r
+--------------------------\r
+Comment (COMENT)\r
+       The comment field contains comments and MORE.  It can be used\r
+       to list libraries that should be used, INLCUDE files used in\r
+       the source file and other non-comment\r
+       type things.  Different language vendors have added some\r
+       proprietary things that other language vendors don't use.\r
+       A REAL standard if ever I saw one...  BUT, as near as I can\r
+       tell it doesn't directly affect the actual code or data records \r
+       contained elsewhere in the module.\r
+\r
+Record\r
+       RecID                   : 88h\r
+       Size:                   : Word\r
+       Comment Data    : Data (up to maximum record length)\r
+       Checksum                : Byte\r
+End\r
+       Raw Data Example:\r
+       40 9F 4F 53 32 33 38 36 2E 4C 49 42               @.OS2386.LIB\r\r
+\r
+--------------------------\r
+List of Names (LNAMES)\r
+       This lists the segment name(s) defined by the translator (assembler\r
+       or compiler). They are in LString format.\r
+\r
+Record\r
+       RecID:                  : 96h\r
+       Size:                   : Word\r
+       List:                   : Zero or more LStrings\r
+       Checksum:               : Byte\r
+End\r
+       Raw Data Example:\r
+       04 43 4F 44 45 04 44 41 54 41 05 43 4F 4E 53 54   .CODE.DATA.CONST\r\r
+       03 42 53 53 06 43 4F 44 45 33 32 06 44 41 54 41   .BSS.CODE32.DATA\r\r
+       33 32 07 43 4F 4E 53 54 33 32 05 42 53 53 33 32   32.CONST32.BSS32\r\r
+       06 44 47 52 4F 55 50 04 46 4C 41 54 06 44 45 42   .DGROUP.FLAT.DEB\r\r
+       53 59 4D 09 24 24 53 59 4D 42 4F 4C 53 06 44 45   SYM.$$SYMBOLS.DE\r\r
+       42 54 59 50 07 24 24 54 59 50 45 53               BTYP.$$TYPES\r\r
+\r
+--------------------------\r
+Module End (MODEND)\r
+       This single byte signifies the end of the module.\r
+\r
+Record\r
+       RecID:                  : 96h\r
+End\r