scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 4c2dee977b6510bea2600763a794b60c798e0d25
parent 9e8a53fee324554e6d0dea50071ab51d729096b3
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 16 Mar 2015 06:51:02 +0000

Add index addressing

This addressing is always the result of some operations in the tree,
and it means the value of the node can be taken using some index mode,
that for now is going to be using HL.

Diffstat:
cc2/cc2.h | 1+
cc2/code.c | 3+++
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/cc2/cc2.h b/cc2/cc2.h @@ -11,6 +11,7 @@ #define MEM 'T' #define PAR 'P' #define CONST '#' +#define INDEX 'I' #define LABEL 'L' #define OADD '+' #define OSUB '-' diff --git a/cc2/code.c b/cc2/code.c @@ -144,6 +144,9 @@ addr2txt(Addr *a) case AUTO: printf("(IX+%d)", a->u.i); break; + case INDEX: + fputs("(HL)", stdout); + break; case MEM: sym = a->u.sym; if (sym->name)