aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/Documentation.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/Documentation.md b/doc/Documentation.md
index 8b2133e..adb0bef 100644
--- a/doc/Documentation.md
+++ b/doc/Documentation.md
@@ -8,18 +8,18 @@ Instructions can be in 7 different formats:
4. 3 bytes:\
4.1 Opcode(u8) + intermediate(u16)\
4.2 Opcode(u8) + data(u16)\
-4.3 Opcode(u8) + offset(i16)\
+4.3 Opcode(u8) + label(i16)\
4.4 Opcode(u8) + register(i8) + num_args(u8)
5. 4 bytes: Opcode(u8) + register(i8) + register(i8) + register(i8)
6. 4 bytes:\
-6.1 Opcode(u8) + register(i8) + offset(i16)\
+6.1 Opcode(u8) + register(i8) + label(i16)\
6.2 Opcode(u8) + register(i8) + intermediate(u16)\
6.3 Opcode(u8) + register(i8) + data(u16)\
6.4 Opcode(u8) + flags(u8) + num_local_var_reg(u16)
7. 5 bytes: Opcode(u8) + index(u16) + num_args(u8) + register(i8)
## Registers
Registers have a range of 128. Local variables start from register 0 and increment while parameters start from -1
-and decrement.
+and decrement. Registers have the scope of functions and reset after instructions reach a new function (AMAL_OP_FUNC_START).
# Compiler flow
(Tokenize&parse -> Resolve AST -> Generate SSA -> Generate bytecode) -> Generate program\