As of now my idea for how the program and interpreter will work goes like this:
- Program will be 127 bytes of array space using signed 8 bit numbers
int8_t program[127];
Digits less than 0 are OP codes. Digits greater than -1 are useable numbers. The largest number a program can use is 127.
OP codes consist of mutiple types:
Symbols: These are symbols such as seperators, comparison, and math symbols.
Registers: 8 total registers numbers can be stored in.
Function registers: store the address of a function
Bultin Functions: Sleep, Deepsleep, Loop, Pin manipulation..
- When the device is first turned on, the program array is empty. The byte and bit position is set at 0:0, if there is a program saved in eeprom, pressing the Save/Load button at this point will allow loading a program.
- Otherwise, the user can begin typing in their program.
- To type in a program, we must do it bit by bit. For example, we want to enter -125 which is Register 3, we need to type in "1000 0101". In this example we will use ">" for next bit, and "T" for toggle.
- T>>>>>T>>T
- Now byte 0 is set to -125! On to the next one!
- Once the program is entered in, we can it the run program and hope we did it right. Or we can save to eeprom.
- As long as the program is in the ram, we can move through the program bit by bit and see what each bit is set at depending on what LED is lit up.
A Paper print out of all OP codes, as well as a notebook to pre-write a program and keep track of what byte/bit of program we are at will be essential.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.