Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-16-2011, 05:44 PM   PM User | #1
guyfromnola
New to the CF scene

 
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
guyfromnola is an unknown quantity at this point
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
guyfromnola is offline   Reply With Quote
Old 05-16-2011, 07:33 PM   PM User | #2
ShaneC
Codeasaurus Rex


 
Join Date: Jun 2008
Location: Redmond, WA
Posts: 659
Thanks: 31
Thanked 100 Times in 94 Posts
ShaneC is on a distinguished road
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
ShaneC is offline   Reply With Quote
Old 05-16-2011, 08:16 PM   PM User | #3
guyfromnola
New to the CF scene

 
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
guyfromnola is an unknown quantity at this point
Thanks for the reply.

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

Thanks
guyfromnola is offline   Reply With Quote
Reply

Bookmarks

Tags
.386, 8086, assembly, input, length

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:41 AM.


Advertisement
Log in to turn off these ads.