Post by Amelorate on Jan 27, 2015 3:04:55 GMT
This is the first of many of the programing languages the game will include. There probably won't be languages like lua in the game, I'm thinking things like FORTH, perhaps a something like C, but nothing too easy.
This assumes a basic knowledge of BrainFuck.
Concepts:
Byte Array -- Same as BF.
Pointer -- Same as BF.
Secondary Pointer -- Basically another pointer used for outputting to pins and self-programing.
I/O Data -- Always a 8 bit number, 0 always indicates no data, so you can't send 0.
Input Bus -- This applies to all components, but instead of storing received data, it instead requests the data. There are multiple pins you can input from, each connected to different components.
Output bus -- Stores data output to it. When data is requested, it sends the least recent piece of data that was set to be output.
Pin 0 Out -- Sends data relevant to the interpreter, like error codes and responces to requests for data from pin 0 in.
Pin 0 In -- Takes data and acts upon it to change how the program is executed.
Instructions:
+ -- Same as BF.
- -- Same as BF.
> -- Same as BF.
< -- Same as BF.
^ -- Set the value of the secondary pointer to the value of the current byte.
. -- Send the current byte to the output pin at the secondary pointer.
, -- Read from the input pin at the secondary pointer to the current byte.
[ -- Same as BF.
] -- Same as BF.
` -- Set the portion of the code at the secondary pointer to the value of the current byte.
Pin 0 Inputs:
1 -- Flash the default reprogramming program.
2 -- Reset the program to the beginning.
3 -- Multiply the byte size in bits by 2 and reset the program. Maxes out at 64.
4 -- Divide the byte size in bits by 2 and reset the program. Mins out at 8.
5 -- Output the current byte size to pin 0.
Pin 0 Outputs:
1-4 -- Raze this to the 2nd power to find the maximum number the program can keep track of. Sent in response to a request to the input pin 0.
5 -- Error in the execution of the program. The error code is sent afterwards.
Error Codes:
1 -- Unclosed brackets. Stops Program.
2 -- Undefined value for program instruction. Stops Program.
I'll probably add more to this specification as time goes on, but this is what I have so far.
This assumes a basic knowledge of BrainFuck.
Concepts:
Byte Array -- Same as BF.
Pointer -- Same as BF.
Secondary Pointer -- Basically another pointer used for outputting to pins and self-programing.
I/O Data -- Always a 8 bit number, 0 always indicates no data, so you can't send 0.
Input Bus -- This applies to all components, but instead of storing received data, it instead requests the data. There are multiple pins you can input from, each connected to different components.
Output bus -- Stores data output to it. When data is requested, it sends the least recent piece of data that was set to be output.
Pin 0 Out -- Sends data relevant to the interpreter, like error codes and responces to requests for data from pin 0 in.
Pin 0 In -- Takes data and acts upon it to change how the program is executed.
Instructions:
+ -- Same as BF.
- -- Same as BF.
> -- Same as BF.
< -- Same as BF.
^ -- Set the value of the secondary pointer to the value of the current byte.
. -- Send the current byte to the output pin at the secondary pointer.
, -- Read from the input pin at the secondary pointer to the current byte.
[ -- Same as BF.
] -- Same as BF.
` -- Set the portion of the code at the secondary pointer to the value of the current byte.
Pin 0 Inputs:
1 -- Flash the default reprogramming program.
2 -- Reset the program to the beginning.
3 -- Multiply the byte size in bits by 2 and reset the program. Maxes out at 64.
4 -- Divide the byte size in bits by 2 and reset the program. Mins out at 8.
5 -- Output the current byte size to pin 0.
Pin 0 Outputs:
1-4 -- Raze this to the 2nd power to find the maximum number the program can keep track of. Sent in response to a request to the input pin 0.
5 -- Error in the execution of the program. The error code is sent afterwards.
Error Codes:
1 -- Unclosed brackets. Stops Program.
2 -- Undefined value for program instruction. Stops Program.
I'll probably add more to this specification as time goes on, but this is what I have so far.