Annotation of gforth/386.h, revision 1.2

1.1       anton       1: /*
                      2:   $Id: 386.h,v 1.2 1993/07/08 08:52:26 benschop Exp $
                      3:   Copyright 1992 by the ANSI figForth Development Group
                      4: 
                      5:   This is the machine-specific part for Intel 386 compatible processors
                      6: */
                      7: 
                      8: 
                      9: /* Cell and UCell must be the same size as a pointer */
                     10: typedef long Cell;
                     11: typedef unsigned long UCell;
                     12: 
                     13: /* DCell and UDCell must be twice as large as Cell */
                     14: typedef long long DCell;
                     15: typedef unsigned long long UDCell;
                     16: 
                     17: /* define this if IEEE singles and doubles are available as C data types */
                     18: #define IEEE_FP
                     19: 
                     20: /* the IEEE types are used only for loading and storing */
                     21: /* the IEEE double precision type */
                     22: typedef double DFloat;
                     23: /* the IEEE single precision type */
                     24: typedef float SFloat;
                     25: 
                     26: /* define this if the least-significant byte is at the largets address */
                     27: /* #define BIG_ENDIAN */
                     28: 
                     29: #ifdef DIRECT_THREADED
                     30: /* PFA gives the parameter field address corresponding to a cfa */
                     31: #define PFA(cfa)       (((Cell *)cfa)+2)
                     32: /* PFA1 is a special version for use just after a NEXT1 */
                     33: #define PFA1(cfa)      PFA(cfa)
                     34: /* CODE_ADDRESS is the address of the code jumped to through the code field */
1.2     ! pazsan     35: #define CODE_ADDRESS(cfa) \
        !            36:     ({long _cfa = (char *)(cfa); (Label)(_cfa+*((long *)(_cfa+1))+5);})
1.1       anton      37: /* MAKE_CF creates an appropriate code field at the cfa; ca is the code address */
1.2     ! pazsan     38: #define MAKE_CF(cfa,ca)        ({long _cfa = (long)(cfa); \
        !            39:                           long _ca  = (long)(ca); \
1.1       anton      40:                          *(char *)_cfa = 0xe9; /* jmp */ \
1.2     ! pazsan     41:                          *(long *)(_cfa+1) = _ca-(_cfa+5);})
1.1       anton      42: 
                     43: /* this is the point where the does code starts if label points to the
                     44:  * jump dodoes */
1.2     ! pazsan     45: #define DOES_HANDLER_SIZE       8
        !            46: #define DOES_CODE(label)       ((Xt *)(CODE_ADDRESS(label)+DOES_HANDLER_SIZE))
1.1       anton      47: 
                     48: /* this is a special version of DOES_CODE for use in dodoes */
                     49: #define DOES_CODE1(label)      DOES_CODE(label)
                     50: 
                     51: /* this stores a jump dodoes at addr */
1.2     ! pazsan     52: #define MAKE_DOES_HANDLER(addr) MAKE_CF(addr,symbols[DODOES])
        !            53: 
        !            54: #define MAKE_DOES_CF(addr,doesp) MAKE_CF(addr,((int)(doesp)-8))
1.1       anton      55: #endif
                     56: 
1.2     ! pazsan     57: #define rint(x)        floor((x)+0.5)
        !            58: /*
        !            59: #define CISC_NEXT
        !            60: */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>