- if ((val & 0xff) || !need_or)
- EOP_C_DOP_IMM(A_COND_AL,need_or ? A_OP_ORR : A_OP_MOV, 0, d, d, 0, val&0xff);
+ if (val & 0x00ff0000) {
+ EOP_C_DOP_IMM(A_COND_AL,need_or ? A_OP_ORR : A_OP_MOV, 0, need_or ? d : 0, d, 16/2, (val>>16)&0xff);
+ need_or = 1;
+ }
+ if (val & 0x0000ff00) {
+ EOP_C_DOP_IMM(A_COND_AL,need_or ? A_OP_ORR : A_OP_MOV, 0, need_or ? d : 0, d, 24/2, (val>>8)&0xff);
+ need_or = 1;
+ }
+ if ((val &0x000000ff) || !need_or)
+ EOP_C_DOP_IMM(A_COND_AL,need_or ? A_OP_ORR : A_OP_MOV, 0, need_or ? d : 0, d, 0, val&0xff);
+}
+
+static void check_offset_12(unsigned int val)
+{
+ if (!(val & ~0xfff)) return;
+ printf("offset_12 overflow %04x\n", val);
+ exit(1);