2011-07-24 22 views
1

正常操作码和操作码与MSB(最高有效位)设置有什么区别?正常操作码和操作码与MSB集有什么区别?

实施例:

0036 5E000001   [4] return  1 2 
003A 1E008000   [5] return  0 1 

第一操作码(0x5E/1011110)具有其MSB集合和第二操作码(0X1E/0011110)也没有。

编辑:将'byte'更正为'bit',duh。

回答

1

经过一番谷歌搜索之后,我发现Lua源头(lopcodes.h)解释指令格式好一点。

看起来是错误的读操作码的字节,它应该被解读为6位:

All instructions have an opcode in the first 6 bits. 
Instructions can have the following fields: 
`A' : 8 bits 
`B' : 9 bits 
`C' : 9 bits 
`Bx' : 18 bits (`B' and `C' together) 
`sBx' : signed Bx 
+0

你阅读本文档? http://luaforge.net/docman/view.php/83/98/ANoFrillsIntroToLua51VMInstructions.pdf –

+0

是的,我做到了。但它并没有真正解释它。编辑:我重读了一些部分,并注意到这一点:“详细信息可以在lopcodes.h中找到 ,而指令类型定义在llimits.h中定义。” – lesderid

相关问题