[comp.lang.pascal] Array sizes in Pascal

amull@Morgan.COM (Andrew P. Mullhaupt) (08/31/89)

I am at heart a Pascal programmer, and I enjoy nothing so much as
my PC environments. But I have one complaint. (Really only one)
about this environment.

Limiting arrays to one segment 64K is tragic. I can't write much
without 'em. Never could stand the old 'fake it by dynamic allocation
gag', either, Pascal is a language which should facilitate full use
of the machine resources without recourse to grotesque "C" style
hocus-pocus. Pascal will never be much use to me until Borland
or Microsoft take off the handcuffs. And no 'huge' keyword, either,
please. Pascal is the language where the compiler knows how big
things are, right?

Is there an implementation without this failure?

Thanks
Andrew Mullhaupt

ts@chyde.uwasa.fi (Timo Salmi LASK) (09/01/89)

In article <359@s5.Morgan.COM> amull@Morgan.COM (Andrew P. Mullhaupt) writes:
>Limiting arrays to one segment 64K is tragic. I can't write much
>without 'em. Never could stand the old 'fake it by dynamic allocation
>gag', either, Pascal is a language which should facilitate full use
>of the machine resources without recourse to grotesque "C" style
>hocus-pocus. Pascal will never be much use to me until Borland
>or Microsoft take off the handcuffs. And no 'huge' keyword, either,
>please. Pascal is the language where the compiler knows how big
>things are, right?
>Is there an implementation without this failure?

There is a neat way around the 64K limitation of (two-dimensional)
arrays published by Kent Porter in Dr.Dobb's Journal, March 1988. 
This resolves much of the problem, unless, of cource, you are more
intent on format than on what can be achieved. 

Incidentally, the problem does not originate from the Pascal
implementations, but the architecture of the Intel 808x processors. 

...................................................................
Prof. Timo Salmi                                (Site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: vakk::salmi Bitnet: salmi@finfun

schwartz@shire.cs.psu.edu (Scott Schwartz) (09/01/89)

In article <731@chyde.uwasa.fi> ts@chyde.uwasa.fi (Timo Salmi LASK) writes:

| There is a neat way around the 64K limitation of (two-dimensional)
| arrays published by Kent Porter in Dr.Dobb's Journal, March 1988. 
| This resolves much of the problem, unless, of cource, you are more
| intent on format than on what can be achieved. 

The point is that deliberately crippling the language in a way that
requires resorting to such tricks is a slap in the face of anyone who
wants to do serious programming.  If you have 640K on the machine, you
ought to be able to say:

	var foo: packed array [0..320000] of char;

and be done with it.

| Incidentally, the problem does not originate from the Pascal
| implementations, but the architecture of the Intel 808x processors. 

So why not store the variable foo in 5 64K segments and generate code
to do the right thing then when the array is accessed?  You may not be
able to allocate foo on the stack (i.e. as a local variable) but that
is wholly different than not being able to allocate it at all (using
standard pascal, naturally).  Note that you'd still be able to access
"foo" through var parameters.
--
Scott Schwartz		<schwartz@shire.cs.psu.edu>
"If it doesn't compile TeX, it isn't Pascal."