File:  [gforth] / gforth / Attic / m68k.h
Revision 1.3: download - view: text, annotated - select for diffs
Sat Oct 7 17:38:17 1995 UTC (26 years, 2 months ago) by anton
Branches: MAIN
CVS tags: HEAD
added code.fs (code, ;code, end-code, assembler)
renamed dostruc to dofield
made index and doc-entries nicer
Only words containing 'e' or 'E' are converted to FP numbers.
added many wordset comments
added flush-icache primitive and FLUSH_ICACHE macro
added +DO, U+DO, -DO, U-DO and -LOOP
added code address labels (`docol:' etc.)
fixed sparc cache_flush

    1: /*
    2:   $Id: m68k.h,v 1.3 1995/10/07 17:38:17 anton Exp $
    3:   Copyright 1992 by the ANSI figForth Development Group
    4: 
    5:   This is the machine-specific part for the 68000 and family
    6: */
    7: 
    8: #include "32bit.h"
    9: 
   10: #define FLUSH_ICACHE(addr,size)    cache_$clear()
   11: /* Clearing the whole cache is a bit drastic, but this is the only
   12:    cache control available on the apollo.
   13: */
   14: 
   15: #ifdef DIRECT_THREADED
   16: 
   17: /* PFA gives the parameter field address corresponding to a cfa */
   18: #define PFA(cfa)	(((Cell *)cfa)+2)
   19: /* PFA1 is a special version for use just after a NEXT1 */
   20: #define PFA1(cfa)	PFA(cfa)
   21: /* CODE_ADDRESS is the address of the code jumped to through the code field */
   22: #define CODE_ADDRESS(cfa)	(*(Label *)(((char *)(cfa))+2))
   23: /* MAKE_CF creates an appropriate code field at the cfa;
   24:    ca is the code address */
   25: #define MAKE_CF(cfa,ca)		({short * _cfa = (short *)cfa; \
   26: 				  _cfa[0] = 0x4ef9; /* jmp.l */ \
   27: 				  *(long *)(_cfa+1) = (long)(ca);})
   28: 
   29: /* this is the point where the does code starts if label points to the
   30:  * jump dodoes */
   31: #define DOES_CODE(label)	((Xt *)(((char *)CODE_ADDRESS(label))+DOES_HANDLER_SIZE))
   32: 
   33: /* this is a special version of DOES_CODE for use in dodoes */
   34: #define DOES_CODE1(label)	DOES_CODE(label)
   35: 
   36: /* this stores a call dodoes at addr */
   37: #define MAKE_DOES_HANDLER(addr) MAKE_CF(addr,symbols[DODOES])
   38: 
   39: #define DOES_HANDLER_SIZE       8
   40: 
   41: #define MAKE_DOES_CF(addr,doesp)   MAKE_CF(addr,((int)(doesp)-8))
   42: #endif
   43: 

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