KOS_OP_POP

  • Style: COUNT. Arg = number of elements to pop.

  • Stack: [..., a_1, ..., a_n] → [...] (pop arg elements).

  • Invariants: Stack must have at least arg elements.

Example: POP 1: discard TOS.

index

opcode

arg

arg view

comment

0

CONST

0

0 (1)

stack: […, 1]

1

CONST

1

1 (2)

stack: […, 1, 2]

2

POP

1

1

stack: […, 1]

3

RETURN

1

1