Index: SingleSource/Benchmarks/Stanford/Bubblesort.c =================================================================== --- SingleSource/Benchmarks/Stanford/Bubblesort.c +++ SingleSource/Benchmarks/Stanford/Bubblesort.c @@ -128,8 +128,10 @@ int i; long temp; /* converted temp to long for 16 bit WR*/ Initrand(); - biggest = 0; littlest = 0; - for ( i = 1; i <= srtelements; i++ ) { + temp = Rand(); + sortlist[1] = (int)(temp - (temp / 100000L) * 100000L - 50000L); + biggest = sortlist[1]; littlest = sortlist[1]; + for ( i = 2; i <= srtelements; i++ ) { temp = Rand(); /* converted constants to long in next stmt, typecast back to int WR*/ sortlist[i] = (int)(temp - (temp/100000L)*100000L - 50000L); @@ -147,12 +149,15 @@ i=1; while ( i sortlist[i+1] ) { - j = sortlist[i]; - sortlist[i] = sortlist[i+1]; - sortlist[i+1] = j; + int sli = sortlist[i]; + int sli1 = sortlist[i + 1]; + if ( sli > sli1 ) { + j = sli; + sli = sli1; + sli1 = j; } + sortlist[i] = sli; + sortlist[i + 1] = sli1; i=i+1; } Index: SingleSource/Benchmarks/Stanford/Quicksort.c =================================================================== --- SingleSource/Benchmarks/Stanford/Quicksort.c +++ SingleSource/Benchmarks/Stanford/Quicksort.c @@ -127,8 +127,10 @@ int i; /* temp */ long temp; /* made temp a long for 16 bit WR*/ Initrand(); - biggest = 0; littlest = 0; - for ( i = 1; i <= sortelements; i++ ) { + temp = Rand(); + sortlist[1] = (int)(temp - (temp / 100000L) * 100000L - 50000L); + biggest = sortlist[1]; littlest = sortlist[1]; + for ( i = 2; i <= sortelements; i++ ) { temp = Rand(); /* converted constants to long in next stmt, typecast back to int WR*/ sortlist[i] = (int)(temp - (temp/100000L)*100000L - 50000L); Index: SingleSource/Benchmarks/Stanford/Treesort.c =================================================================== --- SingleSource/Benchmarks/Stanford/Treesort.c +++ SingleSource/Benchmarks/Stanford/Treesort.c @@ -129,8 +129,10 @@ int i; long temp; /* converted temp to long for 16 bit WR*/ Initrand(); - biggest = 0; littlest = 0; - for ( i = 1; i <= sortelements; i++ ) { + temp = Rand(); + sortlist[1] = (int)(temp - (temp / 100000L) * 100000L - 50000L); + biggest = sortlist[1]; littlest = sortlist[1]; + for ( i = 2; i <= sortelements; i++ ) { temp = Rand(); /* converted constants to long in next stmt, typecast back to int WR*/ sortlist[i] = (int)(temp - (temp/100000L)*100000L - 50000L);