From b66021c042811542addddc61abf3674d9c2a81ef Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sun, 2 Feb 2014 21:16:23 +0900 Subject: [PATCH] print bytecode index in hex --- src/codegen.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/codegen.c b/src/codegen.c index 83fcd23b..d70906d3 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -1532,10 +1532,10 @@ print_code(pic_state *pic, struct pic_code c) printf("OP_CSET\t%d\t%d\n", c.u.r.depth, c.u.r.idx); break; case OP_JMP: - printf("OP_JMP\t%d\n", c.u.i); + printf("OP_JMP\t%x\n", c.u.i); break; case OP_JMPIF: - printf("OP_JMPIF\t%d\n", c.u.i); + printf("OP_JMPIF\t%x\n", c.u.i); break; case OP_NOT: puts("OP_NOT"); @@ -1606,6 +1606,7 @@ pic_dump_irep(pic_state *pic, struct pic_irep *irep) printf(": %d -> %d\n", irep->cv_tbl[i], i); } for (i = 0; i < irep->clen; ++i) { + printf("%02x ", i); print_code(pic, irep->code[i]); }