Binary License Plate Language

From Esolang
Jump to navigation Jump to search

Binary License Plate Language (or BLPL) is an esolang made by Unname4798, a variant of License plate language.

This language has a stack and an accumulator. They both can hold unbounded signed integers.

Instructions

There are 32 opcodes (the opcode is 5 bits):

  • 0: Increase accumulator by argument.
  • 1: Decrease accumulator by argument.
  • 2: Multiply accumulator by argument.
  • 3: Divide accumulator by argument.
  • 4: Push the accumulator into the stack, argument has no use.
  • 5: Pop the stack and push into accumulator, argument has no use.
  • 6: Input accumulator as Unicode, argument has no use.
  • 7: Output the argument as Unicode, argument has no use.
  • 8: Jump to line argument (0-indexed).
  • 9: Jump to line argument (0-indexed) if accumulator is nonzero.
  • 10: Compare accumulator and stack top, push the result (1 for true, 0 for false) onto stack, argument determines what comparison is to be done: 0 is ==, 1 is !=, 2 is <, 3 is >, 4 is <=, 5 is >=.
  • 11: Calculate accumulator and stack top, push the result onto stack, argument determines what calculation is to be done: 0 (or 6) is + (or 7), 1 (or 9) is -, 2 (or 10) is *, 3 (or 11) is /(floor divide), 4 (or 12) is %, 5 is ** (power).
  • 12: Output the argument (letter) directly.
  • 13: Terminate the program, argument has no use.
  • 14: Input accumulator as integer, argument has no use.
  • 15: Output accumulator as integer, argument has no use.
  • 16: Push a random integer from 0 to 1 onto the stack.
  • 17: Set the accumulator to the length of the stack.
  • 18: Output the program's source code.
  • 19: Clear the stack.
  • 20: Output "Hello, World!".
  • 21: Jump to the start of the program.
  • 22: The same as 21.
  • 23: Push argument into stack
  • 24: access the argument-th value of the stack (from bottom to top, 0-indexed)
  • 25, 26, 27, 28, 29, 30, 31: NOP

The next 11 bits is an argument. Each instruction is 16 bits (2 bytes) total.