Refer to this Weibo, more details can be seen here
http://blog.csdn.net/dd864140130/article/details/52076515
Dalvik byte code
1, register bit 32 bit, 64-bit data (double) is represented by two adjacent 32 registers.
2. Two types: Basic types and reference types (objects and arrays)
What is the fully qualified name?
In the case of String, whose full name is Java.lang.String, then its fully qualified name is java/lang/string; that is, java.lang.String "." Replace with "/" and add a semicolon at the end ";" Make a terminator.
Dalvik byte code type descriptor
V void can only be used for return value types
Z Boolean logical value, returns True (True) False (false)
B byte byte type
Short integer type S
C Char Character type
I int integer type
J Long (64-bit) length integer
F Float Float Type
D double-precision floating point
L object Type, Java class
java->package.name.objectname;
Davik->lpackage/name/objectname
[Array type
Java->int[] int[][] three-dimensional array
davik->[i; [[I; [[I;
Description of the field
The description of a field in Davik is divided into two types, a description of the base Type field, and a description of the reference type, but the same is true for the two:
Object type descriptor, field name: type descriptor;
For example, the Com.sbbic.Test class has a Name field of type string and an age field of type int, which is described as:
lcom/sbbic/test;->name:ljava/lang/string;
Lcom/sbbic/test;->age:i
Dalvik instruction Set
Data definition Directive Const
const-Assignment Method register name append content
|
Instructions |
Describe |
|
CONST/4 va,#+b |
Assign a value to register VA after expanding the value symbol to 32 |
|
CONST-WIDE/16 VAA,#+BBBB |
Expands the value symbol to 64-bit after assigning a register pair Vaa |
|
Const-string Vaa,[email protected] |
Assigning a value to a register by using a string index high walk string Vaa |
|
Const-class Vaa,[email protected] |
Get a reference to a class by type index assign to register VAA |
Data manipulation Instructions Move
|
Instructions |
Describe |
|
Move VA,VB |
The value of the VB register is assigned to the VA register, VA and VB registers are 4-bit |
|
MOVE/FROM16 VAA,VBBBB |
Assigns the value of the VBBBB register (16-bit) to the VAA register (7-bit), FROM16 indicates that the source register VBBBB is 16-bit |
|
MOVE/16 VAAAA,VBBBB |
Assigns the value of the register VBBBB to the VAAAA register, 16 means that the source register VBBBB and the target register VAAAA are 16-bit |
|
Move-object VA,VB |
The object reference in the VB register is assigned to the VA register, and the VA register and the VB Register are all 4-bit |
|
Move-result VAA |
Assigns a single (32-bit) non-object result of the previous invoke instruction (method call) operation to the VAA register |
|
Move-result-wide VAA |
Assigns a double-word (64-bit) non-object result of the previous invoke instruction operation to the VAA register |
|
Mvoe-result-object VAA |
Assigns the result of the object of the previous invoke instruction operation to the VAA register |
|
Move-exception VAA |
Saves the exception that occurred at the last runtime to the VAA register |
3. Jump Instructions
|
If-eq |
equals then jumps |
== |
|
If-ne |
does not equal the jump |
!= |
|
If-lt |
Less then jump |
< |
|
If-ge |
is greater than or equal to jump |
>= |
|
If-gt |
Jump if greater than |
> |
|
If-le |
is less than or equal to jump |
<= |
|
Goto |
Unconditional Jump |
|
|
Switch |
Branch Jump |
|
Returns 0 Implementation jump
Android Reverse base----Dalvik byte code