aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-07-31 01:25:05 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit1f28c3c733ea3ae4234bff91e1c55e61b1ee3e96 (patch)
tree0ab52e362da03fde741ce8159ef8a4110cd1fb6a /doc
parentec1a48e7b86fcd00127dd5a88d56c42083af1d78 (diff)
Starting on asm, implementing extern function call so progress is visible
Diffstat (limited to 'doc')
-rw-r--r--doc/Documentation.md24
1 files changed, 13 insertions, 11 deletions
diff --git a/doc/Documentation.md b/doc/Documentation.md
index 5564b05..3e60994 100644
--- a/doc/Documentation.md
+++ b/doc/Documentation.md
@@ -2,19 +2,21 @@
Variable length opcodes. Sizes range from 1 to 4 bytes.
## Instruction formats
Instructions can be in 6 different formats:
-1. 1 byte: Opcode
-2. 2 bytes: Opcode + register
-3. 3 bytes: Opcode + register + register
+1. 1 byte: Opcode(u8)
+2. 2 bytes: Opcode(u8) + register(u8)
+3. 3 bytes: Opcode(u8) + register(u8) + register(u8)
4. 3 bytes:\
-4.1 Opcode + intermediate\
-4.2 Opcode + data\
-4.3 Opcode + index\
-4.4 Opcode + offset
-5. 4 bytes: Opcode + register + register + register
+4.1 Opcode(u8) + intermediate(u16)\
+4.2 Opcode(u8) + data(u16)\
+4.3 Opcode(u8) + offset(i16)\
+4.4 Opcode(u8) + num_reg(u16)\
+4.5 Opcode(u8) + register(u8) + num_args(u8)
+5. 4 bytes: Opcode(u8) + register(u8) + register(u8) + register(u8)
6. 4 bytes:\
-6.1 Opcode + register + offset\
-6.2 Opcode + register + intermediate\
-6.3 Opcode + register + data
+6.1 Opcode(u8) + register(u8) + offset(i16)\
+6.2 Opcode(u8) + register(u8) + intermediate(u16)\
+6.3 Opcode(u8) + register(u8) + data(u16)
+7. 4 bytes: Opcode(u8) + index(u16) + num_args(u8)
# Compiler flow
(Tokenize&parse -> Resolve AST -> Generate SSA -> Generate bytecode) -> Generate program\