none
Output/write SIMH DEC tape file to disk RRS feed

  • Question

  • In VB .Net I was interested in writing a simulated disk file in SIMH file format.  Essentially ASCII records are encapsulated with Tape (FILE) Control characters. I know this is easily handled in C/C++ but I would like to code this in VB.Net

    First, Is there anyone can put an example on in writing table control characters to a data stream for output to a flat file.

    Second, Example of writing to the SIMH format. I have have a PDF describing the the SIMH format so I'm reviewing this specification. Seeing an implementation would be nice.

    SIMH is a derivative DEC tape format.

    Wednesday, March 14, 2018 11:19 AM

Answers

  • You would use Int32 instances to store your values then use BitConverter to get the bytes of those integers for writing to disk with a FileStream object.

    Generating the data file appears to be very straight-forward.  Just follow the convention of writing the record length, the data bytes (inserting an extra zero to make an even number of bytes if necessary), and the record length again. (http://simh.trailing-edge.com/docs/simh_magtape.pdf)

    Writing a simulated tape drive would be the slightly more complex part as you'll need to implement all of the rules in some form of state machine.

    I'm not sure what kind of example(s) to show without doing the work of implementing the protocol.  Is there something specific you need help getting started with beyond the advice given above?


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    • Proposed as answer by Cor Ligthert Wednesday, March 14, 2018 3:10 PM
    • Marked as answer by dmk4170 Friday, March 16, 2018 4:39 PM
    Wednesday, March 14, 2018 12:46 PM
    Moderator

All replies

  • You would use Int32 instances to store your values then use BitConverter to get the bytes of those integers for writing to disk with a FileStream object.

    Generating the data file appears to be very straight-forward.  Just follow the convention of writing the record length, the data bytes (inserting an extra zero to make an even number of bytes if necessary), and the record length again. (http://simh.trailing-edge.com/docs/simh_magtape.pdf)

    Writing a simulated tape drive would be the slightly more complex part as you'll need to implement all of the rules in some form of state machine.

    I'm not sure what kind of example(s) to show without doing the work of implementing the protocol.  Is there something specific you need help getting started with beyond the advice given above?


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    • Proposed as answer by Cor Ligthert Wednesday, March 14, 2018 3:10 PM
    • Marked as answer by dmk4170 Friday, March 16, 2018 4:39 PM
    Wednesday, March 14, 2018 12:46 PM
    Moderator
  • Reed

    Much thanks for your quick reply...wasn't sure I'd get one as this is a bit out of the ordinary.

    Yep, this is the document I have on hand.

    With regard to your reply...

    "You would use Int32 instances to store your values then use BitConverter to get the bytes of those integers for writing to disk with a FileStream object."

    When you refer to the Int32 instance this would specifically apply the binary (TAPE) markers embedded in the ASCII stream.  The ASCII would stand on its own -- no conversion required. I'll look a the usage of the BitConverter. If you have an example this would be great. I'll leave this open a bit longer.  Cheers!

    Wednesday, March 14, 2018 1:11 PM
  • OT: I could not resist to write this. A pitty for you that Renee Culver is not anymore active here. She would have loved it to be involved in this question. 

    (I've no better answer than Reed gave)


    Success
    Cor

    Wednesday, March 14, 2018 2:58 PM
  • OT: I could not resist to write this. A pitty for you that Renee Culver is not anymore active here. She would have loved it to be involved in this question. 

    (I've no better answer than Reed gave)


    Success
    Cor


    I also thought of her immediately when I read the thread title.

    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Wednesday, March 14, 2018 3:58 PM
    Moderator
  • Reed

    Much thanks for your quick reply...wasn't sure I'd get one as this is a bit out of the ordinary.

    Yep, this is the document I have on hand.

    With regard to your reply...

    "You would use Int32 instances to store your values then use BitConverter to get the bytes of those integers for writing to disk with a FileStream object."

    When you refer to the Int32 instance this would specifically apply the binary (TAPE) markers embedded in the ASCII stream.  The ASCII would stand on its own -- no conversion required. I'll look a the usage of the BitConverter. If you have an example this would be great. I'll leave this open a bit longer.  Cheers!

    You're welcome.  And yes (almost), the ASCII data of the actual record itself would stand on its own, written directly as a string-to-ASCII byte conversion - with the caveat that the data must be rounded to an even number of bytes.  So the only adjustment to the record data might be adding an additional zero if the data worked out to an odd number of bytes.

    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Wednesday, March 14, 2018 4:00 PM
    Moderator
  • OT: I could not resist to write this. A pitty for you that Renee Culver is not anymore active here. She would have loved it to be involved in this question. 

    (I've no better answer than Reed gave)


    Success
    Cor


    I also thought of her immediately when I read the thread title.

    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"


    Same here, we corresponded up until a year or so ago and she suddenly just stopped.
    Thursday, March 15, 2018 5:33 AM