Neoff

From Esolang
Jump to navigation Jump to search

Neoff (Pronounced “Knee off”/niɔf) is an esolang created by User:RainbowDash.

Neoff has 1 stack and an array of cells. The stack acts as a stack of points that you can "travel" to, meaning that whenever a point is called off the stack the program counter is set to that point like a GOTO command. As for the array of cells it works as ram.

Please note the following. Line numbers are indexed at 1, however the addresses are indexed at 0. Code indents do nothing in this coding language except for making the code look pretty, however new lines are needed.

There are 4 types of variables:

  • Number - 8 bit constant
  • Address - 8 bit
  • Text - No Bit Restriction. (Only used for outputting text)
  • Point - Basically like a Label in BASIC. Points are used to save line numbers and traverse to them.

Some commands need to be specified on which variable type needs to be used for example:

 Disp Text Hello world // Hello World
 Disp Address 0 // Prints value at address
 Disp Number 5 // Prints number 5

Instructions

Instruction Explanation Variable type
Poke # Sets the memory pointer to # Num/Addr
Set # Sets the the memory cell at the pointer to # Num/Addr
Inc # Increments the memory cell at the pointer by # if no arguments are passed it increments by 1 Num/Addr
Dec # Decrements the memory cell at the pointer by # if no arguments are passed it decrements by 1 Num/Addr
Comefrm # When the program counter equals # or point jump to the line number of this instruction ; Comefrom Num/Addr/Point
Goto # Sets program counter to # or point Num/Addr/Point
If # If the memory cell at the pointer is not equivalent to # then skip the next line Num/Addr
Display Outputs a variable, if its an Address it will be outputted in ASCII All
Input Reads a character and puts the corresponding character into the memory cell at the pointer *
Point [Name] Sets a point *
Push [Point Name] Pushes a point to the "travel stack" *
Delete Deletes the top point of the stack *
Travel Pops a point off of the stack then goes to the line number of the point *
// Comment *

Code examples

Hello World

Display Text Hello World

Truth Machine

Poke Number 0
Input
If Number 0 
 Display Number 0
Comefrom 7
If Number 1 
 Display Number 1
Comefrom 4

This is a legacy code so the goto commands don’t use points

Deadfish

Poke Number 0 // Instruction address
Input 

Push Loop // This point will be traveled to after an instruction gets completed

If Number 105 // Increment
    Push Increment
    
If Number 100 // Decrement
    Push Decrement
    
If Number 115 // Square
    Push Square

If Number 111 // Output
    Push Output

Travel // Execute selected instruction

Point Increment
    Poke Number 1
    Inc
    Travel
Point Decrement
    Poke Number 1
    Dec
    Travel
Point Square
    Poke Number 2
    Set Address 1
    Poke Number 3
    Set Address 1 
    Poke Number 1
    Inc Address 2 
    Poke Number 3
    Dec 
    If Number 0
        Goto 40
    Goto 33
    Travel
Point Output
    Poke Number 1
    Display Address 0
    Travel
Point Loop
    Goto 1