Search code examples
javajvmjava-bytecode-asmjasmin

How does Java bytecode mnemonics differ from Jasmin?


Java bytecode mnemonics are assembly-like instructions for JVM. Jasmin is also defined as a Java-assembler in the link given below.

http://jasmin.sourceforge.net/


Solution

  • Jasmin is an assembler:

    An assembler program creates object code by translating combinations of mnemonics and syntax for operations and addressing modes into their numerical equivalents. This representation typically includes an operation code ("opcode") as well as other control bits and data. The assembler also calculates constant expressions and resolves symbolic names for memory locations and other entities.[4] The use of symbolic references is a key feature of assemblers, saving tedious calculations and manual address updates after program modifications. Most assemblers also include macro facilities for performing textual substitution – e.g., to generate common short sequences of instructions as inline, instead of called subroutines.

    So you write a software program using the JVM instruction mnemonics and compile it with Jasmin.

    Take a look at the Jasmin User's Guide:

    Jasmin is an assembler for the Java Virtual Machine. It takes ASCII descriptions of Java classes, written in a simple assembler-like syntax using the Java Virtual Machine instruction set. It converts them into binary Java class files, suitable for loading by a Java runtime system.

    Additional reference this SO question: Difference between: Opcode, byte code, mnemonics, machine code and assembly