Guest User

Untitled

a guest
Jul 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.38 KB | None | 0 0
  1. ```python
  2. def_op('STOP_CODE', 0)
  3. def_op('POP_TOP', 1)
  4. def_op('ROT_TWO', 2)
  5. def_op('ROT_THREE', 3)
  6. def_op('DUP_TOP', 4)
  7. def_op('ROT_FOUR', 5)
  8.  
  9. def_op('NOP', 9)
  10. def_op('UNARY_POSITIVE', 10)
  11. def_op('UNARY_NEGATIVE', 11)
  12. def_op('UNARY_NOT', 12)
  13. def_op('UNARY_CONVERT', 13)
  14.  
  15. def_op('UNARY_INVERT', 15)
  16.  
  17. def_op('BINARY_POWER', 19)
  18. def_op('BINARY_MULTIPLY', 20)
  19. def_op('BINARY_DIVIDE', 21)
  20. def_op('BINARY_MODULO', 22)
  21. def_op('BINARY_ADD', 23)
  22. def_op('BINARY_SUBTRACT', 24)
  23. def_op('BINARY_SUBSCR', 25)
  24. def_op('BINARY_FLOOR_DIVIDE', 26)
  25. def_op('BINARY_TRUE_DIVIDE', 27)
  26. def_op('INPLACE_FLOOR_DIVIDE', 28)
  27. def_op('INPLACE_TRUE_DIVIDE', 29)
  28. def_op('SLICE+0', 30)
  29. def_op('SLICE+1', 31)
  30. def_op('SLICE+2', 32)
  31. def_op('SLICE+3', 33)
  32.  
  33. def_op('STORE_SLICE+0', 40)
  34. def_op('STORE_SLICE+1', 41)
  35. def_op('STORE_SLICE+2', 42)
  36. def_op('STORE_SLICE+3', 43)
  37.  
  38. def_op('DELETE_SLICE+0', 50)
  39. def_op('DELETE_SLICE+1', 51)
  40. def_op('DELETE_SLICE+2', 52)
  41. def_op('DELETE_SLICE+3', 53)
  42.  
  43. def_op('STORE_MAP', 54)
  44. def_op('INPLACE_ADD', 55)
  45. def_op('INPLACE_SUBTRACT', 56)
  46. def_op('INPLACE_MULTIPLY', 57)
  47. def_op('INPLACE_DIVIDE', 58)
  48. def_op('INPLACE_MODULO', 59)
  49. def_op('STORE_SUBSCR', 60)
  50. def_op('DELETE_SUBSCR', 61)
  51. def_op('BINARY_LSHIFT', 62)
  52. def_op('BINARY_RSHIFT', 63)
  53. def_op('BINARY_AND', 64)
  54. def_op('BINARY_XOR', 65)
  55. def_op('BINARY_OR', 66)
  56. def_op('INPLACE_POWER', 67)
  57. def_op('GET_ITER', 68)
  58.  
  59. def_op('PRINT_EXPR', 70)
  60. def_op('PRINT_ITEM', 71)
  61. def_op('PRINT_NEWLINE', 72)
  62. def_op('PRINT_ITEM_TO', 73)
  63. def_op('PRINT_NEWLINE_TO', 74)
  64. def_op('INPLACE_LSHIFT', 75)
  65. def_op('INPLACE_RSHIFT', 76)
  66. def_op('INPLACE_AND', 77)
  67. def_op('INPLACE_XOR', 78)
  68. def_op('INPLACE_OR', 79)
  69. def_op('BREAK_LOOP', 80)
  70. def_op('WITH_CLEANUP', 81)
  71. def_op('LOAD_LOCALS', 82)
  72. def_op('RETURN_VALUE', 83)
  73. def_op('IMPORT_STAR', 84)
  74. def_op('EXEC_STMT', 85)
  75. def_op('YIELD_VALUE', 86)
  76. def_op('POP_BLOCK', 87)
  77. def_op('END_FINALLY', 88)
  78. def_op('BUILD_CLASS', 89)
  79.  
  80. HAVE_ARGUMENT = 90 # Opcodes from here have an argument:
  81.  
  82. name_op('STORE_NAME', 90) # Index in name list
  83. name_op('DELETE_NAME', 91) # ""
  84. def_op('UNPACK_SEQUENCE', 92) # Number of tuple items
  85. jrel_op('FOR_ITER', 93)
  86. def_op('LIST_APPEND', 94)
  87. name_op('STORE_ATTR', 95) # Index in name list
  88. name_op('DELETE_ATTR', 96) # ""
  89. name_op('STORE_GLOBAL', 97) # ""
  90. name_op('DELETE_GLOBAL', 98) # ""
  91. def_op('DUP_TOPX', 99) # number of items to duplicate
  92. def_op('LOAD_CONST', 100) # Index in const list
  93. hasconst.append(100)
  94. name_op('LOAD_NAME', 101) # Index in name list
  95. def_op('BUILD_TUPLE', 102) # Number of tuple items
  96. def_op('BUILD_LIST', 103) # Number of list items
  97. def_op('BUILD_SET', 104) # Number of set items
  98. def_op('BUILD_MAP', 105) # Number of dict entries (upto 255)
  99. name_op('LOAD_ATTR', 106) # Index in name list
  100. def_op('COMPARE_OP', 107) # Comparison operator
  101. hascompare.append(107)
  102. name_op('IMPORT_NAME', 108) # Index in name list
  103. name_op('IMPORT_FROM', 109) # Index in name list
  104. jrel_op('JUMP_FORWARD', 110) # Number of bytes to skip
  105. jabs_op('JUMP_IF_FALSE_OR_POP', 111) # Target byte offset from beginning of code
  106. jabs_op('JUMP_IF_TRUE_OR_POP', 112) # ""
  107. jabs_op('JUMP_ABSOLUTE', 113) # ""
  108. jabs_op('POP_JUMP_IF_FALSE', 114) # ""
  109. jabs_op('POP_JUMP_IF_TRUE', 115) # ""
  110.  
  111. name_op('LOAD_GLOBAL', 116) # Index in name list
  112.  
  113. jabs_op('CONTINUE_LOOP', 119) # Target address
  114. jrel_op('SETUP_LOOP', 120) # Distance to target address
  115. jrel_op('SETUP_EXCEPT', 121) # ""
  116. jrel_op('SETUP_FINALLY', 122) # ""
  117.  
  118. def_op('LOAD_FAST', 124) # Local variable number
  119. haslocal.append(124)
  120. def_op('STORE_FAST', 125) # Local variable number
  121. haslocal.append(125)
  122. def_op('DELETE_FAST', 126) # Local variable number
  123. haslocal.append(126)
  124.  
  125. def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3)
  126. def_op('CALL_FUNCTION', 131) # #args + (#kwargs << 8)
  127. def_op('MAKE_FUNCTION', 132) # Number of args with default values
  128. def_op('BUILD_SLICE', 133) # Number of items
  129. def_op('MAKE_CLOSURE', 134)
  130. def_op('LOAD_CLOSURE', 135)
  131. hasfree.append(135)
  132. def_op('LOAD_DEREF', 136)
  133. hasfree.append(136)
  134. def_op('STORE_DEREF', 137)
  135. hasfree.append(137)
  136.  
  137. def_op('CALL_FUNCTION_VAR', 140) # #args + (#kwargs << 8)
  138. def_op('CALL_FUNCTION_KW', 141) # #args + (#kwargs << 8)
  139. def_op('CALL_FUNCTION_VAR_KW', 142) # #args + (#kwargs << 8)
  140.  
  141. jrel_op('SETUP_WITH', 143)
  142.  
  143. def_op('EXTENDED_ARG', 145)
  144. EXTENDED_ARG = 145
  145. def_op('SET_ADD', 146)
  146. def_op('MAP_ADD', 147)
  147. ```
Add Comment
Please, Sign In to add comment