Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
dff21a6b
Kaydet (Commit)
dff21a6b
authored
Nis 03, 1998
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Minor nits.
Indent code sample to use 4-space indents.
üst
16a19c46
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
34 deletions
+30
-34
libdis.tex
Doc/lib/libdis.tex
+15
-17
libdis.tex
Doc/libdis.tex
+15
-17
No files found.
Doc/lib/libdis.tex
Dosyayı görüntüle @
dff21a6b
\section
{
Standard Module
\
sectcod
e
{
dis
}}
\section
{
Standard Module
\
modul
e
{
dis
}}
\stmodindex
{
dis
}
\label
{
module-dis
}
The
\
cod
e
{
dis
}
module supports the analysis of Python byte code by
The
\
modul
e
{
dis
}
module supports the analysis of Python byte code by
disassembling it. Since there is no Python assembler, this module
defines the Python assembly language. The Python byte code which
this module takes as an input is defined in the file
\file
{
Include/opcode.h
}
and used by the compiler and the interpreter.
Example: Given the function
myfunc
Example: Given the function
\function
{
myfunc
}
:
\begin{verbatim}
def myfunc(alist):
return len(alist)
return len(alist)
\end{verbatim}
the following command can be used to get the disassembly of
\code
{
myfunc()
}
:
the following command can be used to get the disassembly of
\function
{
myfunc()
}
:
\begin{verbatim}
>>> dis.dis(myfunc)
...
...
@@ -31,9 +31,7 @@ the following command can be used to get the disassembly of \code{myfunc()}:
19 RETURN
_
VALUE
\end{verbatim}
The
\code
{
dis
}
module defines the following functions:
\setindexsubitem
{
(in module dis)
}
The
\module
{
dis
}
module defines the following functions:
\begin{funcdesc}
{
dis
}{
\optional
{
bytesource
}}
Disassemble the
\var
{
bytesource
}
object.
\var
{
bytesource
}
can denote
...
...
@@ -53,8 +51,8 @@ is indicated.
Disassembles a code object, indicating the last instruction if
\var
{
lasti
}
was provided. The output is divided in the following columns:
\begin{itemize}
\item
the current instruction, indicated as
\
code
{
-->
}
,
\item
a labelled instruction, indicated with
\
code
{
>>
}
,
\item
the current instruction, indicated as
\
samp
{
-->
}
,
\item
a labelled instruction, indicated with
\
samp
{
>>
}
,
\item
the address of the instruction,
\item
the operation code name,
\item
operation parameters, and
...
...
@@ -324,14 +322,14 @@ bytes, with the more significant byte last.
\begin{opcodedesc}
{
STORE
_
NAME
}{
namei
}
Implements
\code
{
name = TOS
}
.
\var
{
namei
}
is the index of
\var
{
name
}
in the attribute
\
code
{
co
_
names
}
of the code object.
in the attribute
\
member
{
co
_
names
}
of the code object.
The compiler tries to use
\code
{
STORE
_
LOCAL
}
or
\code
{
STORE
_
GLOBAL
}
if possible.
\end{opcodedesc}
\begin{opcodedesc}
{
DELETE
_
NAME
}{
namei
}
Implements
\code
{
del name
}
, where
\var
{
namei
}
is the index into
\
code
{
co
_
names
}
attribute of the code object.
\
member
{
co
_
names
}
attribute of the code object.
\end{opcodedesc}
\begin{opcodedesc}
{
UNPACK
_
TUPLE
}{
count
}
...
...
@@ -349,12 +347,12 @@ Unpacks TOS into \var{count} individual values.
\begin{opcodedesc}
{
STORE
_
ATTR
}{
namei
}
Implements
\code
{
TOS.name = TOS1
}
, where
\var
{
namei
}
is the index
of name in
\
code
{
co
_
names
}
.
of name in
\
member
{
co
_
names
}
.
\end{opcodedesc}
\begin{opcodedesc}
{
DELETE
_
ATTR
}{
namei
}
Implements
\code
{
del TOS.name
}
, using
\var
{
namei
}
as index into
\
code
{
co
_
names
}
.
\
member
{
co
_
names
}
.
\end{opcodedesc}
\begin{opcodedesc}
{
STORE
_
GLOBAL
}{
namei
}
...
...
@@ -370,11 +368,11 @@ Works as \code{DELETE_NAME}, but deletes a global name.
%\end{opcodedesc}
\begin{opcodedesc}
{
LOAD
_
CONST
}{
consti
}
Pushes
\
code
{
co
_
consts[
\var
{
consti
}
]
}
onto the stack.
Pushes
\
samp
{
co
_
consts[
\var
{
consti
}
]
}
onto the stack.
\end{opcodedesc}
\begin{opcodedesc}
{
LOAD
_
NAME
}{
namei
}
Pushes the value associated with
\
code
{
co
_
names[
\var
{
namei
}
]
}
onto the stack.
Pushes the value associated with
\
samp
{
co
_
names[
\var
{
namei
}
]
}
onto the stack.
\end{opcodedesc}
\begin{opcodedesc}
{
BUILD
_
TUPLE
}{
count
}
...
...
Doc/libdis.tex
Dosyayı görüntüle @
dff21a6b
\section
{
Standard Module
\
sectcod
e
{
dis
}}
\section
{
Standard Module
\
modul
e
{
dis
}}
\stmodindex
{
dis
}
\label
{
module-dis
}
The
\
cod
e
{
dis
}
module supports the analysis of Python byte code by
The
\
modul
e
{
dis
}
module supports the analysis of Python byte code by
disassembling it. Since there is no Python assembler, this module
defines the Python assembly language. The Python byte code which
this module takes as an input is defined in the file
\file
{
Include/opcode.h
}
and used by the compiler and the interpreter.
Example: Given the function
myfunc
Example: Given the function
\function
{
myfunc
}
:
\begin{verbatim}
def myfunc(alist):
return len(alist)
return len(alist)
\end{verbatim}
the following command can be used to get the disassembly of
\code
{
myfunc()
}
:
the following command can be used to get the disassembly of
\function
{
myfunc()
}
:
\begin{verbatim}
>>> dis.dis(myfunc)
...
...
@@ -31,9 +31,7 @@ the following command can be used to get the disassembly of \code{myfunc()}:
19 RETURN
_
VALUE
\end{verbatim}
The
\code
{
dis
}
module defines the following functions:
\setindexsubitem
{
(in module dis)
}
The
\module
{
dis
}
module defines the following functions:
\begin{funcdesc}
{
dis
}{
\optional
{
bytesource
}}
Disassemble the
\var
{
bytesource
}
object.
\var
{
bytesource
}
can denote
...
...
@@ -53,8 +51,8 @@ is indicated.
Disassembles a code object, indicating the last instruction if
\var
{
lasti
}
was provided. The output is divided in the following columns:
\begin{itemize}
\item
the current instruction, indicated as
\
code
{
-->
}
,
\item
a labelled instruction, indicated with
\
code
{
>>
}
,
\item
the current instruction, indicated as
\
samp
{
-->
}
,
\item
a labelled instruction, indicated with
\
samp
{
>>
}
,
\item
the address of the instruction,
\item
the operation code name,
\item
operation parameters, and
...
...
@@ -324,14 +322,14 @@ bytes, with the more significant byte last.
\begin{opcodedesc}
{
STORE
_
NAME
}{
namei
}
Implements
\code
{
name = TOS
}
.
\var
{
namei
}
is the index of
\var
{
name
}
in the attribute
\
code
{
co
_
names
}
of the code object.
in the attribute
\
member
{
co
_
names
}
of the code object.
The compiler tries to use
\code
{
STORE
_
LOCAL
}
or
\code
{
STORE
_
GLOBAL
}
if possible.
\end{opcodedesc}
\begin{opcodedesc}
{
DELETE
_
NAME
}{
namei
}
Implements
\code
{
del name
}
, where
\var
{
namei
}
is the index into
\
code
{
co
_
names
}
attribute of the code object.
\
member
{
co
_
names
}
attribute of the code object.
\end{opcodedesc}
\begin{opcodedesc}
{
UNPACK
_
TUPLE
}{
count
}
...
...
@@ -349,12 +347,12 @@ Unpacks TOS into \var{count} individual values.
\begin{opcodedesc}
{
STORE
_
ATTR
}{
namei
}
Implements
\code
{
TOS.name = TOS1
}
, where
\var
{
namei
}
is the index
of name in
\
code
{
co
_
names
}
.
of name in
\
member
{
co
_
names
}
.
\end{opcodedesc}
\begin{opcodedesc}
{
DELETE
_
ATTR
}{
namei
}
Implements
\code
{
del TOS.name
}
, using
\var
{
namei
}
as index into
\
code
{
co
_
names
}
.
\
member
{
co
_
names
}
.
\end{opcodedesc}
\begin{opcodedesc}
{
STORE
_
GLOBAL
}{
namei
}
...
...
@@ -370,11 +368,11 @@ Works as \code{DELETE_NAME}, but deletes a global name.
%\end{opcodedesc}
\begin{opcodedesc}
{
LOAD
_
CONST
}{
consti
}
Pushes
\
code
{
co
_
consts[
\var
{
consti
}
]
}
onto the stack.
Pushes
\
samp
{
co
_
consts[
\var
{
consti
}
]
}
onto the stack.
\end{opcodedesc}
\begin{opcodedesc}
{
LOAD
_
NAME
}{
namei
}
Pushes the value associated with
\
code
{
co
_
names[
\var
{
namei
}
]
}
onto the stack.
Pushes the value associated with
\
samp
{
co
_
names[
\var
{
namei
}
]
}
onto the stack.
\end{opcodedesc}
\begin{opcodedesc}
{
BUILD
_
TUPLE
}{
count
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment