Re: QPROCT and QPRODT

Gene_Gaunt-GDFlLPZ4eRKEK/[email protected] Sat, 13 Mar 2010 13:48:11 -0500
Newsgroups gmane.comp.lang.as400.mi
Message-ID <OFC14D1165.0DBFE0BD-ON852576E5.006733F8-852576E5.006749C4@reviewworks.com>
QPROCT hashes the 8-letter MI opcodes into 563 linked lists.  All those
x'FFFF's you observes in the QPROCT space are linked list tombstones.

The hash algorithm is remarkable: view the 8-letter opcode as two 4-byte
signed integers; exclusive-OR them together; divide by 563 and keep the
remainder; if the remainder is not positive, add 563.  The result is a
number in the range 1 to 563, which is your index into the hash anchor
array.  Here is MI code a disassembler can use to get your hash number:

DCL DD OPCODE CHAR(8);
DCL DD INDEX BIN(4);

XOR      INDEX, OPCODE(1:4), OPCODE(5:4);
REM(SB)  INDEX, 563 / NPOS(SKIP);
ADDN(S)  INDEX, 563;

SKIP:

And this begs the question:

Why 563?


_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.