home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff274.lzh / HP11 / hp11.h < prev    next >
C/C++ Source or Header  |  1989-11-16  |  2KB  |  51 lines

  1. #define MAXPROG 203 /* Max number of instructions */
  2. #define MAXSTACK 4 /* The stack is 4 levels deep */
  3.  
  4. /* 2 pseudo-keys, which don't exist on the keyboard. They are used to force
  5.   certain actions, and are generated by certain menu functions */
  6. #define BRESET 40 /* Return to main program loop. Generated by New, Quit, Open */
  7. #define BDISPLAY 41 /* Redisplay. Generated by Paste, Radix */
  8.  
  9. #define NUMKEYS 42
  10.  
  11. enum KeyTypes {Action, Instruction, Prefix, Invalid};
  12.    /* Keyboard sequence are of 2 types: Actions & Instructions. The other types
  13.      are for internal use in the keyboard routines. Instructions can  be incorporated
  14.      into programs, while actions are immediately acted upon (eg enter program mode). */
  15.  
  16. struct Regs { /* The status of the HP11. This can be saved */
  17.    double r[20]; /* The 20 storage registers */
  18.    double x,y,z,t,l,i; /* The stack & the indirection register */
  19.    enum {fix, sci, eng} mode; /* display mode */
  20.    double _minfix; /* 10^-Digits in fixed mode to determine smallest displayable value */
  21.    enum {deg, rad, grad} angles; /* Trigonometric mode */
  22.    int digits; /* Number of digits for display mode */
  23.    int user; /* User mode flags */
  24.    WORD prog[MAXPROG + 1]; /* The program */
  25.    int lastins; /* Last instruction used */
  26. };
  27.  
  28. extern struct Regs hp11r; /* the current internal state */
  29. extern int on, quit, running, fast, error, skip; /* various flags indicating the run mode ... */
  30. extern int PC, retStack[MAXSTACK], retCnt; /* PC & return stack (4 levels) */
  31. extern int Flags; /* the current flags */
  32.  
  33. /* Defines to easily access components of internal state */
  34. #define X (hp11r.x)
  35. #define Y (hp11r.y)
  36. #define Z (hp11r.z)
  37. #define T (hp11r.t)
  38. #define L (hp11r.l)
  39. #define I (hp11r.i)
  40. #define R (hp11r.r)
  41. #define Mode (hp11r.mode)
  42. #define Angles (hp11r.angles)
  43. #define Digits (hp11r.digits)
  44. #define User (hp11r.user)
  45. #define Prog (hp11r.prog)
  46. #define lastIns (hp11r.lastins)
  47. #define minfix (hp11r._minfix)
  48.  
  49. extern void ExecIns(int);
  50.  
  51.