I have noticed two things about functions that differ from or are not mentioned in the documantation:
- Functions do not need an "end" statement. If you include one, then the compiler will give you a warning. The only time you would have an "end" statement was if your function was inline asm, and you include the "end" to end the assembly block.
- Functions must be called from the same bank they were defined. There appears to be no direct way to call a function in another bank. If you wish to duplicate a function in another bank, it needs to have a different name, and have any labels within the function renamed as well.