lua虚拟机字节码修改_LUA虚拟机的字节码怎么看?
'A' : 8 bits
'B' : 9 bits
'C' : 9 bits
'Ax' : 26 bits ('A', 'B', and 'C' together)
'Bx' : 18 bits ('B' and 'C' together)
'sBx' : signed Bx
比如這段:
function y(...) print(...) end
1 [1] GETTABUP 0 0 -1 ; _ENV "print"
2 [1] VARARG 1 0 ; VARARG will set L->top
3 [1] CALL 0 0 1 ; B=0 so L->top set by previous instruction
4 [1] RETURN 0 1
每條指令后面的數字(2個或者3個)表示什么意思?
E:\Project\ZhScheme\lua>luac -l luac.out
main <0> (6 instructions, 24 bytes at 004784F8)0>
0+ params, 2 slots, 0 upvalues, 0 locals, 4 constants, 0 functions
1 [1] LOADK 0 -2 ; 18
2 [1] SETGLOBAL 0 -1 ; a
3 [2] GETGLOBAL 0 -3 ; print
4 [2] LOADK 1 -4 ; "hello world"
5 [2] CALL 0 2 1
6 [2] RETURN 0 1
總結
以上是生活随笔為你收集整理的lua虚拟机字节码修改_LUA虚拟机的字节码怎么看?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android q全局夜间模式,安卓Q新
- 下一篇: java全局机制,java实现全局异常机