restricted compiler memory

im using turboC to compile my code but the memory is restricted to about 1MB only, but i need more to run my code.i understand that we can use memory extender to solve it but i dunno how...can anyone tell me?

Comments

  • : im using turboC to compile my code but the memory is restricted to
    : about 1MB only, but i need more to run my code.i understand that we
    : can use memory extender to solve it but i dunno how...can anyone
    : tell me?
    :

    Have you tried using the HUGE memory model? I suspect his is what you
    are referring to.

  • : : im using turboC to compile my code but the memory is restricted to
    : : about 1MB only, but i need more to run my code.i understand that we
    : : can use memory extender to solve it but i dunno how...can anyone
    : : tell me?
    : :
    :
    : Have you tried using the HUGE memory model? I suspect his is what you
    : are referring to.
    :
    :
    did u mean .model huge ? isnt that it is a assembly command...or there is a way to use HUGE model in C.
  • : im using turboC to compile my code but the memory is restricted to
    : about 1MB only, but i need more to run my code.i understand that we
    : can use memory extender to solve it but i dunno how...can anyone
    : tell me?
    :
    There are more types of memory: the stack is restricted to the size you indicate, but the free space is not. You can access the memory in the free space by dynamically allocating memory (using new or std::malloc) or using classes that do this for you (e.g. std::vector).

    See ya,
    bilderbikkel
  • : : im using turboC to compile my code but the memory is restricted to
    : : about 1MB only, but i need more to run my code.i understand that we
    : : can use memory extender to solve it but i dunno how...can anyone
    : : tell me?
    : :
    : There are more types of memory: the stack is restricted to the size
    : you indicate, but the free space is not. You can access the memory
    : in the free space by dynamically allocating memory (using new or
    : std::malloc) or using classes that do this for you (e.g.
    : std::vector).
    :
    : See ya,
    : bilderbikkel


    All MS-DOS 16-bit programs have an upper limit of 1 meg memory, which includes the stack as well as executable code. If you want to use all the computer's memory then you will need to port the program to a 32-bit compiler, and that may be a major undertaking if you use the graphics functions in Turbo C.

    You might also investigate using a DOS extender (see google links). But many are not free.
    =============================================
    never lie -- the government doesn't like the competition. (Author unknown)
  • [blue]HUGE model will slow down the code. Use LARGE model to cover about 1Mb of memory. If you need memory - think of binary file a few megabytes in size. Use it as memory - slow memory...

    HUGE memory is used only if you have an array of more than 64Kb and you need to scan it with a pointer. This pointer should be declared as [b]huge[/b].[/blue]
  • : All MS-DOS 16-bit programs have an upper limit of 1 meg memory,
    : which includes the stack as well as executable code.
    Sure, you can only have 1 MB of memory on the stack. But sure you can allocate more then 1 MB of memory by using dynamic memory? A pointer only occupies 2-4 bytes on the stack, but can point to much more on the free space (or heap in case of std::malloc)? Or am I wrong?

    I look forward to your answer,
    bilderbikkel
  • : : All MS-DOS 16-bit programs have an upper limit of 1 meg memory,
    : : which includes the stack as well as executable code.
    : Sure, you can only have 1 MB of memory on the stack. But sure you
    : can allocate more then 1 MB of memory by using dynamic memory? A
    : pointer only occupies 2-4 bytes on the stack, but can point to much
    : more on the free space (or heap in case of std::malloc)? Or am I
    : wrong?
    :
    : I look forward to your answer,
    : bilderbikkel

    No. Stack is about 1K (1024 bytes) not 1 meg. Its impossible to get a 1 meg stack out of 640K maximum program space. And a 16-bit program can not even use all 640K because TSRs and the OS are also in that space. 15 or so years ago I used to get a DOS memory manager that could move some TSRs into the memory space above 640K but below 1 Meg, but no 16-bit program can access memory above 1 Meg without running in protected mode with a DOS extender.

    The actual amount of memory programs can use is somewhere around 460-600K, depending on what TSRs are in memory.

    As for dynamic allocations (memory allocated by malloc or c++ new operator) -- the memory for them also come out of that 640K.


    =============================================
    never lie -- the government doesn't like the competition. (Author unknown)
  • : : : All MS-DOS 16-bit programs have an upper limit of 1 meg memory,
    : : : which includes the stack as well as executable code.
    : : Sure, you can only have 1 MB of memory on the stack. But sure you
    : : can allocate more then 1 MB of memory by using dynamic memory? A
    : : pointer only occupies 2-4 bytes on the stack, but can point to much
    : : more on the free space (or heap in case of std::malloc)? Or am I
    : : wrong?
    : :
    : : I look forward to your answer,
    : : bilderbikkel
    :
    : No. Stack is about 1K (1024 bytes) not 1 meg. Its impossible to
    : get a 1 meg stack out of 640K maximum program space. And a 16-bit
    : program can not even use all 640K because TSRs and the OS are also
    : in that space. 15 or so years ago I used to get a DOS memory manager
    : that could move some TSRs into the memory space above 640K but below
    : 1 Meg, but no 16-bit program can access memory above 1 Meg without
    : running in protected mode with a DOS extender.
    :
    : The actual amount of memory programs can use is somewhere around
    : 460-600K, depending on what TSRs are in memory.
    :
    : As for dynamic allocations (memory allocated by malloc or c++ new
    : operator) -- the memory for them also come out of that 640K.
    :
    :
    : =============================================
    : never lie -- the government doesn't like the competition. (Author
    : unknown)


    thanks all for being so responsive!!
    i really appreciate that...
    i tried with different MODEL but still getting some errors
    so i change to WATCOM compiler which provide me almost 8M or 10M more..
    and now it works!!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories