home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Boot_Images / 2.11_on_rl02 / pdpsim.tz / pdpsim / pdp9_defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-13  |  3.3 KB  |  95 lines

  1. /*
  2.  * pdp9_defs.h: pdp-9 simulator definitions
  3.  *                          Copyright 1995 by
  4.  *              Megan Gentry, Digital Equipment Corporation
  5.  *                         All rights reserved
  6.  *                      Commercial use prohibited
  7.  *
  8.  * The following code is based liberally upon pdp-8 emulator code
  9.  * developed by Robert Supnik of Digital Equipment Corporation.
  10.  */
  11.  
  12. #include "sim_defs.h"                    /* simulator defns */
  13.  
  14. /* Constants */
  15.  
  16. #define MEMSIZE        32768                /* 1-8 * 4096 */
  17. #define MAXMEMSIZE    32768
  18.  
  19. #if MEMSIZE < MAXMEMSIZE                /* need mem check? */
  20. #define MEM_ADDR_OK(x) (x < MEMSIZE)
  21. #else                            /* no... */
  22. #define MEM_ADDR_OK(x) TRUE
  23. #endif
  24.  
  25. /* Simulator stop codes */
  26.  
  27. #define STOP_RSRV    1                /* must be 1 */
  28. #define STOP_HALT    2                /* HALT */
  29. #define STOP_IBKPT    3                /* breakpoint */
  30.  
  31. /* IOT subroutine return codes */
  32.  
  33. #define IOT_V_SKP    12                /* skip */
  34. #define IOT_V_REASON    13                /* reason */
  35. #define IOT_SKP        (1 << IOT_V_SKP)
  36. #define IOT_REASON    (1 << IOT_V_REASON)
  37. #define IORETURN(f,v)    ((f)? (v): SCPE_OK)        /* stop on error */
  38.  
  39. /* Interrupt flags
  40.  
  41.    The interrupt flags consist of three groups:
  42.  
  43.    1.    Devices with individual interrupt enables.  These record
  44.     their interrupt requests in device_done and their enables
  45.     in device_enable, and must occupy the low bit positions.
  46.  
  47.    2.    Devices without interrupt enables.  These record their
  48.     interrupt requests directly in int_req, and must occupy
  49.     the middle bit positions.
  50.  
  51.    3.    Overhead.  These exist only in int_req and must occupy the
  52.     high bit positions.
  53.  
  54.    Because the PDP-8 does not have priority interrupts, the order
  55.    of devices within groups does not matter.
  56. */
  57.  
  58. #define INT_V_START    0                /* enable start */
  59. #define INT_V_LPT    (INT_V_START+0)            /* line printer */
  60. #define INT_V_PTP    (INT_V_START+1)            /* tape punch */
  61. #define INT_V_PTR    (INT_V_START+2)            /* tape reader */
  62. #define INT_V_TTO    (INT_V_START+3)            /* terminal */
  63. #define INT_V_TTI    (INT_V_START+4)            /* keyboard */
  64. #define INT_V_CLK    (INT_V_START+5)            /* clock */
  65. #define INT_V_DIRECT    (INT_V_START+6)            /* direct start */
  66. #define INT_V_RX    (INT_V_DIRECT+0)        /* RX8E */
  67. #define INT_V_RK    (INT_V_DIRECT+1)        /* RK8E */
  68. #define INT_V_RF    (INT_V_DIRECT+2)        /* RF08 */
  69. #define INT_V_PWR    (INT_V_DIRECT+3)        /* power int */
  70. #define INT_V_UF    (INT_V_DIRECT+4)        /* user int */
  71. #define INT_V_OVHD    (INT_V_DIRECT+5)        /* overhead start */
  72. #define INT_V_NO_ION_PENDING (INT_V_OVHD+0)        /* ion pending */
  73. #define INT_V_NO_CIF_PENDING (INT_V_OVHD+1)        /* cif pending */
  74. #define INT_V_ION    (INT_V_OVHD+2)            /* interrupts on */
  75.  
  76. #define INT_LPT        (1 << INT_V_LPT)
  77. #define INT_PTP        (1 << INT_V_PTP)
  78. #define INT_PTR        (1 << INT_V_PTR)
  79. #define INT_TTO        (1 << INT_V_TTO)
  80. #define INT_TTI        (1 << INT_V_TTI)
  81. #define INT_CLK        (1 << INT_V_CLK)
  82. #define INT_RX        (1 << INT_V_RX)
  83. #define INT_RK        (1 << INT_V_RK)
  84. #define INT_RF        (1 << INT_V_RF)
  85. #define INT_PWR        (1 << INT_V_PWR)
  86. #define INT_UF        (1 << INT_V_UF)
  87. #define INT_NO_ION_PENDING (1 << INT_V_NO_ION_PENDING)
  88. #define INT_NO_CIF_PENDING (1 << INT_V_NO_CIF_PENDING)
  89. #define INT_ION        (1 << INT_V_ION)
  90. #define INT_DEV_ENABLE    ((1 << INT_V_DIRECT) - 1)    /* devices w/enables */
  91. #define INT_ALL        ((1 << INT_V_OVHD) - 1)        /* all interrupts */
  92. #define INT_INIT_ENABLE    (INT_TTI+INT_TTO+INT_PTR+INT_PTP+INT_LPT)
  93. #define INT_PENDING    (INT_ION+INT_NO_CIF_PENDING+INT_NO_ION_PENDING)
  94. #define INT_UPDATE    ((int_req & ~INT_DEV_ENABLE) | (dev_done & dev_enable))
  95.