Code:
value = stk[stk_ptr];
stk_ptr--;
becomes:

Code:
value = stk[stk_ptr--];