13.07.2015 Views

apple-pascal-1.3-manual

apple-pascal-1.3-manual

apple-pascal-1.3-manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Apple II Pascal <strong>1.3</strong> is a version of the Pascal programming language for theApple II computer. It is based on UCSD Pascal, which in turn is based on theoriginal definition of Pascal by Kathleen Jensen and Niklaus Wirth in thePascal User Manual and Report (Springer-Verlag, 1974).Basic ConceptsTo understand how the Pascal language works, you must first understandsome of its underlying ideas. The most important ones are described in thischapter.A Compiled LanguageApple Pascal programs must be compiled before they are executed. Toconstruct a Pascal program, you first create a textfile of programstatements, resembling English sentences; this textfile is called the sourcetext. Next, you run a special program called the Pascal <strong>1.3</strong> Compiler. TheCompiler reads your source text and creates a corresponding Pascalcodefile. The codefile contains an intermediate code called P-code.When you run your program, the P-code is read by the Apple PascalInterpreter program, which accepts P-code instructions and executesthem immediately. The Interpreter is also known as the P-machine.Block StructurePascal is a block-structured language; it helps you divide your programsinto logical areas called blocks. Each block is a self-contained part of yourprogram; it can have its own data and subroutines. Yet blocks can be freelynested within one another. Indeed, every program is simply the outermostblock of a series of nested blocks.As a result, every Pascal programming job breaks down into theconstruction of a hierarchy of blocks. Some, like the outermost programblock, accomplish general tasks. Other blocks.accomplish specific datamanipulations. The power of Pascal lies in the fact that the rules forconstructing blocks at every level are the same.III-2Chapter 1: Apple II Pascal <strong>1.3</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!