I have added a multi-pass Assembler script, limited to assembling a single node at a time.
To use, you will need to open the script and edit the paths for the files to fit your own environment. The first file is the one you wish to compile, the second and third are output files for the build process. The third file outputs the program in Hex, then labels after the ':' and constants after the '$'.
This output can then be uploaded to the microcontroller running the Basic Execution Node emulator.
Example Input:
THAT:
MOV LEFT RIGHT
MOV DOWN LEFT
ADD UP
ADD 255
JMP THAT
Example Output:
0xd
0x21
0x93
0x97
0xcc
: 0x0
$ 0xff
You can see how these HEX values map to our opcodes.
13: MOV(LEFT,RIGHT)
33: MOV(DOWN,LEFT)
etc. etc.
If you don't read HEX you can either take my word, learn hex, or use a handy-dandy hex converter (which is what I do for bigger numbers): http://www.binaryhexconverter.com/hex-to-decimal-converter
I'll be uploading the Arduino code to run a single node in serial interactive mode in the next day or two.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.