As we know, Dalvik is a register-based machine, which defines the syntax of bytecode. There are multiple instructions operating with registers in order to access and manipulate data. The total size of any instruction is a multiple of 2 bytes. All instructions are type-agnostic, which means they don't differentiate between values of different data types as long as their sizes are the same.
Here are some examples of what they look like in the official documentation. We'll split them into several categories for easier navigation:
- Data access and movement:
Opcode and format | Mnemonic/syntax | Arguments | Description | Examples |
01 12x | move vA, vB | A: destination register (4 bits) B: source register (4 bits) |
Move the contents of one non-object register to another | 0110 - move v0, v1 |
0a 11x | move-result vAA | A: destination register (8 bits) | Move the single-word non-object result of the most recent invoke-kind into the indicated register—this must be given as the instruction... |