AssemblerFuck++

From Esolang
Jump to navigation Jump to search

Creator and Name

AssemblerFuck++ is an esoteric language created by User:Esolang1. This language is AssemblerFuck, with few more features containing if statements, more loops, and an accumulator. (E1-0003)

Code

Syntax

The syntax is simply

   INSTRUCTION PARAMETER(S)

Instructions

   ADD <VALUE>              Adds <VALUE> to current cell
   SUB <VALUE>              Subtracts <VALUE> from current cell
   SET <VALUE>              Sets the current cell value to <VALUE>
   MOV <TARGET>, <OBJECT>   Moves <OBJECT> to <TARGET>
   UNTIL <VALUE>            Executes code until cell value is equal to <VALUE>
   DO <VALUE>               Executes code <VALUE> times
   IF <VALUE>               Executes code if current cell value is equal to <VALUE>
   END                      Marks the end of the code of a loop, or an if statement

<VALUE> can be any non-negative integer. 0 is used to create infinite do loops.

Valid <OBJECT> Content and usage

   P      Pointer, move pointer
   IN     Input, save input

Valid <TARGET> Content and usage

   P      Pointer, save input
   LEFT   Left, move pointer
   RIGHT  Right, move poiner
   OUT    Output, print value

Variables

This language is cell-based and no instructions related to declaring variables exist.

I/O

Inputs and outputs are controlable with the MOV instruction. Getting a single characer input and saving to current cell:

   MOV P, IN

Printing the current cell value:

   MOV OUT, P

Printing the input immediately won't save the input to the cell:

   MOV OUT, IN

Examples

Truth-machine

   MOV P, IN
   IF 48
     MOV OUT, P
   END
   IF 49
     DO 0
       MOV OUT, P
     END
   END

Infinite cat

   DO 0
     MOV OUT, IN
   END