From 9f589350cf7b5bc9696c86f53d63fcc298d9bb14 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 14 Mar 2020 00:58:52 -0700 Subject: 6141 --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'README.md') 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. -- cgit 1.4.1-2-gfad0 d8193e51e0cfb12cbeaaa8abdaa6f00'>diff stats
path: root/LICENSE
blob: a5893df774e901efb834f9050ed4600a7ebe2d21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13