add instructions to monitor stack counter