Home

Awesome

Whitespace Programs

A series of programs written in Whitespace. Also see my Whitespace compiler.

Structure

Assembly Language

The assembly language supports one command per line. The 24 basic commands are

Command nameTypeArguments (empty if none)
rcharI/O
rnumI/O
wcharI/O
wnumI/O
pushStackinteger
dupStack
swapStack
popStack
copyStackinteger
slideStackinteger
addArithmetic
subArithmetic
mulArithmetic
divArithmetic
modArithmetic
callFlowlabel
jumpFlowlabel
jzFlowlabel
jnFlowlabel
retFlow
endFlow
storeHeap
loadHeap

Arguments should be preceded by at least one space.

Labels

Labels can be made by ending a line with a :. To refer to a label as an argument, enter the part of the line before the :.

Numbers

Numbers can be written either in decimal (e.g., 10, 123, etc...) or as a character constant (e.g., 'a', "B", '\n', or "\t").

Commenting

; can be used for commenting--all characters starting at the ; and going to the end of the line will be ignored

Other Miscellaneous Notes

Except for at least one space separating arguments and instructions being separated by newlines, (ironically) white space is ignored.