Xeroxer

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

Xeroxer is an OISC by User:Pro465. it has only one command:

cpyjmp len, offset | (copy the instructions at the address ip-len..ip (exclusive)
to the end of the program, then jump to ip + offset + 1)

at the start, ip=0, and the interpreter starts executing the first command. when there are no more commands to execute, the program stops. if the current command requires copying n commands, where n > ip, it is Undefined behavior.

Properties

  • Since it is an OISC, the instruction can be made implicit, and programs would simply consist of lists of numbers.
  • Since all the operations happen to the program itself, there is no distinct place for data.
  • It can also simulate tag systems directly.

Extension

because cpyjmp 0, 0 does nothing, implementations may optionally provide output using the previous instruction's len argument encoded as unicode code point when they encounter this.

for example,

0 1
65 0
0 0

should if implemented, print the character 'A'

Examples

Truth machine (kind of)

(Note: uses output extension specified above)

since Xeroxer with output extension has no Input, we need another route. the following program has input in its first instruction as its jump argument. by default, it outputs 0 before halting. change the first line to 0 2 to observe an infinite loop of 1s.

0 1
0 0
0 2
0 5
48 0
0 0
0 4
1 1
49 0
0 0
3 0

not using output extension:

0 0
0 3
0 1
1 0
1 0

See also

External Links