Brain-os source code (not an esolang but an esolang-built OS)
This is some code for an Brainfuck operating system. Everyone is free for editing but do not vandalize the system.
enter something
Editing guide
This is the editing guide. This is information for how to edit the code.
Memory layout
The tape is layed out as follows:
value: 0 n+2 1 1 m+2 1 1 ... type: c v c c v c c ...
where c denotes a constant and v denotes a variable. This layout must be used when making programs.Note that when operating on a variable, first a number of arrows is used until the variable is reached, then >[-]+>[-]+<<-- is ran, the instruction is performed, [<]x++ is performed(where x goes the the variable cell we are working with again, and [<] is ran, to return to the starting value. Note that the constant one's are generated every time a variable is accessed.
Going to an specific address
The tape can be layered as:
Address, value, Address, value... (For bigger addressing: Address16, Value, Address, Address16, Value, Address, Address16, Value, Address, Address16, Value...)
(NOTE: there is an zero at the start to keep an memory start and we need to use "--" before using an value, but not to forget to "++" it back for it to be nonzero)
The program can use memory addresses to help reading values.
To go to the start, we can use [<]. This means that to not interrupt the memory at dangerous scales,
which means that we must keep the memory nonzero.
Setting a cell to 1 is [-]+ which now will be for zero in this context.
An addition operation with the next adress look like this: ->-<[->>+<>]+>+<.
This blocks data corruption by reversing the values and does the same thing. 255 + 255 would still be zero, but will NOT be performable.
Getting to an specific address would be "[->>-<<[->>+<<]+>>+<<>>]" (CONFIRMATION NEEDED).
Memory sections
Adding memory sections would help a lot. To travel to the next section, [>], to travel to the previous section, [<]<[<] will do.
Also the 8-bit indexing is still valid, and even better with memory sections. The code [>>[->>+<<]<<[-]+>>-][-]+ (CONFIRMATION NEEDED) can get to a spesific value in a memory cell (still on the zero is one model)