Oreo, it's not clear to us what you are using for a compiler, and for programming, and what physical platform you have for your '877A.

Is your platform just an 877A and a solderless breadboard, or do you have a kit or development board of some sort?

If you're using PIC BASIC or PIC BASIC PRO and haven't already done so, you might consider getting something like the MELabs X-1 board. It's available assembled or as a kit. One nice thing about packages like this is that they often come with several simple routines already tested, working, and you can use them as starting points to learn to do more.

The nice thing about starting with simple, known-good programs is that you can start tinkering with them. As soon as something doesn't work, you can stop and look at your code and learn from what didn't work because you know that the core from which you started did work.