~ubuntu-branches/ubuntu/raring/simh/raring

« back to all changes in this revision

Viewing changes to PDP11/pdp11_cr.c

  • Committer: Bazaar Package Importer
  • Author(s): Vince Mulhollon
  • Date: 2007-04-13 20:16:15 UTC
  • mfrom: (1.1.7 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20070413201615-jiar46bgkrs0dw2h
Tags: 3.7.0-1
* New upstream released 03-Feb-2007
* i7094 added which emulates the IBM 7090/7094
* Upstream has converted almost entirely to pdf format for docs
* All manpages updated
* All docs are registered with the doc-base system

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* pdp11_cr.c: CR/CM/CD-11 card reader simulator
2
2
 
3
 
   Copyright (c) 2005, John A. Dundas III
 
3
   Copyright (c) 2005-2007, John A. Dundas III
4
4
   Portions derived from work by Douglas W. Jones, jones@cs.uiowa.edu
5
5
   Portions derived from work by Robert M Supnik
6
6
 
51
51
      http://www.cs.uiowa.edu/~jones/cards/
52
52
    Paul Mattes' x026 keypunch simulator
53
53
      http://x3270.bgp.nu/x026.html
54
 
    CDRSER.MAC - TOPS card reader driver source
55
 
      http://pdp-10.trailing-edge.com/custsupcuspmar86_bb-x130b-sb/02/cdrser.mac
 
54
    CD2SER.MAC - TOPS card reader driver source
 
55
      http://pdp-10.trailing-edge.com/custsupcuspmar86_bb-x130b-sb/02/cd2ser.mac
56
56
 
57
57
  The Card Image format code and documentation is adapted from Prof.
58
58
  Jones's site, with his permission.  Please see his site for additional
66
66
    3. No testing under RSX; volunteers needed
67
67
    4. No testing under Ultrix or Unix for PDP-11; volunteers needed
68
68
    5. No testing under Ultrix or Unix for VAX; volunteers needed
69
 
    6. No PDP-10 support; volunteers needed
70
 
    7. The simulator implements a single controller/reader combination
 
69
    6. The simulator implements a single controller/reader combination
71
70
 
72
71
  Operating System Notes
73
72
 
74
73
    RT-11 (and CTS-300) support one CR11 or CM11, but no CD11.
75
74
 
76
 
    VMS supports multiple CR11 controllers.
 
75
    VMS supports multiple CR11 controllers, but no CD11.
77
76
 
78
77
    RSTS/E supports either the CR11/CM11 or CD11 but not both in
79
78
    the same SIL.  It appears to support only one unit.
84
83
    Don't have any information about Unix or Ultrix-11 yet.  Same
85
84
    for VAX Unices.
86
85
 
87
 
    TOPS: it appears that both the CD11 and CR11 were supported.
88
 
    I don't have any knowledge on how to make this work with the
89
 
    PDP-10 simulation, though.
 
86
    TOPS: only the CD11 is supported, under the name CD20.
90
87
 
91
88
  Revision History:
92
89
 
 
90
   01-Feb-07    RMS     Added PDP-10 support
93
91
   12-May-06    JAD     Modify the DEBUG code to use the SIMH DEBUG_x
94
92
                        macros.  Modify the UNIT structure to include
95
93
                        the DEBUG bit.
168
166
#if defined (VM_PDP10)                                  /* PDP10 version */
169
167
#include "pdp10_defs.h"
170
168
extern int32 int_req;
 
169
#define DFLT_DIS        (DEV_DIS)
 
170
#define DFLT_CR11       (0)                             /* CD11 only */
 
171
#define DFLT_CPM        1000
171
172
 
172
173
#elif defined (VM_VAX)                                  /* VAX version */
173
174
#include "vax_defs.h"
174
175
extern int32 int_req[IPL_HLVL];
 
176
#define DFLT_DIS        (0)
 
177
#define DFLT_CR11       (UNIT_CR11)
 
178
#define DFLT_CPM        285
175
179
 
176
180
#else                                                   /* PDP-11 version */
177
181
#include "pdp11_defs.h"
178
182
extern int32 int_req[IPL_HLVL];
 
183
#define DFLT_DIS        (0)
 
184
#define DFLT_CR11       (UNIT_CR11)
 
185
#define DFLT_CPM        285
179
186
#endif
180
187
 
181
188
extern FILE *sim_deb;                                   /* sim_console.c */
294
301
static int32    spinUp = 3000;                          /* blower spin-up time: 3 seconds */
295
302
static int32    spinDown = 2000;                        /* blower spin-down time: 2 seconds */
296
303
static t_bool   EOFcard = FALSE;                        /* played special card yet? */
297
 
static int32    cpm = 285;                              /* reader rate: cards per minute */
 
304
static int32    cpm = DFLT_CPM;                         /* reader rate: cards per minute */
298
305
/* card image in various formats */
299
306
static int16    hcard[82];                              /* Hollerith format */
300
307
static char     ccard[82];                              /* DEC compressed format */
343
350
static UNIT cr_unit = {
344
351
    UDATA (&cr_svc,
345
352
      UNIT_ATTABLE+UNIT_SEQ+UNIT_ROABLE+UNIT_DISABLE+
346
 
      UNIT_CR11+UNIT_AUTOEOF, 0),
347
 
        (60 * 1000) / 285 };
 
353
      DFLT_CR11+UNIT_AUTOEOF, 0),
 
354
        (60 * 1000) / DFLT_CPM };
348
355
 
349
356
static const REG cr_reg[] = {
350
357
    { GRDATA (BUF, cr_unit.buf, DEV_RDX, 8, 0) },
367
374
    { NULL }  };
368
375
 
369
376
static const MTAB cr_mod[] = {
 
377
#if defined (VM_PDP11)
370
378
    { UNIT_CR11, UNIT_CR11, "CR11", "CR11", &cr_set_type },
371
379
    { UNIT_CR11,         0, "CD11", "CD11", &cr_set_type },
 
380
#else
 
381
    { UNIT_CR11, UNIT_CR11, "CR11", NULL },
 
382
    { UNIT_CR11,         0, "CD11", NULL },
 
383
#endif
372
384
    { UNIT_AUTOEOF, UNIT_AUTOEOF, "auto EOF", "AUTOEOF", NULL },
373
385
    { UNIT_AUTOEOF,            0, "no auto EOF", "NOAUTOEOF", NULL },
374
386
    /* card reader RESET switch */
395
407
    1, 10, 31, 1, DEV_RDX, 8,
396
408
    NULL, NULL, &cr_reset,
397
409
    NULL, &cr_attach, &cr_detach,
398
 
    &cr_dib, DEV_DISABLE | DEV_UBUS | DEV_DEBUG };
 
410
    &cr_dib, DEV_DISABLE | DFLT_DIS | DEV_UBUS | DEV_DEBUG };
399
411
 
400
412
/* Utility routines */
401
413