The Dalvik virtual machine has designed a set of instruction sets for itself, and has developed its own instruction format and invocation specification. The code that consists of the Dalvik instruction set is called the Dalvik assembly code, which is called the language of the Code Dalvik Assembly (Dalvik assembly language is not a formal one, just a description of the Dalvik instruction set code).
1. Dalvik instruction Format
A Dalvik assembly code consists of a series of Dalvik directives, which are determined by the instruction's bit description and the instruction format identifier. The bit description conventions are as follows:
-
Each 16-bit word is separated by a space.
-
Each letter represents 4 bits, each of which begins in order from a high byte and is arranged to a low byte. There may be a vertical line between every 4 bits "|" To represent a different content.
-
The order takes a single uppercase letter of A~z as a 4-bit opcode, op represents a 8-bit opcode.
-
“?” To indicate that all bits in this field are 0 values.
In instruction format "a| G|op BBBB f| e| d| C "For example:
There are two spaces in the middle of the instruction, each part size is 16 bits, so this instruction is made up of three 16-bit words. The first 16-bit is "a| G|op ", the high 8 bits consist of a and g, and the low byte consists of opcode op. The second 16-bit is made up of BBBB, which represents an offset value of 16 bits. The third 16-bit consists of a total of four 4-bit f,e,d,c, where they represent the register parameters.
The unfinished ... ..... .... ... .... ..... .... ..... .........., ..., ... and .....????????????????.
Enter the Android Dalvik virtual machine Dalvik assembly Language Basics