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

« back to all changes in this revision

Viewing changes to PDP10/pdp10_fe.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
/* pdp10_fe.c: PDP-10 front end (console terminal) simulator
2
2
 
3
 
   Copyright (c) 1993-2004, Robert M Supnik
 
3
   Copyright (c) 1993-2006, Robert M Supnik
4
4
 
5
5
   Permission is hereby granted, free of charge, to any person obtaining a
6
6
   copy of this software and associated documentation files (the "Software"),
25
25
 
26
26
   fe           KS10 console front end
27
27
 
 
28
   17-Oct-06    RMS     Synced keyboard to clock for idling
28
29
   28-May-04    RMS     Removed SET FE CTRL-C
29
30
   29-Dec-03    RMS     Added console backpressure support
30
31
   25-Apr-03    RMS     Revised for extended file support
40
41
 
41
42
extern d10 *M;
42
43
extern int32 apr_flg;
 
44
extern int32 tmxr_poll;
43
45
t_stat fei_svc (UNIT *uptr);
44
46
t_stat feo_svc (UNIT *uptr);
45
47
t_stat fe_reset (DEVICE *dptr);
56
58
#define feo_unit        fe_unit[1]
57
59
 
58
60
UNIT fe_unit[] = {
59
 
    { UDATA (&fei_svc, 0, 0), KBD_POLL_WAIT },
 
61
    { UDATA (&fei_svc, 0, 0), 0 },
60
62
    { UDATA (&feo_svc, 0, 0), SERIAL_OUT_WAIT }
61
63
    };
62
64
 
63
65
REG fe_reg[] = {
64
66
    { ORDATA (IBUF, fei_unit.buf, 8) },
65
67
    { DRDATA (ICOUNT, fei_unit.pos, T_ADDR_W), REG_RO + PV_LEFT },
66
 
    { DRDATA (ITIME, fei_unit.wait, 24), REG_NZ + PV_LEFT },
 
68
    { DRDATA (ITIME, fei_unit.wait, 24), PV_LEFT },
67
69
    { ORDATA (OBUF, feo_unit.buf, 8) },
68
70
    { DRDATA (OCOUNT, feo_unit.pos, T_ADDR_W), REG_RO + PV_LEFT },
69
71
    { DRDATA (OTIME, feo_unit.wait, 24), REG_NZ + PV_LEFT },
139
141
{
140
142
int32 temp;
141
143
 
142
 
sim_activate (&fei_unit, fei_unit.wait);                /* continue poll */
 
144
sim_activate (uptr, KBD_WAIT (uptr->wait, tmxr_poll));  /* continue poll */
143
145
if ((temp = sim_poll_kbd ()) < SCPE_KFLAG) return temp; /* no char or error? */
144
146
if (temp & SCPE_BREAK) return SCPE_OK;                  /* ignore break */
145
 
fei_unit.buf = temp & 0177;
146
 
fei_unit.pos = fei_unit.pos + 1;
147
 
M[FE_CTYIN] = fei_unit.buf | FE_CVALID;                 /* put char in mem */
 
147
uptr->buf = temp & 0177;
 
148
uptr->pos = uptr->pos + 1;
 
149
M[FE_CTYIN] = uptr->buf | FE_CVALID;                    /* put char in mem */
148
150
apr_flg = apr_flg | APRF_CON;                           /* interrupt KS10 */
149
151
return SCPE_OK;
150
152
}
156
158
fei_unit.buf = feo_unit.buf = 0;
157
159
M[FE_CTYIN] = M[FE_CTYOUT] = 0;
158
160
apr_flg = apr_flg & ~(APRF_ITC | APRF_CON);
159
 
sim_activate (&fei_unit, fei_unit.wait);                /* start input poll */
 
161
sim_activate_abs (&fei_unit, KBD_WAIT (fei_unit.wait, tmxr_poll));
160
162
return SCPE_OK;
161
163
}
162
164