-function

The -function signals indicates the beginning of a function.

-function,my_add,1
__my_add_0:
acc 0
pop
add
return

The signal takes two parameters. The first is the name of the function, and the second is the number of arguments that the function takes. The function name is not required to be the same as the label starting the function, and the virtual machine can call functions based on label name or function signal name. Thus, call my_add and call __my_add_0 do the same thing. Local calls are not checked for the number of arguments. This information is used internally to keep track of the function call stack.



Mason Smith 2008-06-11