SS (CatLooks)
(Redirected from Ss)
SS is an esoteric programming language created by CatLooks.
Overview
Each line in SS is written in int [byte]
style.
It uses console I/O, has 2 registers and 256 bytes of shelf memory.
Memory
There're 2 registers: data
& buffer
. Each of them contain a single byte representing an unsigned integer.
For more space we have 256 bytes of shelf memory. Shelf memory is a type of memory similar to stack memory.
When you push a byte, everything moves to the left and the last byte is overwritten with value in data
.
When you pop a byte, everything moves to the right and the last byte is moved to data
.
You can also rotate the whole thing, either right or left.
Instructions
Opcode | Description |
---|---|
set <byte>
|
Sets a value for data
|
add <byte>
|
Adds a value to data
|
sub <byte>
|
Subtracts a value from data
|
and <byte>
|
ANDs data by value
|
orb <byte>
|
ORs data by value
|
xor <byte>
|
XORs data by value
|
mov
|
Moves data to shelf
|
pop
|
Pops the top byte to data
|
rol
|
Rotates shelf left |
ror
|
Rotates shelf right |
inc
|
Adds 1 to data
|
dec
|
Subtracts 1 from data
|
rec
|
Records data
|
res
|
Restores data
|
lab <str>
|
Creates a label |
jmp <str>
|
Jumps to label |
equ <str>
|
Jumps to label if data == buffer
|
neq <str>
|
Jumps to label if data != buffer
|
gtr <str>
|
Jumps to label if data > buffer
|
lss <str>
|
Jumps to label if data < buffer
|
geq <str>
|
Jumps to label if data >= buffer
|
leq <str>
|
Jumps to label if data <= buffer
|
jsr <str>
|
Jumps to label as a subroutine |
rts
|
Returns from subroutine |
end
|
Exits program |
out
|
Output data as an ASCII character
|
inp
|
Input a single character into data
|
int <byte>
|
Outputs data as a number in the system (2, 8, 10, 16)
|
str <str>
|
Outputs a string (\n = new line, \r = blank, \s = space, \t = tab)
|
Interpreter
I wrote Python interpreter which is available on [1].