void x86_mov_reg_imm( struct x86_function *p, struct x86_reg dst, int imm ) { DUMP_RI( dst, imm ); assert(dst.file == file_REG32); assert(dst.mod == mod_REG); emit_1ub(p, 0xb8 + dst.idx); emit_1i(p, imm); }
void x86_mov16_imm( struct x86_function *p, struct x86_reg dst, uint16_t imm ) { DUMP_RI( dst, imm ); emit_1ub(p, 0x66); if(dst.mod == mod_REG) { emit_1ub(p, 0xb8 + dst.idx); emit_2ub(p, imm & 0xff, imm >> 8); }
void x86_mov_imm( struct x86_function *p, struct x86_reg dst, int imm ) { DUMP_RI( dst, imm ); if(dst.mod == mod_REG) x86_mov_reg_imm(p, dst, imm); else { emit_1ub(p, 0xc7); emit_modrm_noreg(p, 0, dst); emit_1i(p, imm); } }
void x86_cmp_imm( struct x86_function *p, struct x86_reg dst, int imm ) { DUMP_RI( dst, imm ); x86_group1_imm(p, 7, dst, imm); }