Advertisement
2much4u

GTA V Script Opcode List

Sep 23rd, 2017
812
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.34 KB | None | 0 0
  1. 0x00 - nop (no operation, does nothing)
  2. 0x01 - Add (Add top two stack items, store result on stack)
  3. 0x02 - Sub (Second stack item - top stack item, store result on stack)
  4. 0x03 - Mult (Mult top two stack items, store result on stack)
  5. 0x04 - Div (Second stack item divided by top item, store result on stack, zero throws an error)
  6. 0x05 - Mod (Gets the mod of top two items on stack, or the remainder when divided, stores result on stack)
  7. 0x06 - Not (Bitwise Not, store result on stack)
  8. 0x07 - Neg (Bitwise Neg, store result on stack)
  9. 0x08 - CmpEQ (Check if top two items on stack are equal, store result bool on stack)
  10. 0x09 - CmpNE (Check if top two items on stack are not equal, store result bool on stack)
  11. 0x0A - CmpGT (Check if second item is greater than top item, store result bool on stack)
  12. 0x0B - CmpGE (Check if second item is greater than or equal to top item, store result bool on stack)
  13. 0x0C - CmpLT (Check if second item is less than top item, store result bool on stack)
  14. 0x0D - CmpLE (Check if second item is less than or equal to top item, store result bool on stack)
  15. 0x0E - fAdd (Add top two floats on stack together, store result on stack)
  16. 0x0F - fSub (Subtract top float from second float, store result on stack)
  17. 0x10 - fMul (Multiply top two floats on stack, store result on stack)
  18. 0x11 - fDiv (Second float divided by first float, store result on stack)
  19. 0x12 - fMod (Gets the mod of top two floats on stack, store result on stack)
  20. 0x13 - fNeg (Bitwise Neg on float, store result on stack)
  21. 0x14 - fCmpEQ (Check if top two floats on stack are equal, store result bool on stack)
  22. 0x15 - FCmpNE (Check if top two floats on stack are not equal, store result bool on stack)
  23. 0x16 - FCmpGT (Check if second float is greater than top float, store result bool on stack)
  24. 0x17 - FCmpGE (Check if second float is greater than or equal to top float, store result bool on stack)
  25. 0x18 - FCmpLT (Check if second float is less than top float, store result bool on stack)
  26. 0x19 - FCmpLE (Check if second float is less than or equal to top float, store result bool on stack)
  27. 0x1A - vAdd (Add top two vectors, store result on stack)
  28. 0x1B - vSub (Subtract top vector from second vector, store result on stack)
  29. 0x1C - vMul (Multiply top two vectors, store result on stack)
  30. 0x1D - vDiv (Second stack vector divided by top stack vector, store result on stack)
  31. 0x1E - vNeg (Bitwise negate on vector, store result on stack)
  32. 0x1F - And (Bitwise And on top stack item, store result on stack)
  33. 0x20 - Or (Bitwise Or on top stack item, store result on stack)
  34. 0x21 - Xor (Bitwise Xor on top stack item, store result on stack)
  35. 0x22 - ItoF (Convert top integer to float, store result on stack)
  36. 0x23 - FtoI (Convert top float to integer, store result on stack)
  37. 0x24 - Dup2 (Read top stack item, duplicate and store on stack twice, so three of them total)
  38. 0x25 - Push1 (Push 1 byte onto the stack, max size of 255)
  39. 0x26 - Push2 (Push 2 separate 1 byte values onto the stack, each with a max size of 255)
  40. 0x27 - Push3 (Push 3 separate 1 byte values onto the stack, each with a max size of 255)
  41. 0x28 - Push (Push 32 bit signed int onto the stack)
  42. 0x29 - fPush (Push 32 bit float onto the stack)
  43. 0x2A - Dup (Duplicate top item on stack, store back on stack. Two of them on top at the end)
  44. 0x2B - Drop (Drop top item on stack)
  45. 0x2C - CallNative (Call a Native Function from the natives block. Will take items off the stack and store items on the stack as required by the function)
  46. 0x2D - Function (Begin an internal function. Return address is stored on top of stack. Bytes after are 8 bits for how many items to take off stack and pass to function (params), 8 bit for how many local function vars to create, 16 bit related to c++ function name, just leave it null)
  47. 0x2E - Return (Return from internal function. Bytes after are 8 bits for how many params you originally passed to the function and another 8 bit for how many items to return from the function, or store back on the stack)
  48. 0x2F - pGet (get value at location pointed to by top item on stack, store on stack)
  49. 0x30 - pSet (store second item on stack at location pointed to by first item on stack)
  50. 0x31 - pPeekSet (peek at top item, then store top item at location pointed to by second item)
  51. 0x32 - ToStack (unknown...)
  52. 0x33 - FromStack (unknown...)
  53. 0x34 - ArrayGetP1 (unknown...)
  54. 0x35 - ArrayGet1 (unknown...)
  55. 0x36 - ArraySet1 (unknown...)
  56. 0x37 - pFrame1 (Get pointer to a frame var. Frame var number is one byte, can be up to 255)
  57. 0x38 - getF1 (Get frame var value. Frame var number is one byte, can be up to 255)
  58. 0x39 - setF1 (Set frame var value. Frame var number is one byte, can be up to 255)
  59. 0x3A - pStatic1 (Get pointer to a static var. Static var number is one byte, can be up to 255)
  60. 0x3B - StaticGet1 (Get static value. Static number is one byte, can be up to 255)
  61. 0x3C - StaticSet1 (Set static value. Static number is one byte, can be up to 255)
  62. 0x3D - Add1 (Add top stack item to the value pushed by this opcode. Store result on stack)
  63. 0x3E - Mult1 (Multiply top item on stack to the value pushed by this opcode. Store result on stack)
  64. 0x3F - GetStackImmediateP (unknown...)
  65. 0x40 - GetImmediateP1 (unknown...)
  66. 0x41 - GetImmediate1 (unknown...)
  67. 0x42 - SetImmediate1 (unknown...)
  68. 0x43 - PushS (Push a 16 bit unsigned int onto the stack)
  69. 0x44 - Add2 (Add top stack item to the value pushed by this opcode. Store result on stack. Value pushed can be up to 2 bytes or 65,535)
  70. 0x45 - Mult2 (Multiply top stack item to the value pushed by this opcode. Store result on stack. Value pushed can be up to 2 bytes or 65,535)
  71. 0x46 - GetImmediateP2 (unknown...)
  72. 0x47 - GetImmediate2 (unknown...)
  73. 0x48 - SetImmediate2 (unknown...)
  74. 0x49 - ArrayGetP2 (unknown...)
  75. 0x4A - ArrayGet2 (unknown...)
  76. 0x4B - ArraySet2 (unknown...)
  77. 0x4C - pFrame2 (Get pointer to a frame var. Frame var number can be up to 2 bytes or 65,535)
  78. 0x4D - getF2 (Get frame var value. Frame var number can be up to 2 bytes or 65,535)
  79. 0x4E - setF2 (Set frame var value. Frame var number can be up to 2 bytes or 65,535)
  80. 0x4F - pStatic2 (Get pointer to a static. Static number can be up to 2 bytes or 65,535)
  81. 0x50 - StaticGet2 (Get static value. Static number can be up to 2 bytes or 65,535)
  82. 0x51 - StaticSet2 (Set static value. Static number can be up to 2 bytes or 65,535)
  83. 0x52 - pGlobal2 (Get pointer to a global. Global number can be up to 2 bytes or 65,535)
  84. 0x53 - globalGet2 (Get global value. Static number can be up to 2 bytes or 65,535)
  85. 0x54 - globalSet2 (Set global value. Static number can be up to 2 bytes or 65,535)
  86. 0x55 - Jump (Jump to location inside the function. Offset is based off the byte after the opcode and can go backwards (negative offset)
  87. 0x56 - JumpFalse (Jump if top item on stack is 0)
  88. 0x57 - JumpNE (Jump if top two items on stack are not equal)
  89. 0x58 - JumpEQ (Jump if top two items on stack are equal)
  90. 0x59 - JumpLE (Jump if second item is less than or equal to top item)
  91. 0x5A - JumpLT (Jump if second item is less than top item)
  92. 0x5B - JumpGE (Jump if second item is greater than or equal to top item)
  93. 0x5C - JumpGT (Jump if second item is greater than top item)
  94. 0x5D - Call (Call to a different function. Offset is based from the start of the script)
  95. 0x5E - pGlobal3 (Pointer to a global variable. Global var number can be up to 3 bytes, or 16,777,215)
  96. 0x5F - globalGet3 (Get a global variable. Global var number can be up to 3 bytes, or 16,777,215)
  97. 0x60 - globalSet3 (Set a global variable. Global var number can be up to 3 bytes, or 16,777,215)
  98. 0x61 - pushI24 (Push a 24 bit number onto the stack, number can be up to 16,777,215)
  99. 0x62 - Switch (Switch, same as in C, a series of values with corresponding points to jump to if there is a match. If no match, nothing happens)
  100. 0x63 - PushString (Takes top item off stack and returns the string at that location of the string block)
  101. 0x64 - GetHash (Gets the hash of the string on the top of the stack and stores the hash on the top of the stack)
  102. 0x65 - StrCopy (Related to string concatenation. Copies a string onto the stack)
  103. 0x66 - ItoS (Converts an integer to a string)
  104. 0x67 - StrAdd (Takes two pointers to strings off the stack, adds them together and stores a new pointer on the stack)
  105. 0x68 - StrAddi (Pops two items off the stack, and converts the second item from integer to string, then adds it to the end of the first string)
  106. 0x69 - SnCopy (Get two pointers off the stack, copy data from location pointed to by second item to the location pointed to by second item)
  107. 0x6A - Catch (Sets up a safe area to catch errors)
  108. 0x6B - Throw (Indicates an area that handles a script error relative to the catch opcode)
  109. 0x6C - pCall (unknown...)
  110. 0x6D - push_-1 (pushes -1 onto the stack)
  111. 0x6E - push_0 (pushes 0 onto the stack)
  112. 0x6F - push_1 (pushes 1 onto the stack)
  113. 0x70 - push_2 (pushes 2 onto the stack)
  114. 0x71 - push_3 (pushes 3 onto the stack)
  115. 0x72 - push_4 (pushes 4 onto the stack)
  116. 0x73 - push_5 (pushes 5 onto the stack)
  117. 0x74 - push_6 (pushes 6 onto the stack)
  118. 0x75 - push_7 (pushes 7 onto the stack)
  119. 0x76 - fPush_-1 (pushes -1.0 float onto the stack)
  120. 0x77 - fPush_0.0 (pushes 0.0 float onto the stack)
  121. 0x78 - fPush_1.0 (pushes 1.0 float onto the stack)
  122. 0x79 - fPush_2.0 (pushes 2.0 float onto the stack)
  123. 0x7A - fPush_3.0 (pushes 3.0 float onto the stack)
  124. 0x7B - fPush_4.0 (pushes 4.0 float onto the stack)
  125. 0x7C - fPush_5.0 (pushes 5.0 float onto the stack)
  126. 0x7D - fPush_6.0 (pushes 6.0 float onto the stack)
  127. 0x7E - fPush_7.0 (pushes 7.0 float onto the stack)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement