From 6b3ac53eb4c4693f41ad645a3b5ea37e8ef9eef1 Mon Sep 17 00:00:00 2001 From: julianb0 Date: Fri, 28 Jun 2019 19:18:53 +0200 Subject: [PATCH] m --- .gitignore | 3 ++- ka/crt/fmt/printf.k | 5 ++--- vm/pc/exec.c | 15 +++++++++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 0701e7f..e95ece7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.exe *.out +*.com *.sym *.bin *.o @@ -11,4 +12,4 @@ instrs.lst stdout.txt stderr.txt stdin.txt -a.sym +*.sym diff --git a/ka/crt/fmt/printf.k b/ka/crt/fmt/printf.k index 98df0c1..ce924a9 100644 --- a/ka/crt/fmt/printf.k +++ b/ka/crt/fmt/printf.k @@ -26,14 +26,13 @@ print: mov rcx, STRLEN_MAX .1: - test b[ax0], b[ax0] - j.z .2 + cmp b[ax0], 0 + ret.z prn b[ax0] inc ax0 loop .1 -.2: ret ; diff --git a/vm/pc/exec.c b/vm/pc/exec.c index f84b26a..f332f7a 100644 --- a/vm/pc/exec.c +++ b/vm/pc/exec.c @@ -62,16 +62,23 @@ void exec_instr(ctx_t *ctx, rx2++; // since last frame change rx1++; // since startup -#ifndef NDEBUG - dump_instr(ctx, in, p1, p2, lock, rep, cond); -#endif - // // For REPs we evaluate the condition AFTER running the instruction, // in a do ... while(cond) fashion // if (!rep && !eval_cond(ctx, cond)) + { +#ifndef NDEBUG + // Say something about ignored instruction? + //trace("0x%lX:\n", rpc); +#endif return; + } + + +#ifndef NDEBUG + dump_instr(ctx, in, p1, p2, lock, rep, cond); +#endif do_rep: