int32 rxdb_rd (void) { int32 t = tti_unit.buf; /* char + error */ if (tti_csr & CSR_DONE) { /* Input pending ? */ tti_csr = tti_csr & ~CSR_DONE; /* clr done */ tti_unit.buf = tti_unit.buf & 0377; /* clr errors */ CLR_INT (TTI); sim_activate_after_abs (&tti_unit, tti_unit.wait); /* check soon for more input */ } return t; }
t_stat tti_rd (int32 *data, int32 PA, int32 access) { switch ((PA >> 1) & 01) { /* decode PA<1> */ case 00: /* tti csr */ *data = tti_csr & TTICSR_IMP; return SCPE_OK; case 01: /* tti buf */ tti_csr = tti_csr & ~CSR_DONE; CLR_INT (TTI); *data = tti_unit.buf & 0377; sim_activate_after_abs (&tti_unit, tti_unit.wait); /* check soon for more input */ return SCPE_OK; } /* end switch PA */ return SCPE_NXM; }