Have Dog Health Questions? Ask a Dog Vet Online.
It is not possible to tell you exactly where the pain is coming from without an exam and diagnositics.
When a dog yelps suddenly with pain as you describe it is quite often due to a joint or spinal problem. A herniated or partially herniated disc in the neck or lower back is a good possibility. A thourouh exam and x-rays will be needed to arrive at a proper diagnosis. Joint and spinal problems cannot be diagnosed with blood work alone.
Dogs with spinal problems quite ofen are reluctant to move up and down stairs or get on and off a couch or a chair because doing so creates additional pressure on the spine which provokes a sharp pain response.
The yelping you describe indicates extreme pain and I would suggest getting an appointment for an exam as soon as possible so the pain source can be identified and a treatment plan developed.