/*-------------------------------------------------------------------------*/
/* Prolog To Wam Compiler                INRIA Rocquencourt - CLoE Project */
/* C Run-time                                           Daniel Diaz - 1994 */
/*                                                                         */
/* Architecture Definition - Description file                              */
/*                                                                         */
/* archi.def                                                               */
/*-------------------------------------------------------------------------*/

/*---------------------------------*/
/* Register Descriptions           */
/*---------------------------------*/



#define NB_OF_X_REGS               256

#define X(x)                       (reg_bank[x])
#define A(a)                       (reg_bank[a])


typedef WamWord *WamWordP;
typedef AtomInf *AtomInfP;

@begin regs

@filler NB_OF_X_REGS

@reg 3 WamCont  CP                          /* continuation pointer        */

@reg 2 WamWordP E                           /* last environment pointer    */

@reg 2 WamWordP B                           /* last choice point pointer   */
@reg 4 WamWordP BC                          /* backtrack cut pointer       */

@reg 1 WamWordP H                           /* top of the heap             */

@reg 2 WamWordP TR                          /* top of the trail            */
@reg 9 WamWordP S                           /* Unification pointer         */

                                            /* global vars as regs         */
@reg 9 WamWord  NIL                         /* most used tagged word       */
@reg 9 WamWord  CMN                         /* calling module  (non local) */




@end regs

#define word_nil                   NIL
#define calling_module_nb          CMN



/*---------------------------------*/
/* Tag Descriptions                */
/*---------------------------------*/


@begin tags

@tag INT int                                /* Integer (must be the first) */
@tag REF stack                              /* Reference */
@tag CST malloc AtomInfP                    /* Constant  */
@tag LST stack                              /* List      */
@tag STC stack                              /* Structure */

@end tags




/*---------------------------------*/
/* Stack Descriptions              */
/*---------------------------------*/


#define KBytes_To_Wam_Words(kb)    ((1024*kb+sizeof(WamWord)-1)/sizeof(WamWord))

#define Wam_Words_To_KBytes(ww)    (ww*sizeof(WamWord)/1024)

#define Local_Top                  ((B>=E) ? B : E)

@begin stacks

@stack trail  2048 TR                        /* Trail  stack               */
@stack global 4096 H                         /* Global stack               */
@stack local  3192 Local_Top                 /* Local  stack (after global)*/

@end stacks
