What are bytecode bytecode and opcode operation code?
What's the difference?
Do all interpreted languages have similar codes?
My understanding is:
bytecode and opcode are both intermediate codes
Interpreted languages will translate the source code into intermediate code, which is then interpreted and executed by the virtual machine (such as jvm, zend)
PHP中文网2017-06-05 11:09:43
opcode is Operation Code.
The bytecode used in java is also a kind of opcode. Because each operation code uses one byte, it is called bytecode (actually there are also multi-byte ones).
Each byte is used to represent an instruction, and theoretically there can be 256 opcodes.
The iadd
(add two integers) and dadd
(add two floating point numbers) that we often see are not bytecodes, but mnemonics.
Many interpreted languages do not have similar codes.
伊谢尔伦2017-06-05 11:09:43
Bytecode and opcode are both intermediate codes and are not comparable. Java is compiled into intermediate code bytecode and then executed in jvm. PHP is compiled into intermediate code opcode and executed in ZendVM.