Function Declaration and Use |
---|
Declaring Functions |
---|
Functions can be declared as standard subroutine Function functions, Interrupt functions, and Inline functions (macros).
The Syntax |
---|
|
|
|||
---|---|---|---|
|
|
|||
---|---|---|---|
|
|
|||
---|---|---|---|
|
Calling Functions |
---|
Functions can simply be called by their name as they are in high level languages. It will automatically use the correct jump opcode or insert the code (in the case of inline functions). Standard functions will have the "JSR" opcode for calling, while interrupts will be called with the "JMP" opcode. It addition, it will help prevent errors in your code, such as using a standard subroutine for an interrupt by mistake.
Example |
---|
|