Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start bytecode language #6

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Start bytecode language #6

wants to merge 5 commits into from

Conversation

JamesNewton
Copy link
Owner

Including opcodes, registers, saving to EEPROM via quoting, convert address to value, etc...
The layout of the memory is probably not great. All those additions and subtractions of offsets... Needs a bit of a re-think to avoid the code getting "tricky"

Including opcodes, registers, saving to EEPROM, convert address to value, etc...
Add define (via quote), stack, call, return. 

Remove Servo/Stepper to simplify debugging
- Check for and initialized EEPROM if first run or invalid data. 
- Limit program space in EEPROM for chips with large memory.
- printreg displays the value of the register as well as EEPROM at its address.
- moved existing "?" display code into display_status
- only '.' does a return. cr just ends lines / 
- move commands into switch: ')', '@', '!'
- no longer copy p into n if n is 0 and no longer zero out n after every command. Not sure why we did that, other than to keep a pin number from one line to the next. But we can do that in the pin control command?
- Give up on I2C commands to free up ')' and '.' which also simplifies '-' and frees up '(' and '_'. Eventually '(' is for parameters. Maybe use '_' to clear when cr isn't available? Hopefully I2C can be implemented in the actual langauge. Or as a mode change / sub engine.
Digital ONLY pins are now differentiated from analog pins. e.g. on Arduino Uno, 2 to 13 are digital only, 14 to 19 are analog (or digital) but we read them via analog. This allows I and P to be used to read values inside a program, since ? is a conditional branch. e.g. 2I will read pin 2 and set n to 0 or 1. 14I will read pin 14 aka A0 and set n to the analog value read on the pin.
e.g. 
a"ab""cd.".
makes a point to:
ab"cd.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant