Stack Machine Simulator

A virtual stack-based computer — push, pop, compute

Command Input
Quick Operations
Program Editor
Speed: 300ms
Example Programs
Instruction Reference
OpDescription
PUSH nPush value n onto stack
POPRemove top element
ADDPop two, push sum
SUBPop two, push (second - top)
MULPop two, push product
DIVPop two, push (second / top)
DUPDuplicate top element
SWAPSwap top two elements
OVERCopy second element to top
ROTRotate top three (a b c → b c a)
PRINTOutput top without popping
CLEARClear entire stack
Stack (0)
-- empty --
empty
Output
Operation History
No operations yet
← back to archive