Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
PAGE 40<br />
-123456 will take 3 words: one for<br />
the sign, and two for the digits,<br />
since they are stored in multiples of<br />
4. The format will look like this:<br />
< _ _each digit is one nybble -------><br />
/VISB 6 5 4 3 2 1 0 0 0 0 F F LSB<br />
< -word> sign word<br />
FIGUIU 8<br />
Long integers must always be<br />
passed by address because they<br />
have a length which depends on<br />
their definition.<br />
BOOLEANS<br />
The Boolean, or binary, variable<br />
can have two values: TRUE and<br />
- FALSE. This is most commonly used<br />
in determining yes/no conditions<br />
such as equality or set inclusion.<br />
This variable is stored in one word,<br />
although only the LSB (least<br />
significant bit) is used. TRUE is<br />
indicated by a 1, and FALSE shows<br />
as a 0.<br />
/VISB 15 ...... 8 7 ...... 0 LSB<br />
boolean<br />
Booleans are most efficient in<br />
packed arrays, where each bit of<br />
the word is utilized. DRAWBLOCK<br />
is probably the best-known<br />
example of this use. For an excellent<br />
example of the use of boolean<br />
THE APPLE ORCHARD<br />
packed arrays, look at the program<br />
GRAFDEMO on the <strong>Apple</strong> Pascal<br />
diskette APPLE3.<br />
Boolean variables may be passed<br />
by value or by address.<br />
OTHER TYPES<br />
In addition to the previously<br />
mentioned standard types, Pascal<br />
allows the programmer to define a<br />
wide variety of non-standard<br />
variable types. Probably the most<br />
popular example of this is the set.<br />
A set is an arbitrary collection of<br />
elements, where each element is<br />
assigned an ordinal position (that is,<br />
represented by a number). Each<br />
element of the set is represented by<br />
a name which can be any word of<br />
your own choosing (except for<br />
Pascal reserved words or other<br />
variable definitions already in use).<br />
Each name is then associated with<br />
one bit in the data definition<br />
beginning with bit 0. The set is<br />
stored in memory as a series of bits<br />
which are identified by the ordinal<br />
position of the element in the type<br />
definition. A set must end on a<br />
word boundary, so, for example, 17<br />
elements would take up 2 words,<br />
even though only one bit of the<br />
second word is actually used.<br />
FALL <strong>1980</strong><br />
EXAMPLE:<br />
TYPE COLOR=RED, GREEN, BLUE,<br />
YELLOW, BLACK, WHITE<br />
is a set of colors. Red occupies<br />
position 0, and white is position 5.<br />
<br />
MSBOOOOOOOOOO 1 1 1 1 1 1 LSB<br />
WBYBGR<br />
h I e I r e<br />
i a I u e d<br />
t c I e e<br />
e k o n<br />
FIGUIU'J<br />
w<br />
Sets may be passed either by<br />
name or by value, with certain restrictions.<br />
See page 203 of the Pascal<br />
reference manual for details.<br />
In general, complex record types<br />
consist of one or more standard<br />
types which are stored as<br />
described. For the last word on<br />
Pascal data types, read Niklaus<br />
Wirth's Report in "User Manual<br />
and Report" by Jensen and Wirth.<br />
REFERENCES<br />
<strong>Apple</strong> PASCAL Reference Manual, by <strong>Apple</strong><br />
computer Inc. 1979.<br />
Programming in Pasca l, by Peter Grogono,<br />
Addison Wesley, 1978.<br />
User Manual and Report, by Kathleen<br />
Jensen and Niklaus Wirth, Springer-Verlag,<br />
1974.<br />
Finally __ . The Hi-res Baseball that's as good as the <strong>Apple</strong>!<br />
by Arthur Wells<br />
$24.95/32K/Disk/ <strong>Apple</strong>soft or Integer<br />
• 8 different pitches. 6 different<br />
swmgs<br />
• 3-D effect on fly balls<br />
• Player controlled fielding<br />
and throwing<br />
• Vocal umpire<br />
• Complete electronic score<br />
board<br />
• Beautiful stadium in full color<br />
WAIT!<br />
DID YOU KNOW THAT ...<br />
e There is a new magazine devoted exclusively<br />
to reviewing APPLE II software P<br />
e Its name is PEELINGS II('<br />
A great hi-res lunar lander, just like the arcade game'<br />
by Bi/IBudge creator of Trilogy dnd Penny Arcade<br />
$24.50/481