I think the conversation is loosing track. You want to write a C program to write main function,take input in array and then sort it through some sorting algorithm and then run search through your assembly program right? Concentrate on that.Do this first:
1)Writing a main program and taking inputs into array should be simple as it is very much similar to JAVA programming the same thing.Do it first.
2)You will get all the help needed for sorting algorithms form this community threads and also the link
http://en.wikipedia.org/wiki/Sorting_algorithm
3)If you want it still simplified here you get algorithm and modules to write bubble sort and also simulated explaination.
http://www.cs.princeton.edu/~ah/alg_anim/gawain-4.0/BubbleSort.html
4)After this concentrate on making it search for the user input in the array through your assembly code.
Don't loose your way.Concentrate on what path to take to make compiler do your work.Then you can code anything.