From e611b132f9b8abe35b362e5870b74bce94a1e58e Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 16 May 2020 20:51:50 -0700 Subject: initial commit --- private/sdktools/masm/hash.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 private/sdktools/masm/hash.c (limited to 'private/sdktools/masm/hash.c') diff --git a/private/sdktools/masm/hash.c b/private/sdktools/masm/hash.c new file mode 100644 index 000000000..1698ca539 --- /dev/null +++ b/private/sdktools/masm/hash.c @@ -0,0 +1,16 @@ +/* +** hash : hashes the given string by adding all the chars in the string. +*/ + + unsigned short +hash ( name ) + register char *name; + { + register unsigned short i = 0; + register unsigned short c; + + while (c = *name++) + i += c; + + return( i ); + } -- cgit v1.2.3