/*-------------------------------------------------------------------------*/
/* GNU Prolog                                                              */
/*                                                                         */
/* Part  : Prolog engine                                                   */
/* File  : wam_archi.def (gives rise to wam_archi.h)                       */
/* Descr.: Wam architecture definition - description file                  */
/* Author: Daniel Diaz                                                     */
/*                                                                         */
/* Copyright (C) 1999,2000 Daniel Diaz                                     */
/*                                                                         */
/* GNU Prolog is free software; you can redistribute it and/or modify it   */
/* under the terms of the GNU General Public License as published by the   */
/* Free Software Foundation; either version 2, or any later version.       */
/*                                                                         */
/* GNU Prolog is distributed in the hope that it will be useful, but       */
/* WITHOUT ANY WARRANTY; without even the implied warranty of              */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU        */
/* General Public License for more details.                                */
/*                                                                         */
/* You should have received a copy of the GNU General Public License along */
/* with this program; if not, write to the Free Software Foundation, Inc.  */
/* 59 Temple Place - Suite 330, Boston, MA 02111, USA.                     */
/*-------------------------------------------------------------------------*/

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



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

typedef WamWord *WamWordP;


@begin regs

@filler NB_OF_X_REGS

@reg 3 WamCont  CP                          /* Continuation pointer        */

@reg 3 WamWordP E                           /* Last environment pointer    */

@reg 2 WamWordP B                           /* Last choice point pointer   */

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

@reg 2 WamWordP TR                          /* Top of the trail            */
@reg 4 WamWordP S                           /* Unification pointer         */

@reg 9 WamWord  STAMP                       /* Choice point stamp (for FD) */
@reg 3 WamWordP CS                          /* Top of the constraint stack */

@reg 9 WamWord  BCI                         /* Byte-Code info              */


@end regs




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


@begin tags

@tag INT int                                /* Integer (must be the first) */
@tag REF stack                              /* Reference                   */
@tag FDV stack                              /* Finite Domain Variable      */
@tag ATM int                                /* Atom                        */
@tag FLT stack                              /* Float                       */
@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 cstr   2048 CS                        /* Constraint stack           */
@stack global 4096 H                         /* Global stack               */
@stack local  3192 Local_Top                 /* Local  stack (after global)*/

@end stacks
