Wiring can be tough to figure out . First find wiring diagrams for both bikes. Trace one component at a time and make notes of any differences you can find between the two.
If both bikes have all the same accessories (horn, lights, etc) then rewire the 1977 just like the 1980 frame is wired. If one bike has turn signals and the other doesn't you might have to get rid of those signals or add them, depending.
I can't imagine that the two engines and wiring harnesses and accessories are very different.. Like all the Blue/W (blue wire with white stripe) on both bikes probably go to the same places. Most other colors probably match up too.
You can do most of the work on paper, by drawing your own 3rd wiring diagram... It could take a couple days if there are a lot of differences between the two bikes.
This may not be easy to do but it's not too hard if you keep it simple and trace one component at a time.