BoolSpool

From Esolang
Jump to navigation Jump to search

Created by User:DocHerrings on July 10th, 2011, BoolSpool is an attempt by the author to create a language in which reduction to brainfuck is non-trivial, if not difficult. It is currently unknown if BoolSpool is Turing Complete, as the specifications are not yet finished.

Data Structures

BoolSpool has two major data structures - the track and the drum, which is composed of 8 spools.

The Track

The track is an right-infinite array in which every cell contains 0 bits. A visualization is below:

Cell 1 00000000
Cell 2 00000000
Cell 3 00000000
         ....

The Drum

The drum is composed of 8 spools, each of which is made up of 8 bits. The spools can rotate freely, and the order of the spools on the drum can be rotated as well. The head spool is the one that is first on the drum (the leftmost spool in the visual), and the first row of the drum is known as the write head (in square brackets). A visualization is below:

0[| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |]
1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |

Instruction Set

All instructions are composed of 8 bits. All non-binary characters are ignored. All instructions have three parts, the operator code, the data trit, and the memory trit. The memory trit determines what portion of memory is being accessed. The mapping is as follows:

000 and 100 Spool pointer
001 and 101 Drum
010 and 110 Track pointer
011 and 111 Track

The following maps the

(OP)(DAT)(MEM)
00->
 	Spool pointer -> Increment pointer by data amount
 	Drum -> NXORS the head spool with the data trit (which is padded to 0 bits by 0's on the right)
 	Track pointer -> Increment pointer by data amount
 	Track -> NANDs the track with the data'th spool 

01->
 	Spool pointer -> Decrement pointer by data amount
 	Drum -> Rotate current spool data spaces
 	Track pointer -> Decrement pointer by data amount
 	Track -> Zero the data'th bit and zero data'th spool

10->
 	Spool pointer -> Output head spool as char (after a bit shift of data)
 	Drum -> Remove a character from the stndin and place it's binary representation (padded to 8 bits) in the data'th tumbler
 	Track pointer -> Output track data as char (after a bit shift of data)
 	Track -> Remove a character from the stndin and place it's binary representation (padded to 8 bits) on the track (after a bit shift of data)
11->
        Unfinished

Examples

Hello World

In progress. Currently prints "HELLO". A commented version will be added when the program is complete.

00100001
01100001
00010001
10000000
01000111
00101001
01011001
00010001
10000000
01000111
00110001
01100001
00010001
10000000
10000000
01000111
00100001
01101001
00111001
01001001
00000001
01011001
00010001
10000000

Without optional linebreaks:

001000010110000100010001100000000100011100101001010110010001000110000000010001110011000101100001
000100011000000010000000010001110010000101101001001110010100100100000001010110010001000110000000