Example #1
0
        void EndRW() /* finish current reading or writing operation */
        {
            if (WriteActive || ReadActive)
            {
                if (Io704.Config.LogIO != null)
                {
                    Io704.LogIO.WriteLine("Printer: record with length {0} written", WRecord.Count);
                }

                while (WRecord.Count < 24)
                {
                    WRecord.Add(0);
                }

                byte[] CBN = CBNConverter.ToCBN(WRecord.ToArray());
                if (HollerithConverter.CBNToBCD(CBN, 0, 72, out byte[] BCD) > 0)
Example #2
0
 void EndRW() /* finish current reading or writing operation */
 {
     if (WriteActive)
     {
         if (Io704.Config.LogIO != null)
         {
             Io704.LogIO.WriteLine("Punch: record with length {0} written", WRecord.Count);
         }
         while (WRecord.Count < 24)
         {
             WRecord.Add(0);
         }
         byte[] CBN = CBNConverter.ToCBN(WRecord.ToArray());
         f.WriteRecord(true, CBN);
         WriteActive = false;
         WRecord.Clear();
     }
 }
Example #3
0
 public void RDS() /* Read Select*/
 {
     if (f == null)
     {
         eof = true;
     }
     else
     {
         int r = f.ReadRecord(out bool binary, out byte[] mrecord);
         if (r < 1)
         {
             eof = true;
             if (cardwasread)
             {
                 if (Io704.Config.LogIO != null)
                 {
                     Io704.LogIO.WriteLine("Card Reader empty");
                 }
                 Io704.Flush();
                 Console.Error.WriteLine("Card Reader empty");
                 CPU704.halt   = true;
                 CPU704.repeat = true;
                 cardwasread   = false;
             }
         }
         else
         {
             if (Io704.Config.LogIO != null)
             {
                 Io704.LogIO.WriteLine("Card {0} read", f.NumOfRecords());
             }
             cardwasread = true;
             if (!binary || mrecord.Length != 160)
             {
                 throw new InvalidDataException("invalid cbn record on Card Reader");
             }
             CBNConverter.FromCBN(mrecord, out RRecord);
             eof = false;
         }
     }
     ReadActive  = true;
     PosInRecord = 0;
 }