RSS
Логотип
Баннер в шапке 1
Баннер в шапке 2
2010/05/19 15:26:03

Bytecode

The bytecode or bytecode (byte-code), sometimes is also used the term a pseudo-code — the machine-independent code of the low level generated by the translator and performed by the interpreter. The majority of instructions of a bytecode are equivalent to one or several commands of the assembler. Broadcasting in a bytecode is intermediate between compilation in machine code and interpretation.


The bytecode is called so because length of each activity code — one byte, but length of the code of a command is different. Each instruction represents a one-byte activity code from 0 to 255 which such parameters as registers or memory addresses follow. It in a typical case, but the specification of a bytecode considerably differs in language.

The program on a bytecode is usually executed by the bytecode interpreter (usually it is called the virtual machine as it is similar to the computer). Advantage — in portiruyemost,  i.e. the same bytecode can be performed on different platforms and architecture. The same advantage is given by interpreted languages. However, as a bytecode normal less abstract, more compact and more "computer" than source code, efficiency of a bytecode it is normal above than net interpretation of the source code intended for editing by the person. For this reason many modern interpreted languages actually broadcast in a bytecode and start the bytecode interpreter. Perl, PHP and Python relate to such languages. Programs on Java are usually transferred to the target machine in the form of a bytecode which before execution is broadcast in machine code "on the fly" — using JIT compilation. The code represents in the standard of open Open Firmware loaders of SUN Microsystems company of bytes operators of the Forth language.

At the same time creation of processors for which this bytecode is directly machine code is possible (such processors exist, for example, for Java and Forth).

The p-code (p-code) which is similar to a bytecode is of also some interest, but can physically be less laconic and is strong vary longwise instructions. It works at very high level, for example "print a line" or "clean the screen". The P-code is everywhere used in DBMS and some implementations of BASIC and Pascal.

The languages and coding environments using a bytecode

Links