Command stack implementation for embedded systems (esp MSP430)