X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcommon%2Fexprdefs.h;h=50a5a25b6365f61cf5a7fbb7058a378e70246d30;hb=74108cd74fc3ca3ad4f69b743233fa79791106b9;hp=354c6ba1a64e784627589e49e1c23f47f2062c43;hpb=61b69316c5adaeecc7c35bfb3892c580c17db8cb;p=cc65 diff --git a/src/common/exprdefs.h b/src/common/exprdefs.h index 354c6ba1a..50a5a25b6 100644 --- a/src/common/exprdefs.h +++ b/src/common/exprdefs.h @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2010, Ullrich von Bassewitz */ +/* (C) 1998-2012, Ullrich von Bassewitz */ /* Roemerstrasse 52 */ /* D-70794 Filderstadt */ /* EMail: uz@cc65.org */ @@ -60,6 +60,7 @@ #define EXPR_SEGMENT (EXPR_LEAFNODE | 0x04) /* Linker only */ #define EXPR_MEMAREA (EXPR_LEAFNODE | 0x05) /* Linker only */ #define EXPR_ULABEL (EXPR_LEAFNODE | 0x06) /* Assembler only */ +#define EXPR_BANK (EXPR_LEAFNODE | 0x07) /* Binary operations, left and right hand sides are valid */ #define EXPR_PLUS (EXPR_BINARYNODE | 0x01) @@ -89,13 +90,16 @@ #define EXPR_NOT (EXPR_UNARYNODE | 0x02) #define EXPR_SWAP (EXPR_UNARYNODE | 0x03) #define EXPR_BOOLNOT (EXPR_UNARYNODE | 0x04) +#define EXPR_BANKRAW (EXPR_UNARYNODE | 0x05) /* Assembler only */ #define EXPR_BYTE0 (EXPR_UNARYNODE | 0x08) #define EXPR_BYTE1 (EXPR_UNARYNODE | 0x09) -#define EXPR_BYTE2 (EXPR_UNARYNODE | 0x0A) -#define EXPR_BYTE3 (EXPR_UNARYNODE | 0x0B) -#define EXPR_WORD0 (EXPR_UNARYNODE | 0x0C) -#define EXPR_WORD1 (EXPR_UNARYNODE | 0x0D) +#define EXPR_BYTE2 (EXPR_UNARYNODE | 0x0A) +#define EXPR_BYTE3 (EXPR_UNARYNODE | 0x0B) +#define EXPR_WORD0 (EXPR_UNARYNODE | 0x0C) +#define EXPR_WORD1 (EXPR_UNARYNODE | 0x0D) +#define EXPR_FARADDR (EXPR_UNARYNODE | 0x0E) +#define EXPR_DWORD (EXPR_UNARYNODE | 0x0F) @@ -109,20 +113,22 @@ struct ExprNode { union { long IVal; /* If this is a int value */ struct SymEntry* Sym; /* If this is a symbol */ - unsigned SegNum; /* If this is a segment */ - unsigned ImpNum; /* If this is an import */ - struct Memory* Mem; /* If this is a memory area */ + unsigned SecNum; /* If this is a section and Obj != 0 */ + unsigned ImpNum; /* If this is an import and Obj != 0 */ + struct Import* Imp; /* If this is an import and Obj == 0 */ + struct MemoryArea* Mem; /* If this is a memory area */ struct Segment* Seg; /* If this is a segment */ - struct Section* Sec; /* If section and Obj is NULL */ + struct Section* Sec; /* If this is a section and Obj == 0 */ } V; }; /* Macros to determine the expression type */ -#define EXPR_IS_LEAF(Op) (((Op) & EXPR_TYPEMASK) == EXPR_LEAFNODE) -#define EXPR_IS_UNARY(Op) (((Op) & EXPR_TYPEMASK) == EXPR_UNARYNODE) -#define EXPR_IS_BINARY(OP) (((Op) & EXPR_TYPEMASK) == EXPR_BINARYNODE) +#define EXPR_NODETYPE(Op) ((Op) & EXPR_TYPEMASK) +#define EXPR_IS_LEAF(Op) (EXPR_NODETYPE (Op) == EXPR_LEAFNODE) +#define EXPR_IS_UNARY(Op) (EXPR_NODETYPE (Op) == EXPR_UNARYNODE) +#define EXPR_IS_BINARY(OP) (EXPR_NODETYPE (Op) == EXPR_BINARYNODE)