Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Input file length

    I'm trying to understand a concept in the .386 architecture, also using the .387.

    I have a program that is written currently with space for two input file names to be supplied through a command tail, but with a pre-defined length. Because I know the length of these two specific files, it is easy to supply the program with it. However, how would I go about reading the file size more dynamically, meaning I would not know the length of the two files (lets say .txt files or .bin files) and have the program determine the length for knowing how many times it has to loop to write an output file. One of the input files will be doing operations on the data of the other input file and therefore need to know how many times I will have to loop to write output.

    BTW, I'm reading in quad words from these input files into 2 separate arrays/memory.

    Thanks

  • #2
    Codeasaurus Rex
    Join Date
    Jun 2008
    Location
    Redmond, WA
    Posts
    659
    Thanks
    31
    Thanked 100 Times in 94 Posts
    Are you talking about creating this method in a higher programming language? Or in x86 compatible ASM?

    In a higher level language, such as C++, you can simply iterate through the file until eof (see: http://www.cplusplus.com/reference/iostream/ios/eof/).

    In ASM that's a different, and more difficult, story. I'll try and generate some code if you post back saying you're not looking for a method in a higher programming language.
    Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
    My posts, comments, code, and suggestions reflect only my personal views.
    Web Portfolio and Code Snippets: http://shanechism.com

  • #3
    New to the CF scene
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the reply.

    It is strictly ASM, nothing in a higher level. Anything is appreciated.

    Thanks


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •