I have also disassembled EdAsm's Linker Module.
Currently, I am porting it to MPW IIGS assembly language because of
the RECORD feature. Now I can use syntax like
ldy #XtrnRecord.externNum
lda (xtrnRecP),Y ;xtrnRecP is the zpage location $8C
sta MiniESDRec+ESDRecord.externNum
where
XtrnRecord RECORD 0
symNamePtr DS.W 1 ;offset: 0 ptr to a record in SymbolicName table
($9200)
entryPtr DS.W 1 ;offset: 2 Ptr to an ENTRY record; NULL initially
fileNum DS.B 1 ;offset: 4 file # of src file (also called module #)
flags DS.B 1 ;offset: 5 flagByte
symbolNum DS.B 1 ;offset: 6 symbol # referred to by an RLD record
externNum DS.B 1 ;offset: 7 extern number (< 255)
sizeof EQU * ;8 bytes
ENDR
and
ESDRecord RECORD 0
flags DS.B 1 ;offset: 0 flagByte
relAddr EQU * ;offset: 1 If symbol is ENTRY-type
externNum DS.B 1 ;offset: 1 If symbol is EXTRN-type
unused DS.B 1 ;offset: 2
sizeof EQU * ;3 bytes
ENDR
miniESDRec DS ESDRecord ;an instance of ESDRecord
This makes the code more readable especially when one has to deal with
a variant record.
As an aside, after upgrading to an i7 last year, I took the
opportunity to learn the basics of x86/86-x64 assembly using NASM. The
record syntax is similar to MPW assembler. Incidentally, there is a
copy of MPW IIgs tools (v1.2) on the
original Golden Orchard (GO) CDROM.