L'Hexapod: Relative branch out of reach
This article was previously published on lhexapod.com as part of my journey of discovery into robotics and embedded assembly programming. A full index of these articles can be found here.
The test code for the serial command processing code for my serial servo controller is turning out to be the largest piece of assembly language that I’ve written. This means that all of a sudden I’m coming across “Relative branch out of reach” errors during the compile. I’ve got to a point where every time I add a test I have shuffled the code to such an extent that several relative branches need adjusting from rjmp to jmp or rcall to call. Not a great problem but, of course, jmp and call take up more space so the first round of adjustments often triggers a second round, etc. It seems that once you get to the point where your code needs jmp and call its size can just explode due to the fact that you now need to use jmp and call…
Ah well, it’s not a problem really… I’m now at 66 tests and 59% of my code space used up. I’ve got pretty complete coverage up to the “stop servos” command. I have the query commands to test and then I’m finally on to the multiple servo move command… Then I have the PWM code to test, but I expect I’ll take a break from the testing for a while once I get the multiple servo move command to actually work!