# APKinspector / androguard / specs / dalvik / opcodes / opcode-16-const-wide.html

The default branch has multiple heads

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110``` ``` const-wide

const-wide

Purpose

Move the given literal value (sign-extended to 64 bits) into the specified register-pair.

Details

Op & Format Mnemonic / Syntax Arguments
16 21s const-wide/16 vAA, #+BBBB A: destination register (8 bits)
B: signed int (16 bits)
17 31i const-wide/32 vAA, #+BBBBBBBB A: destination register (8 bits)
B: signed int (32 bits)
18 51l const-wide vAA, #+BBBBBBBBBBBBBBBB A: destination register (8 bits)
B: arbitrary double-width (64-bit) constant
19 21h const-wide/high16 vAA, #+BBBB000000000000 A: destination register (8 bits)
B: signed int (16 bits)

Constraints

• A must be a valid register index in the current stack frame.

Behavior

• First, an adjusted value B' is determined as follows:
• If we are executing the /high16 variant, then B is left-shifted by 40 bits, that is, B'=B << 0x28
• Otherwise, if B is a 16 bit or 32 bit constant, it is sign-extended to 64 bits, that is, B'=sign-extended(B).
• Otherwise, B'=B.
• The immediate value B is moved into the register pair (vA, v(A+1)), that is,
• vA' = B << 0x20
• v(A+1)' = B & 0xffffffff
• If v(A-1) is the lower half of a register pair, v(A-1)' becomes undefined.
• If v(A+2) is the upper half of a register pair, v(A+2)' becomes undefined.

Exceptions

None.

```