能力值:
( LV2,RANK:10 )
|
-
-
2 楼
Lua instruction is a 32 bits double word, and there are:
a fixed 6 bits op-code.
8 bits A operation
9 bits B operation
9 bits C operation
26 bits Ax operation
18 bits Bx operation
18 bits sBx operation
There are the following compositions:
C B A OP (9 9 8 6)
Ax OP (26 6)
Bx A Op (18 8 6)
sBX A Op (18 8 6)
For example, a = b + 1, instruction is 0x0040400D
(cast(OpCode, ((0x0040400D)>>POS_OP) & MASK1(SIZE_OP,0)))
-> (0x0040400D >> 0) & ((~((~(Instruction)0)<<(6)))<<(0))
-> 0x0040400D & 0x3F
-> 0x0D
So, GET_OPCODE(instruction) is 0x0D = OP_ADD
The SET_OPCODE is REVERSE work macro. If you can't understand that macro, please reference your C language textbooks.
|
能力值:
( LV4,RANK:50 )
|
-
-
3 楼
貌似还是不是很懂。。请指教``
|
|
|