Friday, February 8, 2019

VARIABLE

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

The VARIABLE program comes from page 36 of the book, "Pascal Primer" by David Fox and Mitchell Waite. The program was written for the UCSD Pascal system on the Apple II. I have ported it to the Atari Pascal Language System. This is a simple program which introduces STRING and INTEGER variables to the reader.

All work is being done using the Altirra Atari 8-bit emulator. The VARIABLE source code was created using the AtariWriter80 word processor. The program was Compiled, Linked, and Run from the Atari Pascal Monitor menu show above.

The program was linked as follows:

LINKER V1.0
*D2:VARIABLE.ERL,GRSND,PASLIB/S

The program was run by selecting (R)un from the Atari Pascal Monitor menu and entering:
D2:VARIABLE.COM


In this port, I've added the POSITION statement before each WRITELN statement to force the cursor to the left margin, and thereby overcoming the Atari 8-bit's default action of indenting 2 spaces at the beginning of each line. I've added a WRITE(CHR(125)) statement to clear the Atari's text screen and a READLN statement at the end to keep the program from ending prematurely.

I've also added the (*$ID:GSPROCS*), which lets the system know that I am using a Graphics and Sound procedure, in this case, the POSITION statement, which is defined somewhere else.

No comments:

Post a Comment