scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit ffc1d8068bbe61041c23aaccfa2457280ed97c27
parent e02c78834f4beb50cf32a87f4141da46e823fa4a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 15 Mar 2015 10:08:31 +0000

Add INC assmbler instruction to cc2

Diffstat:
Mcc2/cc2.h | 2+-
Mcc2/code.c | 6++++--
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/cc2/cc2.h b/cc2/cc2.h @@ -108,7 +108,7 @@ enum nerrors { enum { - LDW, LDL, LDH, MOV, ADD, PUSH, POP, RET, NOP + LDW, LDL, LDH, MOV, ADD, PUSH, POP, RET, NOP, INC }; enum { diff --git a/cc2/code.c b/cc2/code.c @@ -29,7 +29,8 @@ static void (*instcode[])(void) = { [PUSH] = inst1, [POP] = inst1, [RET] = inst0, - [NOP] = inst0 + [NOP] = inst0, + [INC] = inst1 }; static char *insttext[] = { @@ -41,7 +42,8 @@ static char *insttext[] = { [PUSH] = "PUSH", [POP] = "POP", [RET] = "RET", - [NOP] = "NOP" + [NOP] = "NOP", + [INC] = "INC" }; typedef struct inst Inst;