diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-03-14 00:58:52 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-03-14 00:58:52 -0700 |
commit | 9f589350cf7b5bc9696c86f53d63fcc298d9bb14 (patch) | |
tree | cd485be84b463feef9082c98aa9809caa8659ed6 | |
parent | a598d0908272fac002a2786a9c0659961c632fa6 (diff) | |
download | mu-9f589350cf7b5bc9696c86f53d63fcc298d9bb14.tar.gz |
6141
-rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md index abb7fabf..56132726 100644 --- a/README.md +++ b/README.md @@ -291,6 +291,14 @@ Functions are defined using labels. By convention, labels internal to functions (that must only be jumped to) start with a `$`. Any other labels must only be called, never jumped to. All labels must be unique. +Functions are called using the following syntax: +``` +(func arg1 arg2 ...) +``` + +Function arguments must be either literals (integers or strings) or a reg/mem +operand using the syntax in the previous section. + A special label is `Entry`, which can be used to specify/override the entry point of the program. It doesn't have to be unique, and the latest definition will override earlier ones. @@ -298,6 +306,10 @@ will override earlier ones. (The `Entry` label, along with duplicate segment headers, allows programs to be built up incrementally out of multiple [_layers_](http://akkartik.name/post/wart-layers).) +Another special pair of labels are the block delimiters `{` and `}`. They can +be nested, and the instructions `loop` and `break` jump to the enclosing `{` +and `}` respectively. + The data segment consists of labels as before and byte values. Referring to data labels in either `code` segment instructions or `data` segment values yields their address. |