@@ -130,6 +130,11 @@ \subsection{Python Byte Code Instructions}
130130to position three.
131131\end {opcodedesc }
132132
133+ \begin {opcodedesc }{ROT_FOUR}{}
134+ Lifts second, third and forth stack item one position up, moves top down to
135+ position four.
136+ \end {opcodedesc }
137+
133138\begin {opcodedesc }{DUP_TOP}{}
134139Duplicates the reference on top of the stack.
135140\end {opcodedesc }
@@ -209,6 +214,55 @@ \subsection{Python Byte Code Instructions}
209214Implements \code {TOS = TOS1 | TOS}.
210215\end {opcodedesc }
211216
217+ In-place operations are like binary operations, in that they remove TOS and
218+ TOS1, and push the result back on the stack, but the operation is done
219+ in-place when TOS1 supports it, and the resulting TOS may be (but does not
220+ have to be) the original TOS1.
221+
222+ \begin {opcodedesc }{INPLACE_POWER}{}
223+ Implements in-place \code {TOS = TOS1 ** TOS}.
224+ \end {opcodedesc }
225+
226+ \begin {opcodedesc }{INPLACE_MULTIPLY}{}
227+ Implements in-place \code {TOS = TOS1 * TOS}.
228+ \end {opcodedesc }
229+
230+ \begin {opcodedesc }{INPLACE_DIVIDE}{}
231+ Implements in-place \code {TOS = TOS1 / TOS}.
232+ \end {opcodedesc }
233+
234+ \begin {opcodedesc }{INPLACE_MODULO}{}
235+ Implements in-place \code {TOS = TOS1 \% {} TOS}.
236+ \end {opcodedesc }
237+
238+ \begin {opcodedesc }{INPLACE_ADD}{}
239+ Implements in-place \code {TOS = TOS1 + TOS}.
240+ \end {opcodedesc }
241+
242+ \begin {opcodedesc }{INPLACE_SUBTRACT}{}
243+ Implements in-place \code {TOS = TOS1 - TOS}.
244+ \end {opcodedesc }
245+
246+ \begin {opcodedesc }{INPLACE_LSHIFT}{}
247+ Implements in-place \code {TOS = TOS1 << TOS}.
248+ \end {opcodedesc }
249+
250+ \begin {opcodedesc }{INPLACE_RSHIFT}{}
251+ Implements in-place \code {TOS = TOS1 >> TOS}.
252+ \end {opcodedesc }
253+
254+ \begin {opcodedesc }{INPLACE_AND}{}
255+ Implements in-place \code {TOS = TOS1 \&\ TOS}.
256+ \end {opcodedesc }
257+
258+ \begin {opcodedesc }{INPLACE_XOR}{}
259+ Implements in-place \code {TOS = TOS1 \^\ TOS}.
260+ \end {opcodedesc }
261+
262+ \begin {opcodedesc }{INPLACE_OR}{}
263+ Implements in-place \code {TOS = TOS1 | TOS}.
264+ \end {opcodedesc }
265+
212266The slice opcodes take up to three parameters.
213267
214268\begin {opcodedesc }{SLICE+0}{}
@@ -366,6 +420,11 @@ \subsection{Python Byte Code Instructions}
366420% This opcode is obsolete.
367421% \end{opcodedesc}
368422
423+ \begin {opcodedesc }{DUP_TOPX}{count}
424+ Duplicate \var {count} items, keeping them in the same order. Due to
425+ implementation limits, \var {count} should be between 1 and 5 inclusive.
426+ \end {opcodedesc }
427+
369428\begin {opcodedesc }{STORE_ATTR}{namei}
370429Implements \code {TOS.name = TOS1}, where \var {namei} is the index
371430of name in \member {co_names}.
0 commit comments