I commonly use GOTO to jump from one Sub to another when there is nothing left to do in the first Sub. This keeps the Stack from building up, and reduces execution time. Working with the Nextion TFT screens, sending UART commands must terminate with $FF $FF $FF, which I often add in a subroutine. Since that is the last part of the operation, I GOTO FfFfFf: from the last part of the Send_Data: routine, then RETURN from FfFfFf:. It saves a couple jumps, which may involve ASM BANKSELs.
Know that you are doing it intentionally, know where your Stack is pointing so you know where you ultimately RETURN to, and it can work to your advantage.





Bookmarks