# Pointy

Jump to navigation
Jump to search

**Pointy** is a language by Ihope127. The basic datatype is the pointer.

## Instructions

The instructions:

LBL foo: not really an instruction, but marks a destination for a DEC jump. CPY x y: stores the value x in memory location y. INC x: increments the value at memory location x. DEC x foo: tries to decrement the value at memory location x. If x already held 0, jumps to foo. OUT x: outputs x. INP x: inputs a value into the memory location x.

Pointers can be dereferenced using the * operator: *x is the value at location x. Since there is a memory location 0 (there is no null pointer), * never fails to produce a result.

## Examples

Hello, World!

CPY 108 1 CPY 111 2 OUT 72 OUT 101 OUT *1 OUT *1 OUT *2 OUT 44 OUT 32 OUT 119 OUT *2 OUT 114 OUT *1 OUT 100 OUT 33

Cat program

LBL start INP 0 OUT *0 DEC 1 start ; the value at 1 will be 0, so this jumps to start

## Computational class

Pointy is Turing-complete because it can simulate a Minsky machine. It can also emulate Brainfuck with a tape that extends infinitely only to the right, as shown in the table below.

Let x store the current cell number, y be an unused value set to 0, and z be free for use.

Brainfuck operation(s) | Pointy operation(s) |
---|---|

> |
INC x |

< |
DEC x |

+ |
INC *x |

- |
DEC *x foo DEC y bar LBL foo CPY 255 *x LBL bar |

, |
INP *x |

. |
CPY *x z OUT *z |

[ |
DEC x foo LBL bar INC x |

] |
DEC x foo DEC y bar LBL foo |