[NEW] x86_inc instruction with some binary encoding.

This commit is contained in:
sjs 2009-05-24 14:05:40 -07:00
parent 9607df73d2
commit 83accb5bba

View file

@ -671,6 +671,21 @@ class Compiler
emit("idiv #{op}")
end
def x86_inc(op)
emit("inc #{op}")
asm do
if register?(op)
emit_byte(0x40 + regnum(op))
elsif rm32?(op)
emit_byte(0xff)
emit_modrm(
else
raise "unsupported op #{op}, wanted r32 or r/m32"
end
end
end
def x86_push(reg)
emit("push #{reg}")
end