Thread View: net.lang.pascal
1 messages
1 total messages
Started by Doug Hall
Sun, 06 Jan 1985 19:09
Packed variables in Turbo Pascal
Author: Doug Hall
Date: Sun, 06 Jan 1985 19:09
Date: Sun, 06 Jan 1985 19:09
33 lines
1646 bytes
1646 bytes
While messing around with Turbo Pascal last night I typed in the following short program: | program testvars; | | var a : packed array [0..15] of boolean; | b : set of 0..15; | | begin | writeln(sizeof(a),' ',sizeof(b)); | end. The result was that variable 'a' took 16 bytes and 'b' took 2 bytes. A quick check of the manual revealed that the word 'packed' is ignored in Turbo; packing occurs automatically whenever possible. It certainly seems possible for packing to occur here. There is a compiler directive (*X- *) which supposedly causes the code size for arrays to be minimized, but the size is unchanged when I use this. It appears that Turbo is tuned for maximum speed, not minimum code size. Sets, however, use one bit per element, just as in UCSD Pascal. Could someone try this on the 8088/8086 version of Turbo? I'm using the CP/M version on an Apple //e with a Z-80 card. While we're on the subject, has anyone received info on new compilers from Borland? I keep hearing rumors of a Modula-2 compiler and an upgraded version of the Pascal compiler. Any news? Douglas Hall ITT Telecom Products Raleigh, NC ittvax!ittral!hall
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads