IJVM Machine Language


In a real computer, the lowest level at which a programmer can write programs is the traditional machine language level. A program written in a higher-level language is either translated (assembled or compiled) to machine language or it is interpreted by machine language program.

A machine language instruction consists of a 1-byte operation code (opcode) followed by 0, 1, or 2 operands (depending on the opcode). Operands are 1 or 2 bytes in size. For complete details see the Instruction Set.

Machine language programs are saved as a file of bytes. The file contains a 4-byte header, a constant section, and a code section. See file format for more information.

The best way to create a machine language program is to write the code in assembly language and let the assembler generate the corresponding machine language code. You can also write machine language programs by directly editing the contents of memory.