PowerShell, 46 41 40 bytes
$args|%{$x,$a=&({1,$_+$a},{$a})[!$_]};$a Takes input via splatting, e.g., $z=@(12,3,0,101,11,1,0,0,14,0,28); .\implement-stack.ps1 $z@z, which on TIO manifests as separate arguments.
$args|%{$x,$a=&({1,$_+$a},{$a})[!$_]};$a # Full program $args # Take input via splatting |%{ }; # Loop through each item &( )[!$_] # Pseudo-ternary, if input is 0 this is 1 $x,$a= {$a} # ... which will pop the first item into $x $a= { ,$_+$a} # Else, we append the first item $x = 1 # ... and drop a dummy value into $x $a # Leave $a on pipeline; implicit output -5 bytes thanks to mazzy.
-1 byte swapping $_ to 1