I was hoping if anyone has a simple string bubblesort for strings
assembly code.
I'm actually trying to sort a string in a

structure like so

typName struc
lname db 21 dup(?)
fname db 11 dup(?)
age dd ?
typName ends

I just trying to get a grip on it, I know there's more to it
than switching elements, because there strings and strings
are really pointers, to the first element of the string
But anyway It would be cool to have that code,

like this in C

for( i = 0; i < CAP; i++)
for(j=i+1;j<CAP;j++)
{

if(strcmp(typName.lname,typName.lname) == 1 )


{temp = typName;
typName = typName;
typName = temp;}

}


Thanks Andy



:stupid:
Posted on 2001-12-14 21:51:00 by andy981
There are two little bubble sorts HERE (look at this post and a couple down: one by Jibz). You just have to change the integer compare with the string compare and account for what type of structures you are using. It would be best to make an array of pointers to the structures, then move the pointers around instead of the structures. This sort is slow to being with - moving the structures around would really slow it down. :) The assembly structure you posted above is not composed of pointers to strings, but the strings themselves.
Posted on 2001-12-15 02:38:23 by bitRAKE