Reasons for a buffer or RAM
- From: pensul <royspensul@xxxxxxxxx>
- Date: 30 May 2005 12:20:52 -0500
**** Post for FREE via your newsreader at post.usenet.com ****
On page 82 of "Programming from the Ground Up" we're in the midst of a program
that will convert all the lowercase letters from a file into uppercase letters.
Specifically the buffer section that assignes memory for the buffer looks like
this:
..section .bss
#Buffer - this is where the data is loaded into
# from the data file and written from
# into the output file. This should
# never exceed 16,000 for various
# reasons.
.equ BUFFER_SIZE, 500
.lcomm BUFFER_DATA, BUFFER_SIZE
Previously it was explained that we didn't know how big the first line would
be, and that we needed to put it into a buffer. Consequently, we might
unexpectedly run out of space. However, doesn't the file itself already exist
somewhere in memory or disk space? It must needs be so, because if our programs
cannot access memory directy, but only thru the kernel, how much more will a
random input from a user be incapable of using up all the memory without the
kernel knowing about it? So my question is: if the kernel already knows the
size of the file, why can't it pass this information on to the program, so
that it can set its memory requirements?
--
"The world of existence is an emanation of the merciful attribute of God."
Abdul-Baha
http://www.costarricense.cr/pagina/ernobe
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
.
- Follow-Ups:
- Re: Reasons for a buffer or RAM
- From: Frank Kotler
- Re: Reasons for a buffer or RAM
- From: randyhyde
- Re: Reasons for a buffer or RAM
- Prev by Date: Re: Longhorn is rapidly becoming MS' "Copland"
- Next by Date: Re: High Level Assembly (HLA)
- Previous by thread: High Level Assembly (HLA)
- Next by thread: Re: Reasons for a buffer or RAM
- Index(es):
Relevant Pages
|