3821 args = instr.args[:]
3822 args = [arg.replace_expr(float_replace)
for arg
in args]
3826 if self.
do_all_segm and instr.additional_info.g2.value:
3827 my_ss = {1: CS, 2: SS, 3: DS, 4: ES, 5: FS, 6: GS}[
3828 instr.additional_info.g2.value]
3829 if my_ss
is not None:
3830 for i, a
in enumerate(args):
3831 if isinstance(a, m2_expr.ExprMem)
and not a.is_op_segm():
3832 args[i] = m2_expr.ExprMem(m2_expr.ExprOp(
'segm', my_ss,
3835 if not instr.name.lower()
in mnemo_func:
3836 raise NotImplementedError(
"Mnemonic %s not implemented" % instr.name)
3838 instr_ir, extra_ir = mnemo_func[
3839 instr.name.lower()](self, instr, *args)
3840 self.
mod_pc(instr, instr_ir, extra_ir)
3842 self.
mod_pc(instr, instr_ir, extra_ir)
3843 instr.additional_info.except_on_instr =
False
3844 if instr.additional_info.g1.value & 6 == 0
or \
3845 not instr.name
in repeat_mn:
3846 return instr_ir, extra_ir
3847 if instr.name ==
"MOVSD" and len(instr.args) == 2:
3848 return instr_ir, extra_ir
3850 instr.additional_info.except_on_instr =
True
3852 s = {
"B": 8,
"W": 16,
"D": 32,
'Q': 64}[instr.name[-1]]
3853 size = instr.v_opmode()
3854 c_reg = mRCX[instr.mode][:size]
3862 cond_dec = m2_expr.ExprCond(c_reg - m2_expr.ExprInt_from(c_reg, 1),
3863 m2_expr.ExprInt1(0), m2_expr.ExprInt1(1))
3867 elif instr.additional_info.g1.value & 2:
3868 c_cond = cond_dec | zf
3869 elif instr.additional_info.g1.value & 4:
3870 c_cond = cond_dec | (zf ^ m2_expr.ExprInt1(1))
3873 lbl_do = m2_expr.ExprId(self.
gen_label(), instr.mode)
3874 lbl_end = m2_expr.ExprId(self.
gen_label(), instr.mode)
3875 lbl_skip = m2_expr.ExprId(self.
get_next_label(instr), instr.mode)
3876 lbl_next = m2_expr.ExprId(self.
get_next_label(instr), instr.mode)
3880 for i, e
in enumerate(ir):
3881 src = e.src.replace_expr({lbl_next: lbl_end})
3882 ir[i] = m2_expr.ExprAff(e.dst, src)
3884 cond_bloc.append(m2_expr.ExprAff(c_reg,
3885 c_reg - m2_expr.ExprInt_from(c_reg,
3887 cond_bloc.append(m2_expr.ExprAff(self.
IRDst, m2_expr.ExprCond(c_cond,
3890 cond_bloc =
irbloc(lbl_end.name, [cond_bloc])
3893 c =
irbloc(lbl_do.name, [e_do])
3894 c.except_automod =
False
3895 e_n = [m2_expr.ExprAff(self.
IRDst, m2_expr.ExprCond(c_reg, lbl_do,
3897 return e_n, [cond_bloc, c] + extra_ir