Dios Ultra Language Overview

Updated on 10/31/2008

Back to Dios Ultra Home Page

 

Function Declarations

Code must be placed inside functions.  Functions are declared with the func statement.  Each function must be ended with the endfunc statement. 

func main()

 ..........

 ..........

endfunc

Also note that the first function in your program does not have main().  I just do it for consistency.   The first function is always the entry point into your chip.

 

Calling User Functions

To call one of your own functions just use the name.

func main()

     domyfunc()

endfunc

 

func domyfunc()

    ......

endfunc

 

Variable Declarations

There are two types of variables local and global variables.   To declare a local variable use the dim statement.  To declare a global variable use the global statement.

dim myvarb

global myothervarb

Global statements can be defined any where in you program file.

You can pass values to variables by including them as shown.

func main()

     domyfunc(21,5)

endfunc

 

func domyfunc(varb1,varb2)

    ......

endfunc

As shown above you may pass a hard coded value.  You may also pass the value of a variable as well.  To return a value use the exit command as shown.

func main()

   dim ret

   ret = domyfunc(21,5)

endfunc

 

func domyfunc(varb1,varb2)

    exit(varb1 + varb2)

endfunc

If a variable is declared in the func statement as shown above its just like using the dim command.

That gives you a rough example of what the syntax is like.  Just keep in mind you can have if statements and gosub's and goto's within each function.

 

Back to Dios Ultra Home Page