Close

User IO

A project log for Brainf*cktor

Standalone brainf*ck computer in less than 1kB of code

jaromirsukubajaromir.sukuba 01/04/2017 at 00:580 Comments

The user interface of Brainf*cktor may not be obvious for totally unconcerned person, so here is short help, partially for my back reference too.

Display is divided into three parts; first row showing the actual program. The whole buffer is divided into pages of 16 bytes, and only one page is shown. The actual page number is shown in hexadecimal format next to the P symbol after the program buffer. When the interpreter finds non-BF symbol, it is ignored.

Second row is similar to the first row, but displaying the input buffer. It is the buffer of characters the interpreter will use whenever asked for data input, byte after byte. When the interpreter can't take any more input, it will finish its execution. When the BF program doesn't use the , symbol, input buffer is not touched at all and can be left empty.

Third line, output buffer shows the last 16 characters outputted from BF interpreter. It is FIFO buffer.

The program buffer or input buffer is editable. User can edit character under cursor, shown as inverted character. Here the cursor is on program buffer, ready to edit first character.

Alternating between editing the program or input buffer is done via dedicated key.

Keyboard consists of 8 keys. The left red key allows to switch between editing of program or input buffer.

Right red key allows running the program; while running the program, red LED under the display is on. The remaining 6 keys do the actual editing action. Green keys allow do decrement or increment the cursor (pointer) position, blue keys change the actual value by one position in ASCII table, while the yellow ones jump by 8 values. By default the values are at 0, so to enter A (=0x41 hex) it is required to press 8x (8x8=64=0x40) top yellow (V+8) and once (1+64=65=0x41) top blue (V+1) key. To enter dot on following buffer location, it is needed to press top green (move to next character), then 6 x top yellow and twice bottom blue (6x8 - 2 = 46 = 0x2E).

Discussions