DCI

From Esolang
Jump to navigation Jump to search

DCI (Decrement then Copy [if successful]) is an OISC.

Specifications

  • address 0 is always 1.
  • IP is mapped to 1.
  • the commands are memory mapped from addresses 2 to infinity. the values beyond the commands are initially 1.
    • IP=0 means address 2, etc.
  • decrementing IP when it's 0 will halt the program, which runs in an infinite loop.

The operation

The operation DCI, takes 4 arguments a,b,c and d.

C pseudocode is:

if(*a>0){--*a;if(b)*c=b;else *c=*d;}*((int*)1)+=4;/*4 arguments as a command*/

Examples

Infinite loop

10 2 10 0
10 0 1 5

Computational class

I don't know, but as the integers are unbounded and the ability to infinite loop, I think it's TC.