Exemplo n.º 1
0
int32 lpt (int32 pulse, int32 code, int32 AC)
{
if (code == ioDOA)
    lpt_unit.buf = AC & 0177 ;

switch (pulse)
    {                                                   /* decode IR<8:9> */
  case iopS:                                            /* start */
    DEV_SET_BUSY( INT_LPT ) ;
    DEV_CLR_DONE( INT_LPT ) ;
    DEV_UPDATE_INTR ;
    if ( lpt_unit.wait )
       if (  (lpt_unit.buf == 015)
          || (lpt_unit.buf == 014)
          || (lpt_unit.buf == 012)
          )
        {
        sim_activate (&lpt_unit, lpt_unit.wait);
        break ;
        }
    return (lpt_svc (&lpt_unit) << IOT_V_REASON);
    break;

  case iopC:                                            /* clear */
    DEV_CLR_BUSY( INT_LPT ) ;
    DEV_CLR_DONE( INT_LPT ) ;
    DEV_UPDATE_INTR ;
    sim_cancel (&lpt_unit);                             /* deactivate unit */
    break;
    }                                                   /* end switch */

return 0;
}
Exemplo n.º 2
0
int32 lpt (int32 IR, int32 AC)
{
switch (IR & 07) {                                      /* decode IR<9:11> */

    case 1:                                             /* PSKF */
        return (dev_done & INT_LPT)? IOT_SKP + AC: AC;

    case 2:                                             /* PCLF */
        dev_done = dev_done & ~INT_LPT;                 /* clear flag */
        int_req = int_req & ~INT_LPT;                   /* clear int req */
        return AC;

    case 3:                                             /* PSKE */
        return (lpt_err)? IOT_SKP + AC: AC;

    case 6:                                             /* PCLF!PSTB */
        dev_done = dev_done & ~INT_LPT;                 /* clear flag */
        int_req = int_req & ~INT_LPT;                   /* clear int req */

    case 4:                                             /* PSTB */
        lpt_unit.buf = AC & 0177;                       /* load buffer */
        if ((lpt_unit.buf == 015) || (lpt_unit.buf == 014) ||
            (lpt_unit.buf == 012)) {
            sim_activate (&lpt_unit, lpt_unit.wait);
            return AC;
            }
        return (lpt_svc (&lpt_unit) << IOT_V_REASON) + AC;

    case 5:                                             /* PSIE */
        int_enable = int_enable | INT_LPT;              /* set enable */
        int_req = INT_UPDATE;                           /* update interrupts */
        return AC;

    case 7:                                             /* PCIE */
        int_enable = int_enable & ~INT_LPT;             /* clear enable */
        int_req = int_req & ~INT_LPT;                   /* clear int req */
        return AC;

    default:
        return (stop_inst << IOT_V_REASON) + AC;
        }                                               /* end switch */
}