Jackass

From Esolang
Jump to navigation Jump to search

Jackass is a stack-based language made by User:Phase. The way it operates is inspired by Brainfuck, but the syntax is pure hexadecimal.

Syntax

A program is split up into different hexadecimal commands separated by spaces.

01 02 02

Pushes 2 to the stack and pops it off.

Operation List

The operations are in the order I thought of them in, so they're completely out of order and are meant to be that way. This list is not complete by any means, I will be adding more once I recharge my computer.

Operation Description
01 push the next value to the stack
02 pop the top of the stack off
03 swap the top two values on the stack
04 move the third value on the stack to the top
05 pop the top of the stack, go to that line in the program
06 clone the top of the stack
07 add the top two values on the stack and push the result
08 subtract the top two values on the stack and push the result
09 multiply the top two values on the stack and push the result
0a divide the top two values on the stack and push the result
0b mod the top two values on the stack and push the result
0c print the top of the stack as a number
0d print the top of the stack as a character
0e push input from stdin as a number
0f push input from stdin as a string (splitting it up into characters and pushing the value of each one)

Examples

Cat program

An infinitely repeating numeric cat program shall be demonstrated:

0e 0c 01 00 05

Hello, World!

This program prints “Hello, World!”:

01 48 0d 02
01 65 0d 02
01 6C 0d 02
01 6C 0d 02
01 6F 0d 02
01 2C 0d 02
01 20 0d 02
01 57 0d 02
01 6F 0d 02
01 72 0d 02
01 6C 0d 02
01 64 0d 02
01 21 0d 02

Truth-machine

A truth-machine in this language follows:

0e 0c 01 0c 09 03 02 01 0d 08 03 02 03 02 05

Interpreter

Untested Interpreter based on spec at time of writing. Care to write a Hello World?

Common Lisp implementation of the Jackass programming language.