The best starting point for your research is 50th Virginia Infantry by John D. Chapla. This book was published in 1997 as part of the Virginia Regimental Histories Series, ISBN-1-56190-100-8. Mr. Chapla's book is one of the best in the entire series.
Prices on this book vary from $25 to almost $100 online. It can be purchased for $25 new, 1st edition and signed by the author at Morningside Bookshop in Dayton, Ohio [1-800-648-9710], Baine's Books and Coffee in Appomattox, Va. and Farnsworth House Inn in Gettysburg, Pa.
I did a little checking for Mr. Cox in various census, military and prisoner-of-war records and find him listed as A. Madison Cox, A. M. Cox, Madison Cox, Alphus Cox and Alford Cox.