1 %default { "store":"sw", "shift":"2" }
4 * Array put, 32 bits or less. vBB[vCC] <- vAA.
5 * for: aput, aput-boolean, aput-byte, aput-char, aput-short
8 FETCH_B(a2, 1) # a2 <- BB
9 GET_OPA(rOBJ) # rOBJ <- AA
10 FETCH_C(a3, 1) # a3 <- CC
11 GET_VREG(a0, a2) # a0 <- vBB (array object)
12 GET_VREG(a1, a3) # a1 <- vCC (requested index)
14 beqz a0, common_errNullObject # yes, bail
15 LOAD_base_offArrayObject_length(a3, a0) # a3 <- arrayObj->length
17 EASN(a0, a0, a1, $shift) # a0 <- arrayObj + index*width
21 bgeu a1, a3, common_errArrayIndex # index >= length, bail
22 FETCH_ADVANCE_INST(2) # advance rPC, load rINST
23 GET_VREG(a2, rOBJ) # a2 <- vAA
24 GET_INST_OPCODE(t0) # extract opcode from rINST
25 $store a2, offArrayObject_contents(a0) # vBB[vCC] <- a2
26 GOTO_OPCODE(t0) # jump to next instruction