home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / EMULATOR / UNIX / Z80PACK / Z80SIM / SIM-H.FST < prev    next >
Text File  |  2000-06-30  |  3KB  |  106 lines

  1. /*
  2.  * Z80SIM  -  a    Z80-CPU    simulator
  3.  *
  4.  * Copyright (C) 1987-92 by Udo Munk
  5.  *
  6.  * With this configuration the simulated Z80 runs with the
  7.  * highest possible speed
  8.  *
  9.  * History:
  10.  * 28-SEP-87 Development on TARGON/35 with AT&T Unix System V.3
  11.  * 11-JAN-89 Release 1.1
  12.  * 08-FEB-89 Release 1.2
  13.  * 13-MAR-89 Release 1.3
  14.  * 09-FEB-90 Release 1.4 Ported to TARGON/31 M10/30
  15.  * 20-DEC-90 Release 1.5 Ported to COHERENT 3.0
  16.  * 10-JUN-92 Release 1.6 long casting problem solved with COHERENT 3.2
  17.  *             and some optimization
  18.  * 25-JUN-92 Release 1.7 comments in english
  19.  */
  20.  
  21. /*
  22.  *    The following defines may be activated, commented or modified
  23.  *    by user for her/his own purpose.
  24.  */
  25. /*#define WANT_INT*/    /* activate CPU's interrupts */
  26. /*#define WANT_SPC*/    /* activate SP over-/underrun handling 0000<->FFFF */
  27. /*#define WANT_PCC*/    /* activate PC overrun handling FFFF->0000 */
  28. #define    CNTL_C        /* cntl-c will stop running emulation */
  29. #define    CNTL_BS        /* cntl-\ will stop running emulation */
  30. /*#define WANT_TIM*/    /* activate runtime measurement */
  31. /*#define HISIZE 100*/    /* number of entrys in history */
  32. /*#define SBSIZE 4*/    /* number of software breakpoints */
  33.  
  34.  
  35. /*
  36.  *    The following defines may be modified and activated by
  37.  *    user, to print her/his copyright for a developed system,
  38.  *    which contains the Z80-CPU simulation as a part.
  39.  */
  40. /*
  41. #define    USR_COM    "XYZ-System Simulation"
  42. #define    USR_REL    "x.y"
  43. #define    USR_CPR    "Copyright (C) 19xx by XYZ"
  44. */
  45.  
  46. /*
  47.  *    The following lines of this file must not be modified by user,
  48.  *    see license agreement!
  49.  */
  50. #define    COPYR    "Copyright (C) 1987-92 by Udo Munk"
  51. #define    RELEASE    "1.7"
  52.  
  53. #define    LENCMD        80        /* length of command buffers etc */
  54.  
  55. #define    S_FLAG        128        /* bit definitions of CPU flags */
  56. #define    Z_FLAG        64
  57. #define    N2_FLAG        32
  58. #define    H_FLAG        16
  59. #define    N1_FLAG        8
  60. #define    P_FLAG        4
  61. #define    N_FLAG        2
  62. #define    C_FLAG        1
  63.  
  64.                     /* operation of simulated CPU */
  65. #define    SINGLE_STEP    0        /* single step */
  66. #define    CONTIN_RUN    1        /* continual run */
  67. #define    STOPPED        0        /* stop CPU because of error */
  68.  
  69.                     /* causes of error */
  70. #define    NONE        0        /* no error */
  71. #define    OPHALT        1        /* HALT    op-code    trap */
  72. #define    IOTRAP        2        /* IN/OUT trap */
  73. #define    OPTRAP1        3        /* illegal 1 byte op-code trap */
  74. #define    OPTRAP2        4        /* illegal 2 byte op-code trap */
  75. #define    OPTRAP4        5        /* illegal 4 byte op-code trap */
  76. #define    USERINT        6        /* user    interrupt */
  77.  
  78.                     /* type of CPU interrupt */
  79. #define    INT_NMI        1        /* non maskable interrupt */
  80. #define    INT_INT        2        /* maskable interrupt */
  81.  
  82. typedef    unsigned short WORD;        /* 16 bit unsigned */
  83. typedef    unsigned char  BYTE;        /* 8 bit unsigned */
  84.  
  85. #ifdef HISIZE
  86. struct history {            /* structure of a history entry */
  87.     WORD    h_adr;            /* address of execution */
  88.     WORD    h_af;            /* register AF */
  89.     WORD    h_bc;            /* register BC */
  90.     WORD    h_de;            /* register DE */
  91.     WORD    h_hl;            /* register HL */
  92.     WORD    h_ix;            /* register IX */
  93.     WORD    h_iy;            /* register IY */
  94.     WORD    h_sp;            /* register SP */
  95. };
  96. #endif
  97.  
  98. #ifdef SBSIZE
  99. struct softbreak {            /* structure of a breakpoint */
  100.     WORD    sb_adr;            /* address of breakpoint */
  101.     BYTE    sb_oldopc;        /* op-code at address of breakpoint */
  102.     int    sb_passcount;        /* pass counter of breakpoint */
  103.     int    sb_pass;        /* no. of pass to break */
  104. };
  105. #endif
  106.