metasm/cpu/ia32/parse.rb in metasm-1.0.3 vs metasm/cpu/ia32/parse.rb in metasm-1.0.4
- old
+ new
@@ -131,10 +131,12 @@
# ensure found immediate is really an immediate
raise otok, 'mrm: reg in imm' if imm.kind_of?(Expression) and not imm.externals.grep(Reg).empty?
raise otok, 'mrm: bad reg size' if b.kind_of?(Reg) and i.kind_of?(Reg) and b.sz != i.sz
+ raise otok, 'mrm: cannot encode [rip+reg], only [rip+imm]' if (b and b.val == 16 and i) or (i and i.val == 16 and (b or s != 1))
+
# find default address size
adsz = b ? b.sz : i ? i.sz : nil
# ptsz may be nil now, will be fixed up later (in parse_instr_fixup) to match another instruction argument's size
new adsz, ptsz, s, i, b, imm, seg
end
@@ -352,8 +354,12 @@
Reg.s_to_i[name]
end
def instr_uncond_jump_to(target)
parse_instruction("jmp #{target}")
+ end
+
+ def instr_jump_stop
+ parse_instruction("hlt")
end
end
end