2001-07-16 16:26:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
* *
|
|
|
|
* YAP Prolog %W% %G%
|
|
|
|
* *
|
|
|
|
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
|
|
|
* *
|
|
|
|
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
|
|
|
* *
|
|
|
|
**************************************************************************
|
|
|
|
* *
|
|
|
|
* File: sshift.h *
|
|
|
|
* Last rev: 19/2/88 *
|
|
|
|
* mods: *
|
|
|
|
* comments: stack shifter functionality for YAP *
|
|
|
|
* *
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/* The difference between the old stack pointers and the new ones */
|
2011-05-04 10:11:41 +01:00
|
|
|
extern Int LOCAL_HDiff,
|
|
|
|
LOCAL_GDiff,
|
|
|
|
LOCAL_LDiff,
|
|
|
|
LOCAL_TrDiff,
|
|
|
|
LOCAL_XDiff,
|
|
|
|
LOCAL_DelayDiff;
|
2001-07-16 16:26:14 +01:00
|
|
|
|
|
|
|
/* The old stack pointers */
|
2011-05-04 10:11:41 +01:00
|
|
|
extern CELL *LOCAL_OldASP, *LOCAL_OldLCL0;
|
|
|
|
extern tr_fr_ptr LOCAL_OldTR;
|
|
|
|
extern CELL *LOCAL_OldGlobalBase, *LOCAL_OldH, *LOCAL_OldH0;
|
|
|
|
extern ADDR LOCAL_OldTrailBase, LOCAL_OldTrailTop;
|
|
|
|
extern ADDR LOCAL_OldHeapBase, LOCAL_OldHeapTop;
|
2001-07-16 16:26:14 +01:00
|
|
|
|
|
|
|
#define CharP(ptr) ((char *) (ptr))
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsHeapP(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN int IsHeapP(CELL * ptr)
|
|
|
|
{
|
|
|
|
return (int) ((ptr >= (CELL *)HeapBase && ptr <= (CELL *)HeapTop) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Adjusting cells and pointers to cells */
|
|
|
|
|
|
|
|
inline EXTERN CELL * PtoGloAdjust(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN CELL * PtoGloAdjust(CELL * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (CELL *) (((CELL *)(CharP(ptr) + LOCAL_GDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN CELL * PtoDelayAdjust(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN CELL * PtoDelayAdjust(CELL * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (CELL *) (((CELL *)(CharP(ptr) + LOCAL_DelayDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN tr_fr_ptr PtoTRAdjust(tr_fr_ptr);
|
|
|
|
|
|
|
|
inline EXTERN tr_fr_ptr PtoTRAdjust(tr_fr_ptr ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (tr_fr_ptr) (((tr_fr_ptr)(CharP(ptr) + LOCAL_TrDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN CELL * CellPtoTRAdjust(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN CELL * CellPtoTRAdjust(CELL * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (CELL *) (((CELL *)(CharP(ptr) + LOCAL_TrDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN CELL * PtoLocAdjust(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN CELL * PtoLocAdjust(CELL * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (CELL *) (((CELL *)(CharP(ptr) + LOCAL_LDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN choiceptr ChoicePtrAdjust(choiceptr);
|
|
|
|
|
|
|
|
inline EXTERN choiceptr ChoicePtrAdjust(choiceptr ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (choiceptr) (((choiceptr)(CharP(ptr) + LOCAL_LDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef TABLING
|
|
|
|
|
|
|
|
inline EXTERN choiceptr ConsumerChoicePtrAdjust(choiceptr);
|
|
|
|
|
|
|
|
inline EXTERN choiceptr ConsumerChoicePtrAdjust(choiceptr ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (choiceptr) (((choiceptr)(CharP(ptr) + LOCAL_LDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN choiceptr GeneratorChoicePtrAdjust(choiceptr);
|
|
|
|
|
|
|
|
inline EXTERN choiceptr GeneratorChoicePtrAdjust(choiceptr ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (choiceptr) (((choiceptr)(CharP(ptr) + LOCAL_LDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* TABLING */
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN CELL GlobalAdjust(CELL);
|
|
|
|
|
|
|
|
inline EXTERN CELL GlobalAdjust(CELL val)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (CELL) ((val+LOCAL_GDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN CELL DelayAdjust(CELL);
|
|
|
|
|
|
|
|
inline EXTERN CELL DelayAdjust(CELL val)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (CELL) ((val+LOCAL_DelayDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN ADDR GlobalAddrAdjust(ADDR);
|
|
|
|
|
|
|
|
inline EXTERN ADDR GlobalAddrAdjust(ADDR ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (ADDR) ((ptr+LOCAL_GDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN ADDR DelayAddrAdjust(ADDR);
|
|
|
|
|
|
|
|
inline EXTERN ADDR DelayAddrAdjust(ADDR ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (ADDR) ((ptr+LOCAL_DelayDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN CELL LocalAdjust(CELL);
|
|
|
|
|
|
|
|
inline EXTERN CELL LocalAdjust(CELL val)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (CELL) ((val+LOCAL_LDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN ADDR LocalAddrAdjust(ADDR);
|
|
|
|
|
|
|
|
inline EXTERN ADDR LocalAddrAdjust(ADDR ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (ADDR) ((ptr+LOCAL_LDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN CELL TrailAdjust(CELL);
|
|
|
|
|
|
|
|
inline EXTERN CELL TrailAdjust(CELL val)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (CELL) ((val+LOCAL_TrDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN ADDR TrailAddrAdjust(ADDR);
|
|
|
|
|
|
|
|
inline EXTERN ADDR TrailAddrAdjust(ADDR ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (ADDR) ((ptr+LOCAL_TrDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* heap data structures */
|
|
|
|
|
|
|
|
inline EXTERN Functor FuncAdjust(Functor);
|
|
|
|
|
|
|
|
inline EXTERN Functor FuncAdjust(Functor f)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (Functor) ((Functor)(CharP(f)+LOCAL_HDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN CELL * CellPtoHeapAdjust(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN CELL * CellPtoHeapAdjust(CELL * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (CELL *) (((CELL *)(CharP(ptr) + LOCAL_HDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if USE_OFFSETS
|
|
|
|
|
|
|
|
inline EXTERN Atom AtomAdjust(Atom);
|
|
|
|
|
|
|
|
inline EXTERN Atom AtomAdjust(Atom at)
|
|
|
|
{
|
|
|
|
return (Atom) ((at) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN Prop PropAdjust(Prop);
|
|
|
|
|
|
|
|
inline EXTERN Prop PropAdjust(Prop p)
|
|
|
|
{
|
|
|
|
return (Prop) ((p) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
inline EXTERN Atom AtomAdjust(Atom);
|
|
|
|
|
|
|
|
inline EXTERN Atom AtomAdjust(Atom at)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (Atom) ((at == NULL ? (at) : (Atom)(CharP(at)+LOCAL_HDiff) ));
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-06-01 05:29:01 +01:00
|
|
|
inline EXTERN Prop PropAdjust(Prop);
|
2001-07-16 16:26:14 +01:00
|
|
|
|
2002-06-01 05:29:01 +01:00
|
|
|
inline EXTERN Prop PropAdjust(Prop p)
|
2001-07-16 16:26:14 +01:00
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (Prop) ((p == NULL ? (p) : (Prop)(CharP(p)+LOCAL_HDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-06-01 05:29:01 +01:00
|
|
|
#endif
|
2001-07-16 16:26:14 +01:00
|
|
|
|
|
|
|
inline EXTERN Term AtomTermAdjust(Term);
|
|
|
|
|
|
|
|
inline EXTERN Term AtomTermAdjust(Term at)
|
|
|
|
{
|
2002-06-01 05:29:01 +01:00
|
|
|
return (Term) ((at) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if TAGS_FAST_OPS
|
|
|
|
|
|
|
|
inline EXTERN Term BlobTermAdjust(Term);
|
|
|
|
|
|
|
|
inline EXTERN Term BlobTermAdjust(Term t)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (Term) ((t-LOCAL_HDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
inline EXTERN Term BlobTermAdjust(Term);
|
|
|
|
|
|
|
|
inline EXTERN Term BlobTermAdjust(Term t)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (Term) ((t+LOCAL_HDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
inline EXTERN AtomEntry * AtomEntryAdjust(AtomEntry *);
|
|
|
|
|
|
|
|
inline EXTERN AtomEntry * AtomEntryAdjust(AtomEntry * at)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (AtomEntry *) ((AtomEntry *)(CharP(at)+LOCAL_HDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-01-05 04:04:14 +00:00
|
|
|
inline EXTERN union CONSULT_OBJ * ConsultObjAdjust(union CONSULT_OBJ *);
|
2001-07-16 16:26:14 +01:00
|
|
|
|
2002-01-05 04:04:14 +00:00
|
|
|
inline EXTERN union CONSULT_OBJ * ConsultObjAdjust(union CONSULT_OBJ * co)
|
2001-07-16 16:26:14 +01:00
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (union CONSULT_OBJ *) ((union CONSULT_OBJ *)(CharP(co)+LOCAL_HDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN DBRef DBRefAdjust(DBRef);
|
|
|
|
|
|
|
|
inline EXTERN DBRef DBRefAdjust(DBRef dbr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (DBRef) ((DBRef)(CharP(dbr)+LOCAL_HDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN Term CodeAdjust(Term);
|
|
|
|
|
|
|
|
inline EXTERN Term CodeAdjust(Term dbr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (Term) (((Term)(dbr)+LOCAL_HDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN ADDR AddrAdjust(ADDR);
|
|
|
|
|
|
|
|
inline EXTERN ADDR AddrAdjust(ADDR addr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (ADDR) ((ADDR)(CharP(addr)+LOCAL_HDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN CODEADDR CodeAddrAdjust(CODEADDR);
|
|
|
|
|
|
|
|
inline EXTERN CODEADDR CodeAddrAdjust(CODEADDR addr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (CODEADDR) ((CODEADDR)(CharP(addr)+LOCAL_HDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN BlockHeader * BlockAdjust(BlockHeader *);
|
|
|
|
|
|
|
|
inline EXTERN BlockHeader * BlockAdjust(BlockHeader * addr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (BlockHeader *) ((BlockHeader *)(CharP(addr)+LOCAL_HDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN yamop * PtoOpAdjust(yamop *);
|
|
|
|
|
|
|
|
inline EXTERN yamop * PtoOpAdjust(yamop * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (yamop *) (((yamop *)(CharP(ptr) + LOCAL_HDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN CELL * PtoHeapCellAdjust(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN CELL * PtoHeapCellAdjust(CELL * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (CELL *) (((CELL *)(CharP(ptr) + LOCAL_HDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN PredEntry * PtoPredAdjust(PredEntry *);
|
|
|
|
|
|
|
|
inline EXTERN PredEntry * PtoPredAdjust(PredEntry * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (PredEntry *) (((PredEntry *)(CharP(ptr) + LOCAL_HDiff)) );
|
2002-06-01 05:29:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN ArrayEntry * PtoArrayEAdjust(ArrayEntry *);
|
|
|
|
|
|
|
|
inline EXTERN ArrayEntry * PtoArrayEAdjust(ArrayEntry * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (ArrayEntry *) (((ArrayEntry *)(CharP(ptr) + LOCAL_HDiff)) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if PRECOMPUTE_REGADDRESS
|
|
|
|
|
|
|
|
inline EXTERN AREG XAdjust(AREG);
|
|
|
|
|
|
|
|
inline EXTERN AREG XAdjust(AREG reg)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (AREG) ((AREG)((reg)+LOCAL_XDiff) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
inline EXTERN AREG XAdjust(AREG);
|
|
|
|
|
|
|
|
inline EXTERN AREG XAdjust(AREG reg)
|
|
|
|
{
|
|
|
|
return (AREG) ((reg) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
inline EXTERN YREG YAdjust(YREG);
|
|
|
|
|
|
|
|
inline EXTERN YREG YAdjust(YREG reg)
|
|
|
|
{
|
|
|
|
return (YREG) ((reg) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsOldLocal(CELL);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldLocal(CELL reg)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (IN_BETWEEN(LOCAL_OldASP, reg, LOCAL_OldLCL0));
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* require because the trail might contain dangling pointers */
|
|
|
|
|
|
|
|
inline EXTERN int IsOldLocalInTR(CELL);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldLocalInTR(CELL reg)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (IN_BETWEEN(LOCAL_OldH, reg, LOCAL_OldLCL0) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsOldLocalInTRPtr(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldLocalInTRPtr(CELL * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (IN_BETWEEN(LOCAL_OldH, ptr, LOCAL_OldLCL0) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsOldH(CELL);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldH(CELL reg)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (( CharP(reg) == CharP(LOCAL_OldH) ) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsOldGlobal(CELL);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldGlobal(CELL reg)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (IN_BETWEEN(LOCAL_OldH0, reg, LOCAL_OldH) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsOldGlobalPtr(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldGlobalPtr(CELL * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (IN_BETWEEN( LOCAL_OldH0, ptr, LOCAL_OldH) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsOldDelay(CELL);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldDelay(CELL reg)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (IN_BETWEEN(LOCAL_OldGlobalBase, reg, LOCAL_OldH0) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsOldDelayPtr(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldDelayPtr(CELL * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (IN_BETWEEN( LOCAL_OldGlobalBase, ptr, LOCAL_OldH0) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsOldTrail(CELL);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldTrail(CELL reg)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (IN_BETWEEN(LOCAL_OldTrailBase, reg, LOCAL_OldTR) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsOldTrailPtr(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldTrailPtr(CELL * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (IN_BETWEEN(LOCAL_OldTrailBase, ptr, LOCAL_OldTR) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsOldCode(CELL);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldCode(CELL reg)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (IN_BETWEEN(LOCAL_OldHeapBase, reg, LOCAL_OldHeapTop) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsOldCodeCellPtr(CELL *);
|
|
|
|
|
|
|
|
inline EXTERN int IsOldCodeCellPtr(CELL * ptr)
|
|
|
|
{
|
2011-05-04 10:11:41 +01:00
|
|
|
return (int) (IN_BETWEEN(LOCAL_OldHeapBase, ptr, LOCAL_OldHeapTop) );
|
2001-07-16 16:26:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline EXTERN int IsGlobal(CELL);
|
|
|
|
|
|
|
|
inline EXTERN int IsGlobal(CELL reg)
|
|
|
|
{
|
|
|
|
return (int) (IN_BETWEEN(GlobalBase, reg, H) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void STD_PROTO(AdjustStacksAndTrail, (void));
|
|
|
|
void STD_PROTO(AdjustRegs, (int));
|