dgrdo / SuSt
Welcome to dgrdo/SuSt!
What?
You have reached the Super Stack! code compiler of dgrdo.
dgrdo is a simple online interface to dgtools, a complete toolchain for writing code for the Digirule 2 series of retro design computers.
The /sust
section exposes the Super Stack! compiler
through a very simple view that provides an editor for Super Stack!, a (read-only) view of the compiled Digirule Assembly
code and the complete code trace. The trace shows the state of the CPU after executing each command.
This allows you to write Super Stack! programs that run on the Digirule without knowing any of its ASM instructions.
Το test and share Digirule ASM code directly, dgrdo also includes a typical section devoted to Assembly here.
How does it work?
- Use the top left editor to write Super Stack! code.
- Compile code by clicking "Go".
- When you are happy with the result, click on "Finalise and Share".
- Use the generated URL to share your Super Stack! project, download it and even allow others to extend it.
- If you are on Twitter, you can use
#dgrdo
and let us know about your creation.
- If you are on Twitter, you can use
Projects stay live for 30 days from the day they were created (or extended).
...Super Stack!?
Super Stack! is a language with post-fix syntax and 26 commands that operate over a stack:
Any literal BYTE value (1,42,255, etc) is immediately pushed on to the stack.
Arithmetic & Logic Commands
add
,sub
,mul
,div
,mod
,shl
,shr
and
,or
,xor
- All these commands expect two operands. For example, to do
5+3
, enter5 3 add
.
Input / Output
output
,outputascii
- Send the top of the stack to the LEDs (
output
) or to the serial port (outputascii
) input
,inputascii
- Store a value from the keyboard (
input
) or the serial port (inputascii
) to the top of the stack.
Stack commands
pop
Discards the top of the stackswap
Swaps the top two values of the stackcycle
Stores the top of the stack to the bottom of the stack (the stack length remains the same)rcycle
The reverse ofcycle
.dup
Duplicates the top of the stackrev
Reverses the complete stack
Other commands
random
Pops a value from the stack (u
), produces a random number in the range0..u-1
if
/fi
While the top of the stack is non-zero, keep executing the code block betweenif / fi
quit
Terminates execution.
Comments are marked with
#
.
For more information about Super Stack! you might want to see here and here.
And definitely checkout Codegolf Stackexchange for even more interesting programs in Super Stack!.
...Digirule?
...dgtools?
For more information about dgtools, please see here and also check the ASM section of dgrdo.org and maybe its brainfuck compiler too that is also exposed via dgrdo.
Enjoy...