CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Thread: 16bit compilers

  1. #1
    Join Date
    Nov 2002
    Location
    Sofia, Bulgaria
    Posts
    661

    Question 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

  2. #2
    Join Date
    Apr 1999
    Posts
    27,449
    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

  3. #3
    Join Date
    Nov 2002
    Location
    Sofia, Bulgaria
    Posts
    661
    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

  4. #4
    Join Date
    Apr 1999
    Posts
    27,449
    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

  5. #5
    Join Date
    Jun 2002
    Posts
    1,417
    but you are still limited to 640k for both program and data, unless you want to use special extended-memory functions.

  6. #6
    Join Date
    Nov 2002
    Location
    Sofia, Bulgaria
    Posts
    661

    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

  7. #7
    Join Date
    Jun 2002
    Posts
    1,417
    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.

  8. #8
    Join Date
    Apr 1999
    Posts
    27,449
    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

  9. #9
    Join Date
    Apr 1999
    Posts
    27,449
    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.

  10. #10
    Join Date
    Apr 1999
    Posts
    27,449
    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

  11. #11
    Join Date
    Nov 2002
    Location
    Sofia, Bulgaria
    Posts
    661
    Thank you!
    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

  12. #12
    Join Date
    Apr 1999
    Posts
    27,449
    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

  13. #13
    Join Date
    Dec 2001
    Location
    Ontario, Canada
    Posts
    2,236
    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
  •  





Click Here to Expand Forum to Full Width

Featured