RETURN statement

The return statement is used within a function to return the result of the function or to cause the function to return before it reaches its end.
proc ubyte add_func(ubyte arg1, ubyte arg2)
	return arg1 + arg2
endproc

proc ubyte sub_func(ubyte arg1, ubyte arg2)
	return arg1 - arg2
endproc

proc main()
	ubyte	A, B, C

	// equivalent to A = B + C
	A = add_func(B, C)

	// equivalent to A = B - C
	A = sub_func(B, C)

	// equivalent to A = (B + 2) - (C + 3)
	A = sub_func(add_func(B, 2), add_func(C, 3))

endproc