Demons

From Esolang
Jump to navigation Jump to search

Demons

Demons is a Esolang with one byte large instructions natively, and it is intended to be able to run *Any* file it is given, churning out a output or a crash.

Basic opcodes

  • 00 | No-op
  • 01 | Move pointer up one
  • 02 | Move pointer down one
  • 03 | Shift value under pointer up one
  • 04 | Shift value under pointer down one
  • 05 | Add the current value under pointer and the value under the address specified by the next n bytes (Interpreter dependent)
  • 06 | Subtract current value under pointer and the value under the address specified by the next n bytes (Interpreter dependent)
  • 07 | Multiply the current value under pointer and the value under the address specified by the next n bytes (Interpreter dependent)
  • 08 | Divide the current value under pointer and the value under the address specified by the next n bytes (Interpreter dependent)
  • 09 | Print the current value under the pointer to the stream (STDOUT)
  • 0A | Put the input from the stream into the value under the pointer (STDIN)
  • 0B | Clear the stream (STDIO)
  • 0C | Jump n many spaces from current location
  • 0D | Jump n many spaces from the entrance point
  • 0E | Compare the current value under the pointer to the value under the address specified by the next n bytes (Interpreter dependent), if they are not equal, skips the next operation
  • 0F | Compare the current value under the pointer to the value under the address specified by the next n bytes (Interpreter dependent), if the first one is not larger, skips the next operation
  • 10 | Compare the current value under the pointer to the value under the address specified by the next n bytes (Interpreter dependent), if the first one is not smaller, skips the next operation
  • 11 | Test if the current value under the pointer is nonzero, if so, skips the next operation
  • 12 | Test if the current value under the pointer is non negative, if so, skips the next operation
  • 13 | Ends the program
  • 14 | IF block, defined like IF (Statement) {Demons code}
  • 15 | Begins statement block
  • 16 | Tells the statement of success
  • 17 | Tells the statement of failure
  • 18 | Ends the statement block and begins the code block
  • 19 | Ends the code block
  • 1A | WHILE Block, defined like WHILE (Statement) {Demons code}
  • 1B | Waits the amount of ms stated by the current value under the pointer
  • 1C | jumps back to pointer value of 0 (the one for the interpreter's beginning of demons mem segment)
  • 1D | Stores the value from n in the code, based from the entrance point

Demons Memory management

Demons has a memory management system similar to brainfuck, a infinite number of values on a 'tape',

Printing

Demons handles all characters in the ansii character set

Interpreters

None yet, the language is purely theoretical for now

Sample code

None, yet again