about summary refs log tree commit diff stats
path: root/miasm/core/cpu.py
diff options
context:
space:
mode:
Diffstat (limited to 'miasm/core/cpu.py')
-rw-r--r--miasm/core/cpu.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/miasm/core/cpu.py b/miasm/core/cpu.py
index d9c1955b..fac03248 100644
--- a/miasm/core/cpu.py
+++ b/miasm/core/cpu.py
@@ -19,6 +19,7 @@ from miasm.expression.simplifications import expr_simp
 
 
 from miasm.core.asm_ast import AstNode, AstInt, AstId, AstOp
+from miasm.core import utils
 from future.utils import with_metaclass
 
 log = logging.getLogger("cpuhelper")
@@ -1005,6 +1006,19 @@ class instruction(object):
         o += self.gen_args(args)
         return o
 
+    def to_html(self, loc_db=None):
+        out = "%-10s " % self.name
+        out = '<font color="%s">%s</font>' % (utils.COLOR_MNEMO, out)
+
+        args = []
+        for i, arg in enumerate(self.args):
+            if not isinstance(arg, m2_expr.Expr):
+                raise ValueError('zarb arg type')
+            x = self.arg2html(arg, i, loc_db)
+            args.append(x)
+        out += self.gen_args(args)
+        return out
+
     def get_asm_offset(self, expr):
         return m2_expr.ExprInt(self.offset, expr.size)