URSL
Jump to navigation
Jump to search
URSL is an esoteric programming language created by user:David.werecat which has a stack, queue, tape, memory array and ten registers.
Instructions
During these examples, numbers 1-9 represent a register argument. There are 10 registers, numbered 0 through 9. The number of the register is used as the argument. Also during the examples, a series of underscores (eg. ___
) represents that there is a code block inside the instruction.
Instruction | Description |
---|---|
a12 |
1 = 1 + 2 |
b1 |
If 1 >= one hundred and twenty eight, set 1 to two hundred and fifty five; otherwise set 1 to zero |
c1 |
1-- |
d12 |
1 = 1 / 2 |
e12 |
1 = 2 |
fo1___? |
If 1 is not zero, execute the enclosed code block |
fz1___? |
If 1 is zero, execute the enclosed code block |
g12 |
Swaps 1 and 2 |
h12 |
1 = 1 modulo 2 |
i1 |
1++ |
j1 |
Jumps 1 instructions ahead |
k1 |
Dequeue a value from the queue and store it in 1 |
lo1___/ |
Loops the enclosed code block while 1 is not zero |
lz1___/ |
Loops the enclosed code block while 1 is zero |
m12 |
1 = 1 * 2 |
n12 |
1 = 1 and 2 |
o12 |
1 = 1 or 2 |
p1 |
Pop a value from the stack and store it in 1 |
q1 |
Enqueue 1 in the queue |
r1 |
Read a character into 1 |
t |
Terminates the program |
u |
Push the value of 1 into the stack |
v1__- |
Set 1 to the numeric value enclosed in the code block |
w1 |
Write character 1 to the console |
x12 |
1 = 1 xor 2 |
y1 |
Cycle the registers 1 times |
z1 |
Set 1 to zero |
|< |
Move the tape left |
|> |
Move the tape right |
|^1 |
Write 1 to the tape |
|v1 |
Read a value from the tape and store in 1 |
&12 |
Read a value from memory address 2 and store in 1 |
*12 |
Write a value 1 to memory address 2 |
# |
Beep |
~ |
Clear the console |
% |
Throw an error |
$ |
Sleep for one second |
\___\ |
An infinite loop |
@ |
Break from an infinite loop |
!1 |
Write integer 1 to the console |
All spaces, tabs, newlines and ;
's are treated as whitespace. Comments are not possible.
Examples
CAT Program
\r0w0\
Hello, world!
v072-w0v0101-w0v0108-w0w0v0111-w0v044-w0v032-w0v0119-w0v0111-w0v0114-w0v0108-w0v0100-w0v033-w0