scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 00f7f68edd041f8514eea2d5dc668551c8f2e4cd
parent ad164a259cf96e16ad311a3127578358cddbf432
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 10 Aug 2014 18:13:36 +0200

Print immediate values of LD and ADD in decimal

Diffstat:
Mcc2/cgen.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cc2/cgen.c b/cc2/cgen.c @@ -72,7 +72,8 @@ emit(char op, ...) case ADDI: case LDI: reg1 = va_arg(va, int); imm = va_arg(va, int); - printf("\t%s\t%s,%hX\n", opnames[op], regnames[reg1], imm); + printf("\t%s\t%s,%hd\n", opnames[op], regnames[reg1], imm); + break; case ADDX: case ADCX: reg1 = va_arg(va, int); reg2 = va_arg(va, int);