diff options
author | Adrian Thurston <thurston@complang.org> | 2015-01-27 16:59:22 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2015-01-27 16:59:22 -0500 |
commit | 6f9c7f12e3888c525a4b9be7712294929d690790 (patch) | |
tree | d53632c5fd2ee42df1f0ef45ab824e896e000d88 /src/bytecode.h | |
parent | 09c75e4b10915cb32786d2482af6727841659b80 (diff) | |
download | colm-6f9c7f12e3888c525a4b9be7712294929d690790.tar.gz |
first cut of value-based ints, test cases pass
Diffstat (limited to 'src/bytecode.h')
-rw-r--r-- | src/bytecode.h | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/src/bytecode.h b/src/bytecode.h index a41c3cd7..5c029ec6 100644 --- a/src/bytecode.h +++ b/src/bytecode.h @@ -41,6 +41,7 @@ typedef unsigned long colm_value_t; /* */ + #define IN_LOAD_INT 0x01 #define IN_LOAD_STR 0x02 #define IN_LOAD_NIL 0x03 @@ -54,19 +55,32 @@ typedef unsigned long colm_value_t; #define IN_MULT_INT 0x0a #define IN_DIV_INT 0x0b -#define IN_TST_EQL_TREE 0x0c #define IN_TST_EQL_VAL 0x59 -#define IN_TST_EQL 0x0c +#define IN_TST_EQL_TREE 0x0c +//#define IN_TST_EQL 0x0c #define IN_TST_NOT_EQL_TREE 0x0d #define IN_TST_NOT_EQL_VAL 0x5f -#define IN_TST_LESS 0x0e -#define IN_TST_GRTR 0x0f -#define IN_TST_LESS_EQL 0x10 -#define IN_TST_GRTR_EQL 0x11 -#define IN_TST_LOGICAL_AND 0x12 -#define IN_TST_LOGICAL_OR 0x13 - -#define IN_NOT 0x14 +#define IN_TST_LESS_VAL 0x0e +#define IN_TST_LESS_TREE 0xbd +#define IN_TST_GRTR_VAL 0x0f +#define IN_TST_GRTR_TREE 0xbf +#define IN_TST_LESS_EQL_VAL 0x10 +#define IN_TST_LESS_EQL_TREE 0xc0 +#define IN_TST_GRTR_EQL_VAL 0x11 +#define IN_TST_GRTR_EQL_TREE 0xcd +#define IN_TST_LOGICAL_AND_VAL 0x12 +#define IN_TST_LOGICAL_AND_TREE 0xce +#define IN_TST_LOGICAL_OR_VAL 0x13 +#define IN_TST_LOGICAL_OR_TREE 0xcf + +#define IN_TST_NZ_TREE 0xd1 + +//0xd3 +//0xd4 +//0xd5 + +#define IN_NOT_VAL 0x14 +#define IN_NOT_TREE 0xd2 #define IN_JMP 0x15 #define IN_JMP_FALSE_TREE 0x16 @@ -370,6 +384,8 @@ enum TYPE TYPE_ITER = 0x04, TYPE_STRUCT = 0x05, TYPE_GENERIC = 0x06, + TYPE_INT = 0x07, + TYPE_BOOL = 0x08, }; /* Types of Generics. */ @@ -385,10 +401,8 @@ enum GEN { enum LEL_ID { LEL_ID_PTR = 1, LEL_ID_VOID = 2, - LEL_ID_BOOL = 3, - LEL_ID_INT = 4, - LEL_ID_STR = 5, - LEL_ID_IGNORE = 6 + LEL_ID_STR = 3, + LEL_ID_IGNORE = 4 }; /* |