🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #12715

Re: New AmigaDOS hunk types

#12715
From: Daniel S. Riley
Date: Wed, 17 May 1989 16:34
56 lines
3253 bytes
In article <0353.AA0353@ami-cg> cg@ami-cg.UUCP (Chris Gray) writes:
>The AmigaDOS technical
>reference manual describes hunk types 999 - 1011, 1013, 1014. Lattice will
>generate 1016, which I would guess is an a4-relative offset. Is 1015 used
>for anything? What about the new stuff for libraries? In HUNK_EXT's, I know
>of types 0 - 3, 129 - 132. Lattice uses 134, presumeably again for a4-relative
>stuff. Is 133 used? Could someone please send me a definition of all of the
>new codes so that I can make my dumper/disassembler as general as possible?

Here's what I've deciphered or heard about the Lattice hunk formats.
Somewhere or another I have a version of Matt's "hunks" program which
I modified to include these, and I also have some documentation from 
Lattice on the library format.  If there's a big demand for details,
I could probably be talked into uploading this.

1015 is DREL32, 1016 is DREL16, and 1017 is DREL8, all for relative 
offsets.  These basically look like 1004-1006 (RELOC32 through RELOC8).  

In libraries, Lattice uses 1018 for HUNK_LIB, and 1019 for HUNK_INDEX, 
1018 holds the object modules in the library.  The INDEX comes directly 
after the LIB hunk, so a library looks like

HUNK_LIB length
	HUNK_CODE
		...(and stuff)
	HUNK_...
	and so on
HUNK_INDEX length
	index stuff
HUNK_whatever.

If you don't need to parse the index, you can just treat the insides of
a HUNK_LIB as normal object modules (there's nothing special in there,
I believe), and just skip over any HUNK_INDEX hunks.  The HUNK_LIB does
not contain any HUNK_UNIT or HUNK_NAME hunks, and the HUNK_EXT hunks
do not contain any ext_def types--all this information is put into the
HUNK_INDEX.  EXT_REF8 isn't supported, and EXT_ABS is treated a bit
oddly.  A library can contain more than one LIB/INDEX pair, and hybrid 
libraries *are* allowed.  The INDEX structure is pretty involved, so
I'm not going to try to describe it here--but I could be talked into
uploading the description from Lattice.

*Special note*  This means that it is possible to concatenate new style
Lattice libraries, or even concatenate new style libraries with old style
libraries.  (I had said before that this wouldn't work, but according to
the Lattice specs I was clearly wrong.)

Type 134 is ext_dref16 (I think Lattice calls it DEXT16).  I assume that
133 is dref32, and 135 dref8, but I'm not sure I ever verified that.

That's all the new ones I know about, and I don't know for sure that
133 and 135 exist, and I don't know if these are "official" as far as
C-A is concerned.  Hope this is helpful.

-Dan Riley (riley@tcgould.tn.cornell.edu, cornell!batcomputer!riley)
-Wilson Lab, Cornell U.
Technical Details
Message-ID: <7968@batcomputer.tn.cornell.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!riley
References: <0353.AA0353@ami-cg>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!riley
From: riley@batcomputer.tn.cornell.edu (Daniel S. Riley)
Newsgroups: comp.sys.amiga.tech
Subject: Re: New AmigaDOS hunk types
Keywords: hunk Lattice disassembler
Message-ID: <7968@batcomputer.tn.cornell.edu>
Date: 17 May 89 16:34:01 GMT
References: <0353.AA0353@ami-cg>
Reply-To: riley@tcgould.tn.cornell.edu (Daniel S. Riley)
Distribution: na
Organization: Cornell Theory Center, Cornell University, Ithaca NY
Lines: 56