How to access more memory - Programmers Heaven

Howdy, Stranger!

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

Categories

How to access more memory

hpmanhpman Posts: 1Member
I want to write a simple PASCAL program but use much memory (10MB).
I know the FreePascal can access large memory.
When I define an array of char, the maximum is around 51200.

Or, I need to use pointer?

Thank you.

Comments

  • AtexAtex Posts: 268Member
    : I want to write a simple PASCAL program but use much memory (10MB).
    : I know the FreePascal can access large memory.
    : When I define an array of char, the maximum is around 51200.
    :
    : Or, I need to use pointer?
    :

    The largest amount of memory you can access without pointers in plain DOS and TP is 64kB ( the size of the data segment ), with pointers usually about 450+kB ( the amount of available free RAM ). By interfacing with extended memory drivers is possible to reserve a 10MB block in the extended memory but it cannot be accessed directly in real mode, only chunks can be copied back and fort, limited to 64 kB maximum. You could try DPMI if you have BP, protected mode programs don't have these limitations, but writing them are a bit more complicated. With Free Pascal you could keep your code simple and avoid all the memory restrictions, eg. [b]var a:array[1..10000000] of char;[/b]
Sign In or Register to comment.