while((T contains less than n - 1 edges) && (E not empty))
choose an edge (v,w) from E of lowest cost;
delete (v,w) from E;
if ((v,w) does not create a cycle in T) add (v,w) to T;
else discard (v,w);
if (T contains fewer than n-1 edges) cout << "no spanning tree"<<endl;

the above-mentioned is the algorithm. And the MIPS how to write?Thanks a lot.

ooh that's Kruskal's algorithm. That is going to be a beast in assembly. I have some java code for it, but I don't think it would be much help. Good luck to you.