|
From: Gene_Gaunt@xxxxxxxxxxxxxxx Reply-To: MI Programming on the AS400 / iSeries <mi400@xxxxxxxxxxxx> To: MI Programming on the AS400 / iSeries <mi400@xxxxxxxxxxxx> Subject: Re: [MI400] Header for symbol table (my first post) Date: Thu, 2 Sep 2004 15:48:48 -0400
Those 2260 bytes are:
4 bytes, number of hash chains in symbol table (always prime number 563) 2252 bytes: array of 563 four-byte offsets to first item in a chain
The MI compiler drops each program symbol into one of 563 hash chains in this way (pseudo code):
XOR HASH, SYMBOL(1:4), SYMBOL(5:4) REM(SB) HASH, 563 / NNEG(SKIP); ADDN(S) HASH, 563; SKIP:
The result is a number from 0 to 562, the number of a hash chain for that symbol. Each hash chain is a one-way linked list, the first 4-bytes of each entry is the offset to the next entry, the last entry in each chain contains -1.
_______________________________________________ This is the MI Programming on the AS400 / iSeries (MI400) mailing list To post a message email: MI400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/mi400 or email: MI400-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/mi400.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.