Friday, March 1, 2019

EXPON1

Table of Contents ] [ List of Example Programs ] [ EXPON1 Disk Image ]

EXPON1 is a program that appears on page 60 (listing 5-3) of the book "Pascal Primer" by David Fox and Mitchell Waite. Like many early versions of Pascal, the Atari Pascal Language System doesn't have a built-in exponentiation operator. This program demonstrates how to calculate exponents in Pascal using a FOR loop. 


The original Pascal source code from the book was written for the Apple II family of personal computers using UCSD Pascal.


The Atari Pascal Language System version of the program was created in an Altirra emulator-based Development Environment using the AtariWriter 80 word processor as the source code editor.


I made a few tweaks to the original Apple II/UCSD Pascal program to clear the Atari text screen and to keep the program from ending prematurely. Also, since we are using REAL number variables in this program, we MUST include the floating point library (FPLIB) when linking or the program will crash when run.


The link command looks like:

LINKER V1.0
*D2:EXPON1,FPLIB,PASLIB/S


When you run the program, it looks like:



No comments:

Post a Comment