C:/Users/Dennis/src/lang/russell.orig/src/lh_opt/codegen.h

Go to the documentation of this file.
00001 #define MAXLABELSZ 512
00002 #define MISSING -2      /* nonexistent entry in table */
00003 
00004 /* code generation macros */
00005 #define genl(op,l)  genl_RIC(Goutfile,op,l)
00006 #define gen0(op)  gen_RIC(Goutfile,op,SK,SK,SK)
00007 #define gen1(op,a1)  gen_RIC(Goutfile,op,a1,SK,SK)
00008 #define gen2(op,a1,a2)  gen_RIC(Goutfile,op,a1,a2,SK)
00009 #define gen3(op,a1,a2,a3)  gen_RIC(Goutfile,op,a1,a2,a3)
00010 #ifdef  DEBUG
00011 #define ASSERT(a,b) { if (!(a)) {dbgmsg(b);abort();} ;}
00012 #else
00013 #define ASSERT(a,b)
00014 #endif
00015 
00016 #ifdef  DEBUG
00017 #define ASSERT2(a,b,c)  {if (!(a)) {dbgmsg(b,c);abort();};}
00018 #else
00019 #define ASSERT2(a,b,c)
00020 #endif
00021 
00022 #define Gallocate Vallocate  /* For the moment they can be the same */
00023 #define Gnewlabel Vnewlabel
00024 
00025 /* allocate function object */
00026 #define ALLOC_FO(loc) {\
00027          gen2(ALH, C3, loc); \
00028 }
00029 
00030 #define DISPLAY(dest,level) {\
00031         if (level == 0) { \
00032             dest = GF; \
00033         } else if (level == Glevel) { \
00034             dest = AR; \
00035         } else { \
00036             int i = Glevel - level;  /* number of indirections needed */ \
00037             int source = AR; \
00038 \
00039             dest = avail_loc++; \
00040             gen2(DCL, dest, DCL_ADDR); \
00041             while (i != 0) { \
00042                 gen3(LDI, source, 0, dest); \
00043                 source = dest; \
00044                 i--; \
00045             } \
00046         }\
00047 }
00048 
00049 #define UNDISPLAY(dest) {\
00050         if (dest != GF && dest != AR) {\
00051             gen2(UDC, dest, 1);\
00052         }\
00053 }
00054 

Generated on Fri Jan 25 10:39:45 2008 for russell by  doxygen 1.5.4