Brainasm

From Esolang
Jump to navigation Jump to search

BrainASM is an language that compiles to brainfuck.

Notation used in this article

Letters like a, b and c are positions (if a=3, then think that a in the instruction code as ">>>" in the code. If it is -3, think it as "<<<"). Dont forget that a is a, and (-a) is the negated version of a.

A tip

Set "a" and "b" equal in subcell. Or you get a corrupted memory.

Instructions

movpointer (a) will move the pointer forwards as much as wanted. (All commands can use negative numbers for going backwards in the tape) (Compiled to "a") mov (a) will move the current cell ... steps forward. Essentially 2 mov commands are addition. (Compiled to "[a-(-a)+]") glideforward is [>] and glidebackward is [<]. duplicate (a) (b) (c) duplicates the value to cells b and c. (Note: these positions are just the distance of C from B and B from A which will get removed) Also dont forget that it deletes the value. (Compiled to [(-a)-b+c+]) emptycell will empty the cell as expected. (Thats what [-] does.) outcell simply outputs the character in the cell, being "." obviously. incell is the opposite of outcell, compiled to ",". You think i would forgot. But we have subcell (a) (b) (compiles to "[a-b-]") And... loop, which is just "{}" which compiles to "[]".

Also i wanna see ur programs!!!!