Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Compute hash in assembly language. The hash is computed as X mod 5(hash table ha

ID: 3772742 • Letter: C

Question

Compute hash in assembly language. The hash is computed as X mod 5(hash table has 5 buckets 0-4) where X can be any positive integer
.data
X DWORD 1,10,53,62,48,23,86,93,21,45,0
The program should output the hash by iterating through this array Compute hash in assembly language. The hash is computed as X mod 5(hash table has 5 buckets 0-4) where X can be any positive integer
.data
X DWORD 1,10,53,62,48,23,86,93,21,45,0
The program should output the hash by iterating through this array
.data
X DWORD 1,10,53,62,48,23,86,93,21,45,0
The program should output the hash by iterating through this array

Explanation / Answer

program :

HASHSRCH(SRCHKEY,RET)
CALL HASH ROUTINE
CALCULATE TABLE ENTRY ADDRESS (SLOT ADDRESS)
(HASH VALUE * ENTRY LENGTH + BEGINNING OF TABLE
SAVE DISPLACEMENT
RC = -1 SET THE RC TO NEG. ONE
DO WHILE (RC = -1) DO WHILE RC IS NEG. ONE
IF (TABLE ENTRY = 0) IF EMPTY SLOT FOUND
RC = 4 SET THE RC FOR EMPTY SLOT
RETURN TABLE ADDRESS
ELSE
IF (TABLE ENTRY = SRCHKEY) IF MATCHING KEY ARE FOUND
RC = 0 SET THE RC FOR MATCHING KEYS
RETURN TABLE ADDRESS
ELSE
INCREMENT TABLE POINTER
IF (EOT) IF END OF TABLE
WRAP AROUND TO THE BEGINNING
ENDIF
IF (TABLE POINTER = SAVE DISP.) IF TABLE IS FULL
RC = 8 SET RC FOR TABLE FULL
ENDIF
ENDIF
ENDIF
E

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote