- if (LOWER16((regs[i])) == 0) {
- *code_p++ = MIPS32_LUI(i, UPPER16((regs[i]))); /* if lower half word is 0, lui instruction only */
- code_len++;
- } else if (UPPER16((regs[i])) == 0) {
- *code_p++ = MIPS32_ORI(i, 0, LOWER16((regs[i]))); /* if upper half word is 0, ori with $0 only*/
- code_len++;
- } else {
- *code_p++ = MIPS32_LUI(i, UPPER16((regs[i]))); /* default, load with lui and ori instructions */
- *code_p++ = MIPS32_ORI(i, i, LOWER16((regs[i])));
- code_len += 2;
+ if (LOWER16((regs[i])) == 0) /* if lower half word is 0, lui instruction only */
+ pracc_add(&ctx, 0, MIPS32_LUI(i, UPPER16((regs[i]))));
+ else if (UPPER16((regs[i])) == 0) /* if upper half word is 0, ori with $0 only*/
+ pracc_add(&ctx, 0, MIPS32_ORI(i, 0, LOWER16((regs[i]))));
+ else { /* default, load with lui and ori instructions */
+ pracc_add(&ctx, 0, MIPS32_LUI(i, UPPER16((regs[i]))));
+ pracc_add(&ctx, 0, MIPS32_ORI(i, i, LOWER16((regs[i]))));