Yes if you limit the character set as specified you can actually pack 3
characters per integer. It is a techniques called Rad50 that the old
PDP11 assemblers used to use for speed. I wrote a cross assemble many
years ago (early 90s i think) that duplicated the method.
Following is some really bad C code i wrote long ago before I knew how
to be a better programmer. Hopefully it helps you. I actually combine
two 32 bit words to make one long int. This way one long compare checks
6 characters. The long word served as a key in a btree.
#define getrad50(x) ((long)(rad50table[(uchar)x]))
/* Rad50 coversion table */
char rad50table[256] =
{
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,27,-1,-1,-1,
-1,-1,-1,-1,-1,-1,28,-1,30,31,
32,33,34,35,36,37,38,39,-1,-1,
-1,-1,-1,-1,-1, 1 ,2, 3, 4, 5,
6, 7, 8, 9,10,11,12,13,14,15,
16,17,18,19,20,21,22,23,24,25,
26,-1,-1,-1,-1,29,-1, 1, 2, 3,
4, 5, 6, 7, 8, 9,10,11,12,13,
14,15,16,17,18,19,20,21,22,23,
24,25,26,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1
};
/* get next characters and put as worksym */
void getworksym()
{
char *cptr = currentchar;
short j;
ushort r50a = 0,r50b = 0;
/* get first 3 characters */
if ((j = (short)getrad50(*cptr++)) >= 0)
{
r50a = j * 1600;
if ((j = (short)getrad50(*cptr++)) >= 0)
{
r50a += j * 40;
if ((j = (short)getrad50(*cptr++)) >= 0)
{
r50a += j;
/* get second 3 characters */
if ((j = (short)getrad50(*cptr++)) >= 0)
{
r50b = j * 1600;
if ((j = (short)getrad50(*cptr++)) >= 0)
{
r50b += j * 40;
if ((j = (short)getrad50(*cptr++)) >= 0)
{
r50b += j;
for (;getrad50(*cptr++) >= 0

;
}
}
}
}
}
}
worksym = ((long)r50a << 16) | r50b; /* make long rad50 character */
getnextchar(--cptr);/* get next non white space */
}
Hope this helps
Leon Lambert