home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 13
/
AACD13.ISO
/
AACD
/
Resources
/
System
/
BoingBag1
/
Contributions
/
Workbench
/
RexxArpLib3p6
/
src
/
rxhtable.a
< prev
next >
Wrap
Text File
|
1998-06-19
|
5KB
|
129 lines
SAS AMIGA 680x0OBJ Module Disassembler 6.57
Copyright © 1995 SAS Institute, Inc.
Amiga Object File Loader V1.00
68000 Instruction Set
EXTERNAL DEFINITIONS
@rxhtable_index 0000-00
SECTION 00 "text" 00000078 BYTES
; 1: /** rxhtable.c
; 2: *
; 3: * DESCRIPTION:
; 4: * ===========
; 5: *
; 6: * This function finds the index associated with the function
; 7: * name given in the argument string.
; 8: *
; 9: * It uses a hashing function that was found using the program
; 10: * 'hash' by W.G.J. Langeveld.
; 11: *
; 12: * SYNOPSIS:
; 13: * =========
; 14: *
; 15: * index = rxhtable_index(name)
; 16: *
; 17: * int index the index of the function, -1 if not found.
; 18: * char *name name of function.
; 19: *
; 20: **/
; 21:
; 22: #include <string.h>
; 23: #include <ctype.h>
; 24:
; 25:
; 26:
; 27: static int hash_table[] =
; 28: {
; 29: -1, -1, 8, -1, 17, -1, 18, 7, -1, 9,
; 30: 6, 15, 10, -1, 0, -1, 11, -1, -1, -1,
; 31: 5, 12, 16, 14, 19, 13, -1, -1, -1, 4,
; 32: 1, 2, -1, -1, 3, -1, -1,
; 33: };
; 34:
; 35:
; 36: int rxhtable_index(char *);
; 37: static int hash(unsigned char *);
; 38:
; 39:
; 40: int rxhtable_index( char *s )
| 0000 594F SUBQ.W #4,A7
; 41: {
; 42: return(hash_table[hash(s)]);
| 0002 2E8E MOVE.L A6,(A7)
| 0004 6100 0014 BSR.W 001A
| 0008 48C0 EXT.L D0
| 000A 2200 MOVE.L D0,D1
| 000C D281 ADD.L D1,D1
| 000E 41EC 0000-01.2 LEA 01.00000000(A4),A0
| 0012 3030 1800 MOVE.W 00(A0,D1.L),D0
| 0016 584F ADDQ.W #4,A7
| 0018 4E75 RTS
; 43: }
; 44:
; 45:
; 46: static int hash( unsigned char *s )
| 001A 594F SUBQ.W #4,A7
| 001C 2F07 MOVE.L D7,-(A7)
| 001E 2248 MOVEA.L A0,A1
; 47: {
; 48: register int res;
; 49: register unsigned char *sp;
; 50: register unsigned int c;
; 51:
; 52: res = strlen(s);
| 0020 4A18 TST.B (A0)+
| 0022 66FC BNE.B 0020
| 0024 5388 SUBQ.L #1,A0
| 0026 91C9 SUBA.L A1,A0
| 0028 3E08 MOVE.W A0,D7
; 53:
; 54: for (sp = s; *sp; sp++ )
| 002A 2F4E 0004 MOVE.L A6,0004(A7)
| 002E 6032 BRA.B 0062
; 55: {
; 56: c = toupper(*sp);
| 0030 7000 MOVEQ #00,D0
| 0032 1011 MOVE.B (A1),D0
| 0034 41EC 0001-XX.2 LEA ___ctype+00000001(A4),A0
| 0038 0830 0001 0000 BTST #0001,00(A0,D0.W)
| 003E 670A BEQ.B 004A
| 0040 7200 MOVEQ #00,D1
| 0042 1200 MOVE.B D0,D1
| 0044 0441 0020 SUBI.W #0020,D1
| 0048 6004 BRA.B 004E
| 004A 7200 MOVEQ #00,D1
| 004C 1200 MOVE.B D0,D1
; 57: res = ((res * 23 + c ) & 0x7ff);
| 004E 2007 MOVE.L D7,D0
| 0050 E540 ASL.W #2,D0
| 0052 9047 SUB.W D7,D0
| 0054 E740 ASL.W #3,D0
| 0056 9047 SUB.W D7,D0
| 0058 D041 ADD.W D1,D0
| 005A 0240 07FF ANDI.W #07FF,D0
| 005E 3E00 MOVE.W D0,D7
| 0060 5289 ADDQ.L #1,A1
| 0062 4A11 TST.B (A1)
| 0064 66CA BNE.B 0030
; 58: }
; 59: return(res % 37);
| 0066 3007 MOVE.W D7,D0
| 0068 48C0 EXT.L D0
| 006A 81FC 0025 DIVS.W #0025,D0
| 006E 4840 SWAP D0
| 0070 2E1F MOVE.L (A7)+,D7
| 0072 584F ADDQ.W #4,A7
| 0074 4E75 RTS
| 0076 4E71 NOP
SECTION 01 "__MERGED" 0000004C BYTES
0000 FF FF FF FF 00 08 FF FF 00 11 FF FF 00 12 00 07 ................
0010 FF FF 00 09 00 06 00 0F 00 0A FF FF 00 00 FF FF ................
0020 00 0B FF FF FF FF FF FF 00 05 00 0C 00 10 00 0E ................
0030 00 13 00 0D FF FF FF FF FF FF 00 04 00 01 00 02 ................
0040 FF FF FF FF 00 03 FF FF FF FF 00 00 ............