diff options
| author | 2023-02-25 21:01:03 +0000 | |
|---|---|---|
| committer | 2023-02-25 21:01:03 +0000 | |
| commit | 09d636c02cdbb13d10f1435d918cc36116715fc4 (patch) | |
| tree | c7099a6c49ffa4521e144c5ed5a19186d08ec1ec /README.md | |
| parent | get rid of unused lablen (diff) | |
export creole_decode; add db test
Diffstat (limited to '')
| -rw-r--r-- | README.md | 27 |
1 files changed, 17 insertions, 10 deletions
@@ -1,9 +1,15 @@ -Creole is a bytecode designed for simple implementations. +Creole is a bytecode designed for microcontrollers. It's C source file +is less than 1000 lines long and does not depend on the C standard +library. ## Bytecode Format -Each creole line consists of pseudo-UTF-8 characters. The first byte -is an unsigned number between 0 and 127 (the high bit is clear). Each +The syntax of creole instructions are + + [1 byte opcode][2 or more byte instruction]*[1 byte all zero] + +Each creole instruction consists of pseudo-UTF-8 characters. The first +byte is an unsigned number between 0 and 127 (the high bit is clear). Each suceeding pseudo-UTF-8 character is encoded as follows: * `110HHHHx 10xxxxxx` @@ -13,19 +19,20 @@ suceeding pseudo-UTF-8 character is encoded as follows: * `1111110H 10HHHxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx` * `11111110 10HHHHxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx` -The first four bytes determine the type. The LSB high bit determines -if the encoded value is a register (`0001`) or immediate (`0010`). +The first four bits determine the type. The LSB high bit determines +if the encoded value is a register (`0001`) or immediate (`00X0`). The second bit from LSB determines if the value should be treated as a signed 32 bit two's compliment number (`001X`) or should be -treated as an unsigned 32 bit number (`000X`). +treated as an unsigned 32 bit number (`000X`). All other values for +the high bits are reserved. -All other values are reserved. Overlong values are allowed, and for some -argument values they are necessary. All lines are terminated by a byte -of all zeros. +The rest of the bits encode a number that is up to 32 bits long. +Overlong encodings are accepted and sometimes used. ## Assembler -The macro assembler is Python (see the asm directory). +The macro assembler is Python (see the asm directory). The macro +assembler supports virtual instructions and jumps with named labels. ## Design Philsophy |
