I think it is unreasonable to ask for this as a stand-alone program because its implementation will be very dependent on the design of your program as a whole. In particular, it completely depends on how you are storing each position: how are you representing the board and pieces? How do you keep track of where each piece is after each move? How do you know which squares a piece can move to (is there a piece there already? Is there a piece blocking the bishop's movement as it goes from c1 to f4?)? Of course, once you have a implemented all of the above perfectly then the problem of generating the moves that each piece can make becomes quite easy: simply iterate over every piece and for every piece iterate over all of its valid moves (how you store moves is, again, entirely up to you). Finally, is a great resource that gives a good overview of some important topics in chess programming.
CCRL 40/40 Rating List — All engines. Zap!Chess Paderborn 64-bit 4CPU: 2849 +26 −26. Loop 13.6 (Loop 2007) 64-bit 4CPU: 2841 +19. Download free chess engines Chess engine is the unique software which is built into the program shell (e.g. Wrath Beta Client there. 'Fritz', 'Arena', 'Shredder') thus multiplying the force.