GOSUB label
GOSUB ( expression )
[GOSUB] function/sub
or
CALL label
[CALL] function/sub
CALL ( expression )
GOSUB is supported for backward compatibility, now FUNCTIONs and SUBs would be the
preferred method. The GOSUB keyword is not required for calling a SUB
or FUNCTION.
Execution jumps to a subroutine marked by line label. Always use RETURN to exit a GOSUB, execution will continue on
next statement after GOSUB.
label may be defined as any valid identifier followed by a
colon, and can be defined before or after the GOSUB. Do not include the colon in
the GOSUB.
GOSUB or CALL preceeding a FUNCTION or SUB is optional, and is allowed for backward compatibility with other BASICs. When GOSUB/CALL a FUNCTION the return value is discarded.
GOSUB or CALL (expression) will compute the expression and then call the resulting address, Nost of our parts are running ARM Thumb code, so the least significant bit of that expression should be 1.
Forward declarations-
BASIC does not have a mechanism for defining SUB or FUNCTION ahead of their actual definition. But for callback from an interrupt, a mechanism for calling a SUB has been added. The SUB can not accept any parameters, and can not be a FUNCTION returning a value.