The byte code would look like
0x15 0x02
0x15 0x03
0x60
0x36 0x01
where 0x02 is the offset from LV to arg1, 0x03 is the offset from LV to arg2, and 0x01 is the offset from LV to i.
The local variable i would have 111 in it, if local variable arg1 has 100 and local variable arg2 has 11.
The stack would look like this before the IADD
011 <- SP
100 <- operand stack starts here
011 <- LV + 3
100 <- LV + 2
xxx <- LV + 1
xxx <- LV
The stack would look like this after the ISTORE
011 <- LV + 3
100 <- LV + 2
111 <- LV + 1
xxx <- LV
The code you supplied will perform the addition. You do not need to shift.
Response to comment about overflow:
Create a grid for adding two 2-bit numbers. 00 01 10 11 across the top and along the side.
| 00 01 10 11|
00| |
01| |
10| |
11| |
In the grid, show the result of the arithmetic, excluding overflow. Circle the entries that cause overflow. Such a table might give you a clue for detecting overflow, without looking at the carry bit.