Hi everyone!
I'm completely new in assembly, the only thing I've learn are the Iczelion's Tutorials, now I want to make my first program. And there are some thing I don't understand so if you can help me I'll be very thankful. I want to make a program to concatenate and split two or more files, in the tutorial they show two ways to deal with files:
One allocating some memory and the other mapping the file in memory, so I want to know what is the best method to use in my program? and the other thing I would like to know is why there they use a 64k buffer to map the file and they don't talk about 1 Mb or 2 Mb or more if the computers in this days have at least 128 Mb of Ram or more?

Sorry if my questions are silly or stupid... I'm learning.. maybe in the future I can help someone here.

Thanks,
RQ,
Posted on 2002-05-06 01:36:34 by ArgAsm
CreateFile
SetFilePointer
ReadFile
WriteFile
CloseHandle

these are the api calls you need for what you want to do. My advise to you, since it's very simple is to look them up in MSDN and use them in your program (even the above order is how you should use them :grin: ).
Posted on 2002-05-06 05:35:56 by Hiroshimator
thanks Hiroshimator, but I know about the apis I
want to know witch method is the best:

Using This apis: (allocating some memory)
GlobalAlloc
GlobalLock
GlobalUnlock
GlobalFree

Or This apis: (Mapping the file)
CreateFileMapping
MapViewOfFile
UnmapViewOfFile
CloseHandle

both uses the other apis you told me:
CreateFile - SetFilePointer - ReadFile - WriteFile - CloseHandle

Thanks again
Posted on 2002-05-06 15:17:01 by ArgAsm
I think reading in a memory block will be faster then mapping it
Posted on 2002-05-06 15:24:25 by Hiroshimator
Mapping a file is usefull when you have a file who's size won't change much and you want to make changes. For what you want to do I would sugest allocating memory reading it in and then writing to another file.
Posted on 2002-05-06 15:32:34 by Kudos