From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "enum" |
|---|
| subject | "Format:Lua bytecode" |
|---|
| claim | "Lua 5.3 has 47 opcodes (enum OpCode in lopcodes.h, 6-bit opcode field): 0 MOVE, 1 LOADK, 2 LOADKX, 3 LOADBOOL, 4 LOADNIL, 5 GETUPVAL, 6 GETTABUP, 7 GETTABLE, 8 SETTABUP, 9 SETUPVAL, 10 SETTABLE, 11 NEWTABLE, 12 SELF, 13 ADD, 14 SUB, 15 MUL, 16 MOD, 17 POW, 18 DIV, 19 IDIV, 20 BAND, 21 BOR, 22 BXOR, 23 SHL, 24 SHR, 25 UNM, 26 BNOT, 27 NOT, 28 LEN, 29 CONCAT, 30 JMP, 31 EQ, 32 LT, 33 LE, 34 TEST, 35 TESTSET, 36 CALL, 37 TAILCALL, 38 RETURN, 39 FORLOOP, 40 FORPREP, 41 TFORCALL, 42 TFORLOOP, 43 SETLIST, 44 CLOSURE, 45 VARARG, 46 EXTRAARG. Note MOD/POW/DIV order differs from 5.2." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:Lua bytecode" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "lua53_OpCode" |
|---|
| underlying_type | "uint8_t" |
|---|
| values | | 0 | "OP_MOVE" |
|---|
| 1 | "OP_LOADK" |
|---|
| 2 | "OP_LOADKX" |
|---|
| 3 | "OP_LOADBOOL" |
|---|
| 4 | "OP_LOADNIL" |
|---|
| 5 | "OP_GETUPVAL" |
|---|
| 6 | "OP_GETTABUP" |
|---|
| 7 | "OP_GETTABLE" |
|---|
| 8 | "OP_SETTABUP" |
|---|
| 9 | "OP_SETUPVAL" |
|---|
| 10 | "OP_SETTABLE" |
|---|
| 11 | "OP_NEWTABLE" |
|---|
| 12 | "OP_SELF" |
|---|
| 13 | "OP_ADD" |
|---|
| 14 | "OP_SUB" |
|---|
| 15 | "OP_MUL" |
|---|
| 16 | "OP_MOD" |
|---|
| 17 | "OP_POW" |
|---|
| 18 | "OP_DIV" |
|---|
| 19 | "OP_IDIV" |
|---|
| 20 | "OP_BAND" |
|---|
| 21 | "OP_BOR" |
|---|
| 22 | "OP_BXOR" |
|---|
| 23 | "OP_SHL" |
|---|
| 24 | "OP_SHR" |
|---|
| 25 | "OP_UNM" |
|---|
| 26 | "OP_BNOT" |
|---|
| 27 | "OP_NOT" |
|---|
| 28 | "OP_LEN" |
|---|
| 29 | "OP_CONCAT" |
|---|
| 30 | "OP_JMP" |
|---|
| 31 | "OP_EQ" |
|---|
| 32 | "OP_LT" |
|---|
| 33 | "OP_LE" |
|---|
| 34 | "OP_TEST" |
|---|
| 35 | "OP_TESTSET" |
|---|
| 36 | "OP_CALL" |
|---|
| 37 | "OP_TAILCALL" |
|---|
| 38 | "OP_RETURN" |
|---|
| 39 | "OP_FORLOOP" |
|---|
| 40 | "OP_FORPREP" |
|---|
| 41 | "OP_TFORCALL" |
|---|
| 42 | "OP_TFORLOOP" |
|---|
| 43 | "OP_SETLIST" |
|---|
| 44 | "OP_CLOSURE" |
|---|
| 45 | "OP_VARARG" |
|---|
| 46 | "OP_EXTRAARG" |
|---|
|
|---|
| complete | true |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "typedef enum { OP_MOVE, ... } OpCode; at tag v5.3.6" |
|---|
| repo | "https://github.com/lua/lua" |
|---|
| commit | "75ea9ccbea7c4886f30da147fb67b693b2624c26" |
|---|
| path | "lopcodes.h" |
|---|
| lines | "171-234" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "Printed luaP_opnames[] from MSVC x64 builds of tags v5.3.0 to v5.3.6 (identical) and disassembled self-made chunks with luacinfo.py; operands decoded consistently." |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Opcodes (Lua 5.3)" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T07:02:25.503Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T09:48:05.006Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read lopcodes.h at 75ea9ccb: enum OpCode has 47 names MOVE..EXTRAARG (MOD, POW, DIV order as in the fact); pairs 0-46 match; complete." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T17:38:56.974Z" |
|---|
| summary | "Mark complete: counted 47 OP_ entries in enum OpCode of lopcodes.h at the cited commit" |
|---|
| changed | |
|---|
|
|
|---|