diff options
Diffstat (limited to 'mu.md')
-rw-r--r-- | mu.md | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mu.md b/mu.md index 4c2f5226..f5401f58 100644 --- a/mu.md +++ b/mu.md @@ -7,7 +7,7 @@ Mu programs are sequences of `fn` and `type` definitions. Define functions with the `fn` keyword. For example: ``` - fn foo arg1: int, arg2: int -> result/eax: boolean + fn foo arg1: int, arg2: int -> _/eax: boolean ``` Functions contain `{}` blocks, `var` declarations, primitive statements and @@ -36,6 +36,12 @@ Primitives can often write to arbitrary output registers. User-defined functions, however, require rigidly specified output registers. Notice how the definition of `foo` above writes to `eax`. +A function's header names its inouts, but not its outputs (hence the `_` +above). + +All Mu programs must define at least one function: `main`. That's where they +begin executing instructions. + ## Variables, registers and memory Declare local variables in a function using the `var` keyword. As shown above, |