# `enterw`

[x86-64 Documentation](https://asm-editor.specy.app/documentation/x86.md) › [Instructions](https://asm-editor.specy.app/documentation/x86/instruction.md)

Web page: https://asm-editor.specy.app/documentation/x86/instruction/enterw

**Create 16-bit stack frame**

Category: Stack

Creates a frame with 16-bit frame pointers and reserves local storage.

186 and later

[Intel's reference: ENTER](https://intel.github.io/SDM/instruction/ENTER.html)

## Flags

| Flag | Effect |
| --- | --- |
| CF | not changed |
| PF | not changed |
| AF | not changed |
| ZF | not changed |
| SF | not changed |
| DF | not changed |
| OF | not changed |

## Forms

- `enterw imm16, imm8`
- `enterw imm16`

## Operands

- `imm16`: A 16-bit immediate, `-32768` to `65535`.
- `imm8`: An 8-bit immediate, `-128` to `255`. Instructions that sign-extend it to a wider operand interpret the byte as `-128` to `127`; shift counts do not use this sign extension.

## Description

The second operand supplies a nesting level modulo 32; omitting it selects zero. Saved frame-pointer slots are two bytes. In 64-bit mode the stack is still addressed through `rsp`; this is not the normal `rbp` frame used by 64-bit functions.

## Example

```x86
global _start

section .text
_start:
        mov rax, 12
        mov rbx, 5
        mov rcx, 3
        mov rsi, 9

        enterw 5, 5

        mov rax, 60         ; syscall 60: exit
        xor rdi, rdi
        syscall
```
