Well there's definitely an infinite loop there

From:

Code:

int findfirst(tabletype tabl[], int n, char x[])
{
int index = -1;
int min = 0;
int max = n;
int mid = n/2;
printf("\n\n%s\n\n", x);
while(min <= max)
{
mid = (min + max) / 2;
printf("%s\n\n", tabl[mid].symbol);
if(strcmp(tabl[mid].symbol, x) < 0)
min = mid + 1;
else
max = mid;
if(strcmp(tabl[mid].symbol, x) == 0)
index = mid;
}
return index;
}

Testing:

Code:

**********************
* TESTING opcodeincr *
**********************
COP 3601: Spring, 2010 -
Enter breakup line (enter done to exit test) : EXAMPLE +LDA STUFF,X

We get:

Code:

LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA
LDA

Continues like that forever of course

Taking out the printf for the symbol we get this:

Code:

**********************
* TESTING opcodeincr *
**********************
COP 3601: Spring, 2010 -
Enter breakup line (enter done to exit test) : EXAMPLE +LDA TEST,X
ptr after getting "opcode":LDA
ptr after "removing white space":TEST,X
char x:LDA
Program received signal SIGINT, Interrupt.
0x0000000000400d2e in findfirst (tabl=0x5042e0, n=57, x=0x7fbffff7b0 "LDA")
at findfirst.c:28
28 mid = (min + max) / 2;
(gdb) quit