ENTER and EXITD are optimized instructions that are useful when a subroutine is called using the C-language. In this very common operation, a stack frame must be created. This frame is an area on the stack that hold’s the auto variables used during the subroutine. These two instructions maximize the execution efficiency of subroutine calls and minimize the code space these operations require. The 3-byte ENTER instruction creates the proper stack frame. The format of this instruction is the ENTER op-code (2 bytes) followed by a byte that indicates the auto variable area the routine requires. The instructions then creates a stack frame by saving the FRAME BASE (FB) pointer onto the stack, setting FB to the top of the frame, and relocating the STACK POINTER (SP) appropriately.

