|
-
January 15th, 2003, 04:37 AM
#1
16bit compilers
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...
It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames
-
January 15th, 2003, 05:21 AM
#2
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
-
January 15th, 2003, 07:40 AM
#3
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...
It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames
-
January 15th, 2003, 09:29 AM
#4
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
-
January 15th, 2003, 03:39 PM
#5
but you are still limited to 640k for both program and data, unless you want to use special extended-memory functions.
-
January 17th, 2003, 02:54 AM
#6
how do I use expanded memory functions?
It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames
-
January 17th, 2003, 07:52 AM
#7
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.
-
January 17th, 2003, 08:44 AM
#8
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
-
January 17th, 2003, 08:52 AM
#9
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
Last edited by Paul McKenzie; January 17th, 2003 at 08:59 AM.
-
January 17th, 2003, 08:55 AM
#10
Originally posted by SeventhStar
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
-
January 17th, 2003, 09:14 AM
#11
It's only when you look at an ant through a magnifying glass on a sunny day that you realise how often they burst into flames
-
January 17th, 2003, 09:28 AM
#12
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
-
January 17th, 2003, 02:24 PM
#13
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|