From 1f28c3c733ea3ae4234bff91e1c55e61b1ee3e96 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 31 Jul 2019 01:25:05 +0200 Subject: Starting on asm, implementing extern function call so progress is visible --- doc/Documentation.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'doc') 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\ -- cgit v1.2.3