home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Boot_Images / 2.11_on_rl02 / pdpsim.tz / pdpsim / nova_defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-29  |  3.3 KB  |  123 lines

  1. /* nova_defs.h: NOVA simulator definitions 
  2.  
  3.    Copyright (c) 1993, 1994, 1995,
  4.    Robert M Supnik, Digital Equipment Corporation
  5.    Commercial use prohibited
  6.  
  7.    16-Mar-95    RMS    Added dynamic memory size
  8.    06-Dec-95    RMS    Added magnetic tape
  9.  
  10.    The author gratefully acknowledges the help of Tom West, Diana
  11.    Engelbart, and Carl Friend in resolving questions about the NOVA
  12. */
  13.  
  14. #include "sim_defs.h"                    /* simulator defns */
  15.  
  16. /* Memory */
  17.  
  18. #define MAXMEMSIZE    32768                /* max memory size */
  19. #define MEMSIZE        (cpu_unit.capac)        /* actual memory size */
  20. #define ADDRMASK    (MAXMEMSIZE - 1)        /* address mask */
  21. #define MEM_ADDR_OK(x)    (x < MEMSIZE)
  22.  
  23. /* Simulator stop codes */
  24.  
  25. #define STOP_RSRV    1                /* must be 1 */
  26. #define STOP_HALT    2                /* HALT */
  27. #define STOP_IBKPT    3                /* breakpoint */
  28. #define STOP_IND    4                /* indirect loop */
  29. #define STOP_IND_INT    5                /* ind loop, intr */
  30.  
  31. /* IOT return codes */
  32.  
  33. #define IOT_V_REASON    16                /* set reason */
  34.  
  35. /* IOT fields */
  36.  
  37. #define ioNIO        0                /* opcode field */
  38. #define ioDIA        1
  39. #define ioDOA        2
  40. #define ioDIB        3
  41. #define ioDOB        4
  42. #define ioDIC        5
  43. #define ioDOC        6
  44. #define ioSKP        7
  45.  
  46. #define iopN        0                /* pulse field */
  47. #define iopS        1
  48. #define iopC        2
  49. #define iopP        3
  50.  
  51. /* Range of implemented device numbers */
  52.  
  53. #define DEV_LOW        010                /* lowest intr dev */
  54. #define DEV_HIGH    033                /* highest intr dev */
  55. #define DEV_MDV        001                /* multiply/divide */
  56. #define DEV_CPU        077                /* CPU control */
  57.  
  58. #define IORETURN(f,v)    ((f)? (v): SCPE_OK)        /* stop on error */
  59.  
  60. /* I/O structure
  61.  
  62.    The NOVA I/O structure is tied together by dev_table, indexed by
  63.    the device number.  Each entry in dev_table consists of
  64.  
  65.     mask        device mask for busy, done (simulator representation)
  66.     pi        pi disable bit (hardware representation)
  67.     routine        IOT action routine
  68. */
  69.  
  70. struct ndev {
  71.     int    mask;                    /* done/busy mask */
  72.     int    pi;                    /* assigned pi bit */
  73.     int    (*routine)();                /* dispatch routine */
  74.     };
  75.  
  76. /* Device flags (simulator representation)
  77.  
  78.    Priority (for INTA) runs from low numbers to high
  79. */
  80.  
  81. #define INT_V_DKP    3                /* moving head disk */
  82. #define INT_V_DSK    4                /* fixed head disk */
  83. #define INT_V_MTA    5                /* magnetic tape */
  84. #define INT_V_LPT    6                /* line printer */
  85. #define INT_V_CLK    7                /* clock */
  86. #define INT_V_PTR    8                /* paper tape reader */
  87. #define INT_V_PTP    9                /* paper tape punch */
  88. #define INT_V_TTI    10                /* keyboard */
  89. #define INT_V_TTO    11                /* terminal */
  90. #define INT_V_NO_ION_PENDING 13                /* ion delay */
  91. #define INT_V_ION     14                /* interrupts on */
  92.  
  93. #define INT_DKP        (1 << INT_V_DKP)
  94. #define INT_DSK        (1 << INT_V_DSK)
  95. #define INT_MTA        (1 << INT_V_MTA)
  96. #define INT_LPT        (1 << INT_V_LPT)
  97. #define INT_CLK        (1 << INT_V_CLK)
  98. #define INT_PTR        (1 << INT_V_PTR)
  99. #define INT_PTP        (1 << INT_V_PTP)
  100. #define INT_TTI        (1 << INT_V_TTI)
  101. #define INT_TTO        (1 << INT_V_TTO)
  102. #define INT_NO_ION_PENDING (1 << INT_V_NO_ION_PENDING)
  103. #define INT_ION        (1 << INT_V_ION)
  104. #define INT_DEV        ((1 << INT_V_NO_ION_PENDING) - 1) /* device ints */
  105. #define INT_PENDING    INT_ION+INT_NO_ION_PENDING
  106.  
  107. /* PI disable bits */
  108.  
  109. #define PI_DKP        0000400
  110. #define PI_DSK        0000100
  111. #define PI_MTA        0000040
  112. #define PI_LPT        0000010
  113. #define PI_CLK        0000004
  114. #define PI_PTR        0000020
  115. #define PI_PTP        0000004
  116. #define PI_TTI        0000002
  117. #define PI_TTO        0000001
  118. /* #define PI_CDR    0000040    */
  119. /* #define PI_DCM    0100000    */
  120. /* #define PI_CAS    0000040    */
  121. /* #define PI_PLT    0000010    */
  122. /* #define PI_ADCV    0000002    */
  123.