Click to See Complete Forum and Search --> : 16bit compilers
SeventhStar
January 15th, 2003, 03:37 AM
is there any way to use a database of more than 65000 elements with size of 2-3MB in a 16 bit compiler...
I know there is I've seen such programs but is it... hm.. user-friendly or user-hostile ;)
I remember that I had such problems before moving to windows programing... Could they be solved...
Paul McKenzie
January 15th, 2003, 04:21 AM
Your question is difficult to understand. What does a database have to do with a compiler and vice-versa? They are two separate applications -- one has nothing to do with the other.
Maybe you need to rephrase your question with a concrete example. Is it that the functional interface to manipulate the database uses "int" and an int in a 16-bit compiler is (usually) 16-bits? Then the problem is the functional interface to the database, not the compiler. Most (if not all) 16-bit compilers have 32-bit longs. Change the interface to use long's instead of int.
Regards,
Paul McKenzie
SeventhStar
January 15th, 2003, 06:40 AM
16 bit compilers can't make arrays bigger 64KB so the maximum for a 16bit compiler is an array of char with 65535 items.
How can i operate with larger arrays?
that's the question synthesized...
Paul McKenzie
January 15th, 2003, 08:29 AM
Most 16-bit compilers support huge pointers, along with allocation functions such as faralloc or something similar that break the 64K barrier. Then you just create your array dynamically.
You need to look into your compiler's documentation for what is supported, since huge and special allocation functions may be named differently.
You could also have two or more 64K arrays. The first represents the first 64K set of items, the second array the second set of 64K items.
Regards,
Paul McKenzie
stober
January 15th, 2003, 02:39 PM
but you are still limited to 640k for both program and data, unless you want to use special extended-memory functions.
SeventhStar
January 17th, 2003, 01:54 AM
:confused: :eek:
how do I use expanded memory functions?
stober
January 17th, 2003, 06:52 AM
depends on your compiler. I know Microsoft VC 1.52C has functions to do that -- you'll have to read about them in their documentation because I don't remember what they are anymore. Borland C++ 4.5 (I think that is the version) comes with a dos extender, but programming with that is different yet.
Paul McKenzie
January 17th, 2003, 07:44 AM
Originally posted by stober
but you are still limited to 640k for both program and data, unless you want to use special extended-memory functions. Note that this has nothing to do with the compiler, but with the operating system.
Also, if you are willing to sacrifice some speed, you don't need expanded memory functions if you are willing to use the disk as memory in the form of an array. There are C++ classes that overload operator[] to simulate a disk-based array.
Regards,
Paul McKenzie
Paul McKenzie
January 17th, 2003, 07:52 AM
Originally posted by stober
depends on your compiler. I know Microsoft VC 1.52C has functions to do that -- you'll have to read about them in their documentation because I don't remember what they are anymore. Borland C++ 4.5 (I think that is the version) comes with a dos extender, but programming with that is different yet. From what I remember, Expanded memory and dos extended memory are two different things. To access the expanded memory, you had to call certain interrupts to access the extra memory, however the processor remained in "real" mode (i.e. still using 16-bit DOS -- the 640K limit still exists). I remember when the spreadsheet program, Lotus 1-2-3, gave an option to use "expanded memory", and you could buy EMM boards with the extra memory. You also don't need any special compiler. Any 16-bit compiler that can call DOS interrupts can use expanded memory.
Extended memory required you to switch the processor into "protected" mode, and the interface is entirely different (DPMI). In this case, you need a dos extender, and you are basically running 32-bit DOS. Windows 3.x by default goes into protected mode (I forgot what the command line switch is to set it into "real" mode). There is no 640K limit in this case, since you are running in a "true" 32-bit system.
Regards,
Paul McKenzie
Paul McKenzie
January 17th, 2003, 07:55 AM
Originally posted by SeventhStar
:confused: :eek:
how do I use expanded memory functions? It is way too much to describe here. Do a google search for "EMM", which is the acronym that was used for Expanded Memory Manager. The specs should be all over the internet.
Regards,
Paul McKenzie
SeventhStar
January 17th, 2003, 08:14 AM
Thank you!
Paul McKenzie
January 17th, 2003, 08:28 AM
Here is one link with files. Check EMS4SPEC.ZIP which is the full specification for expanded memory.
http://www.filelibrary.com:8080/Contents/DOS/54/36.html
Regards,
Paul McKenzie
mwilliamson
January 17th, 2003, 01:24 PM
Not relating to extended memory or anything, but if you were stuck with out a long why not just use a two dimensional array. That would give you 65353 ^ 2 elements.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.