diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-11-01 18:01:11 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-11-01 18:02:02 -0800 |
commit | ccadc6e604c5cf3779ddc34eef5b075d1dc3cb62 (patch) | |
tree | e7e161d3d5aecfdce3b0fdf30fa67e72ba057e9e /mu.md | |
parent | c694b8e2cb0e4d2b8939f2f7d83a04c0594dbe5b (diff) | |
download | mu-ccadc6e604c5cf3779ddc34eef5b075d1dc3cb62.tar.gz |
7152 - 'return' instruction
https://github.com/akkartik/mu/issues/45#issuecomment-719990879, task 1. We don't have checking for it yet. Soon.
Diffstat (limited to 'mu.md')
-rw-r--r-- | mu.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mu.md b/mu.md index 81c057df..bb8b68c9 100644 --- a/mu.md +++ b/mu.md @@ -85,6 +85,10 @@ fn g { } ``` +You can exit a function at any time with the `return` instruction. Give it the +right number of arguments, and it'll assign them respectively to the function's +outputs before jumping back to the caller. + The function `main` is special; it is where the program starts running. It must always return a single int in register `ebx` (as the exit status of the process). It can also optionally accept an array of strings as input (from the |