i don't know how to connect tyhe wires of the stepper motor along with the 89c51 . there are totally 6 wires in it . and the motors type is KP39HM4-018 and it seems to be japanese make that works for 5v. the colors of the wires are 1 brown , 2 red , 1 black , 1 yellow and 1 orange .
"Perhaps you should find a stepper motor forum?" And the data sheet for your motor!
There are many types of stepper motor. Looking at this thread may be a good start. http://www.keil.com/forum/docs/thread2715.asp