Revised for issue with terminate interrupt at ax=7