[comp.sys.ibm.pc] what can you tell me about DOS .OBJ files?

hermit@devon.UUCP (Mark Buda) (06/14/88)

Can any of you kind knowledgable souls tell me where I might find
information about the format of DOS .OBJ and .LIB files? I'm writing an
80386 assembler, and it would be a bit easier if I didn't have to write a
linker as well.
(The assembler will be shareware, incidentally, and posted to
comp.binaries.ibm.pc if the moderator deems it fit.)

I would be mushly appreciative.

-- 
Mark Buda			Smart UUCP: hermit@chessene.uucp
Dumb UUCP: ...{rutgers,ihnp4,att-cb}!bpa!vu-vlsi!devon!chessene!hermit
Entropy will get you in the end.
"A little suction does wonders." - Gary Collins

bturner@hpcvlx.HP.COM (Bill Turner) (06/15/88)

I would suggest you contact either Microsoft (I think I've seen a document
describing the .OBJ format from them), or Intel (the .OBJ format is a
superset of the .OBJ format from Intel -- course, that won't help finding
out what the extra records mean...)

I have an old copy of the Intel document (had, I should say :-( ), and to
get you started all of the records are of the form

	BYTE RecordType;
	WORD RecordLength;
	[followed by whatever data is required, and]
	BYTE CheckSum;

RecordLength includes the checksum, but not the type or length itself.
Symbol names are size-prefixed byte strings; i.e., one-byte length,
followed by N characters (no null termination).

--Bill Turner

bright@Data-IO.COM (Walter Bright) (06/16/88)

In article <845@devon.UUCP> hermit@chessene.uucp writes:
>Can any of you kind knowledgable souls tell me where I might find
>information about the format of DOS .OBJ and .LIB files? I'm writing an
>80386 assembler, and it would be a bit easier if I didn't have to write a
>linker as well.

The DOS .OBJ file format is described in a document from Intel called
"Relocatable Object Module Format", you can call them at 800-538-3373.
Microsoft added a few extensions, they describe them in the OS/2 SDK
documentation. I've heard it's also described in the MS-DOS Encyclopedia,
but I haven't seen one.

Microsoft has tried to keep the .LIB format secret. It's not published
anywhere, but many people have figured it out.

The .OBJ format needs to be extended if 80386 code is to be assembled.
Check out how Phar Lap did this for their assembler, please avoid making
gratuitous new inventions unless absolutely necessary.

everett@hpcvlx.HP.COM (Everett Kaser) (06/16/88)

The October 1985 issue of PC Tech Journal has a very good article titled
".OBJ Lessons".  However, it will not contain the new record types that
Microsoft has added since then.  On the other hand, you should be able to
get by with this 'subset', since you're generating .OBJ files that are
to be used by Microsoft's linker, rather than writing a linker that has
to understand Microsoft's .OBJ files.

Everett Kaser
!hplabs!hp-pcd!everett

ked@garnet.berkeley.edu (Earl H. Kinmonth) (06/16/88)

Is it possible to modify the "/etc/magic" file used by the "file"
utility in the MKS Toolkit so that "file" will differentiate
among memory models?  On Xenix "file" does tell whether the ".o"
file is small, medium, or whatever.  The MKS "file" utility
simply tells me what I already know.

E H. Kinmonth Hist. Dept.  Univ. of Ca., Davis Davis, Ca. 95616
916-752-1636/0776

Disclaimer:  This is AmeriKa!  Who needs a disclaimer!

Internet:  ehkinmonth@ucdavis.edu
           cck@deneb.ucdavis.edu
BITNET:    ehkinmonth@ucdavis
UUCP:      {ucbvax, lll-crg}!ucdavis!ehkinmonth
           {ucbvax, lll-crg}!ucdavis!deneb!cck