home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / RiscOS / APP / DEVS / FORTH / BEETLE / BEETLE.ZIP / Beetle / beetle.h < prev    next >
C/C++ Source or Header  |  1997-05-23  |  4KB  |  94 lines

  1. /* BEETLE.H
  2.  
  3.     Vrsn  Date   Comment
  4.     ----|-------|---------------------------------------------------------------
  5.     0.00 07nov94
  6.     0.01 09nov94 Address checking made mandatory; b_mem made an array,
  7.                  rather than a pointer, EP made a pointer.
  8.     0.02 10nov94 single_step's declaration corrected.
  9.     0.03 11nov94 SP and RP made pointers; b_mem made a pointer again; CHECKED
  10.                  temporarily made 0.
  11.     0.04 17nov94 Ensured this file can only be included once.
  12.     0.05 23nov94 Changed THROW to a pointer (it must be phyiscally held in
  13.                  Beetle's address space according to the specification).
  14.     0.06 25nov94 Changed return types of single_step and run to long.
  15.     0.07 28nov94 Removed declaration of b_mem, which is now exactly the same as
  16.                  M0.
  17.     0.08 01dec94 Changed return type of run and single_step to CELL.
  18.     0.09 13jan95 Removed save_standalone, which is not implemented, and the LIST
  19.                  datatype which supports it.
  20.     0.10 24jan95 Changed types of address arguments to load_object and
  21.                  save_object to CELL *.
  22.     0.11 17feb95 Moved much of bintern.h here:
  23.         0.00 09nov94
  24.         0.01 10nov94 NEXT made more efficient.
  25.         0.02 18nov94 Added QCELL_W, a string containing the cell width.
  26.         0.03 22nov94 Added B_TRUE and B_FALSE, Beetle's values for TRUE and
  27.                      FALSE.
  28.         0.04 25nov94 Added lib, the function which provides the standard library
  29.                      calls.
  30.         0.05 17feb95 Changed prototype of init_regs (now init_beetle) to match
  31.                      modified storage.c. Moved most of the header into beetle.h,
  32.                      and QCELL_W into btests.h.
  33.         0.06 25mar95 lib() no longer exists. Header now empty, so not included.
  34.              05jun96 Header removed altogether, and documentation placed here.
  35.     0.12 26feb95 Changed type of length in save_object to UCELL. Typing on
  36.                  CHECKED removed to allow it to be used in #ifs.
  37.     0.13 23mar95 Changed type of e0 in init_beetle to UCELL.
  38.     0.14 24apr95 Removed load_library prototype (not implemented).
  39.  
  40.     Reuben Thomas
  41.  
  42.  
  43.     Header for C Beetle containing all the data structures and interface
  44.     calls specified in the definition of Beetle. This is the header file to
  45.     include in programs using an embedded Beetle.
  46.  
  47.     This header relies on bportab.h for machine dependencies. It is itself
  48.     machine-independent.
  49.  
  50. */
  51.  
  52.  
  53. #ifndef BEETLE_BEETLE
  54. #define BEETLE_BEETLE
  55.  
  56.  
  57. #include "bportab.h"      /* machine-dependent types and definitions */
  58. #include <stdio.h>      /* for the FILE type */
  59.  
  60.  
  61. /* Beetle's registers, except for ENDISM, which is defined in bportab.h */
  62.  
  63. extern CELL *EP;        /* note EP is a pointer, not a Beetle address */
  64. extern BYTE I;
  65. extern CELL A;
  66. extern BYTE *M0;
  67. extern CELL MEMORY;
  68. extern CELL *SP, *RP;    /* note RP and SP are pointers, not Beetle addresses */
  69. extern CELL *THROW;      /* 'THROW is not a valid C identifier */
  70. extern CELL BAD;        /* 'BAD is not a valid C identifier */
  71. extern CELL ADDRESS;    /* -ADDRESS is not a valid C identifier */
  72. #define CHECKED 1
  73.  
  74.  
  75. /* Interface calls */
  76.  
  77. CELL run(void);
  78. CELL single_step(void);
  79. int load_object(FILE *file, CELL *address);
  80. int save_object(FILE *file, CELL *address, UCELL length);
  81.  
  82.  
  83. /* Additional routines, macros and quantities provided by C Beetle */
  84.  
  85. int init_beetle(BYTE *b_array, long size, UCELL e0);
  86.  
  87. #define B_TRUE ((CELL)0xFFFFFFFF)   /* Beetle's TRUE flag */
  88. #define B_FALSE ((CELL)0)           /* Beetle's FALSE flag */
  89. #define CELL_W 4    /* the width of a cell in bytes */
  90.  
  91. #define NEXT A = *EP++
  92.  
  93. #endif
  94.