[LispM-Hackers] memFEFHeader::readMacroInstruction
Dave Richards
dave@synergy.org
Fri, 1 Mar 2002 09:29:24 -0800
Based on "Figure 11-3 The Layout of a FEF" in SSDN2:
1
+-+-+---------+-+-----+-----+-------+-------+-------------------+
0|Q|S|DTP-FEF-H|M| CT |#opt | #req | #loc | PC word offset |
+-+-+---------+-+-----+-----+-------+-------+-------------------+
1|cc |DTP-FIX | length of function |
+---+---------+-------------------------------------------------+
2|cc |DTP-LIST | pointer to debugging info |
+---+---------+-----+-+-+-+-----------+-----------+-------------+
3|cc |DTP-FIX | |O|L|R|min # args |max # args | # locals |
+---+---------+-----+-+-+-+-----------+-----------+-------------+
|cc |DTP-SYMBO| pointer to name of flavor for a method |
+---+---------+-------------------------------------------------+
|cc | | first constant |
+---+---------+-------------------------------------------------+
+---+---------+-------------------------------------------------+
| | | last constant |
+---+---------+------------------+------------------------------+
| second instruction | first instruction |
+--------------------------------+------------------------------+
| fourth instruction | third instruction |
+--------------------------------+------------------------------+
I believe:
e3MacroInstruction memFEFHeader::readMacroInstruction(e3u32 entry_offset,
e3u
8 relative_pc) const
{
e3Word foo = readWordAt(myWordAddress + entry_offset + (relative_pc / 2));
if (!(relative_pc & 0x1)) // Even or high word.
{
e3MacroInstruction retval((foo.getBits() >> 16) & 0xffff);
return(retval);
}
else // Odd or low word.
{
e3MacroInstruction retval(foo.getBits() & 0xffff);
return(retval);
}
}
is backwards.
if (!(relative_pc & 0x1)) // Even or high word.
should be:
if (relative_pc & 0x1) // Even or high word.
On a different topic. In reading the code, I see references in word.h to
section 7. I didn't see it up there. Is sect07.txt available?
Dave