ATOM PASCAL versie 1.1986
Na het laden wordt het programma opgestart met link #3000. De Prompt is een pijltje naar links, hier voorgesteld met <- .
LINK#3000 PROMPT: <- PROGRAM: #3000- #7FFF
WORKING AREA: #06 tot #FF, #200 tot #2FF
USER AREA: #8200- #97FF: ( zie onderverdeling hiernaast)
TEXT
<T Top line position
<B Bottom line position (-.-)
<N/n Next n lines (“."=all,RTN=1)
<U/n Up n lines
<F Find line containing string
<? string
IN / OUT
<R Read text from keyboard
?
<L/n List n lines TV/printer
<C COS/DOS (To ATOM COS/DOS)
SAVE"FILE" *LOAD"FILE"
Back to PASCAL = Control P (Useless after BREAK)
TOGGLE
<A Assignment tracing. Print values changed by
Assignment and FOR statements.
<S Statement tracing. Print text unit
just before it is executed.
|
|
EDITING
<D/n Delete n lines
<I Insert one line ahead of current line
?
<SP (SP=SPACE) List current line
<V View 5 lines
EXECUTION
<G GO, execute program
<K Check program syntax
<, Execute and trace program .
<X Execute immediately one statement ( STM )
?STM
<P Page, redefine number of printer columns ( decimal ) .RTN=64 (default)
<M Show number of free user- memory bytes ( decimal )
<Z Delete program ( cold start) N or SPACE = NO, Y = YES
<E End PASCAL, back to BASIC. (BREAK
<ESC Stop
ATOM PASCAL is both a compiler and an interpreter. It compiles source statements written in Pascal directly from the keyboard into an internal format. The internal format contains both the object code to be interpreted upon execution and source code identifiers for formatted printout to support editing at the source code level. Indentation levels are set
automatically to aid debugging. The object code (program) can be saved and loaded on tape or disk. (Starting address of code in address #97B2/B3).
Input lines must be restricted to 50 characters. Machine-code subroutines can be called using SUBR(CALL) or FUNC(CALL). These subroutines must not contain operating system vectors (#200-#21B):
- PROGRAM BLEEP;
- VAR BLEEP=$FD1A:CHAR;
- BEGIN
- SUBR(BLEEP) (or WRITE(FUNC(BLEEP) ))
A well known textbook in Pascal is “Pascal User Manual and Report".
Springer Verlag (1978) by Jensen and Wirth.
Most of these Standard Pascal features are implemented:
Reserved Words
AND | END | NIL | SET |
ARRAY | FILE | NOT | THEN |
BEGIN | FOR | OF | TO |
CASE | FUNCTION | OR | TYPE |
CONST | GOTO | OTHERWISE | UNTIL |
DIV | IF | PROCEDURE | VAR |
DO | IN | PROGRAM | WHILE |
DOWNTO | LABEL | RECORD | WITH |
ELSE | MOD | REPEAT | |
Reserved Symbols
| . | , | ' | ; | |
+ | - | * | / | := | : |
= | <= | >= | <> | < | > |
( | ) | (* | *) | [ | ] |
Word | Function | Operand(s) | Result |
ABS | Absolute Value | Integer. Real | Same as Operand |
ARCTAN | Arc Tangent | Integer, Real | Real |
COS | Cosine | Integer, Real | Real |
EXP | Exponent | Integer, Real | Real |
LN | Natural logarithm | Integer, Real | Real |
ODD | | Integer | Boolean |
ROUND | Round | Real | Integer |
SIN | Sine | Integer, Real | Real |
SQR | Square | Integer, Real | Same as Operand |
SQRT | Square Root | Integer, Real | Real |
TRUNC | Truncate | Real | Integer |
Standard Identifiers
Constants: FALSE TRUE
Types: BOOLEAN CHAR INTEGER
REAL STRING TEXT
Functions: ABS FUNC ROUND SUCC
ARCTAN LN SIN TRUNC
CHR ODD SQR
COS ORD SQRT
EXP PRED SUBR
Procedures: READ READLN WRITE WRITELN
BREAK
Character Functions:
Word Function Operand(s) Result
CHR Character Integer Character
ORD Ordinal Scalar except Real Integer
PRED Predecessor Scalar except Real Same as Operand
SUCC Successor Scalar except Real Same as Operand
Machine Language Functions:
Word Function Operand(s) Result
SUBR Subroutine Call Address -
FUNC Function Call Address, Data Char
Arrhythmic Operators
Symbol/Word Operation
+ Addition (plus sign)
- Subtraction (minus sign)
* Multiplication
/ Division
DIV Division (yields a truncated integer result)
MOD Modules (yields the remainder of division)
Relational Operators
Symbol/Word Operation
> Greater than
>= Greater than or equal to
< Less than
<= Less or equal to
= Equal to
<> Not equal to
EXECUTION TIME DIAGNOSTICS
The form of the diagnostic message is .
ERROR *nn
text unit
After control returns to the command interpreter, a series of
WRITELNs may be executed with the <-X command to examine the
state of the data. The position of the text unit pointer
insures that visibility of identifiers is the same as that
which prevailed at the time of the error. The data structures
build during execution are not initialized until the next <-G
or <-, is executed, so data are available for examination.
The *S ERROR* diagnostic indicates a syntax error.
In the case of the syntax error message. the right-most "*" usually gives a strong clue about the error, since the character immediately to its right is the one which led the syntax analyzer into the impasse. If the right-hand "*" is the last. character of the diagnostic message, something is m1missing at the end of the input, for example, a final semicolon in a declaration or definition.
Note: Error numbers with an asterix are internal checks.
Their occurrence may indicate loss of memory integrity.
01*
02*
03 Value Stack has exceeded available space.
04*
05*
06 Too few actual parameters
07 Too many actual parameters
08 Actual parameter of a VAR formal parameter is an expression
09*
10
11 Ordinal type where ordinal ( scalar) type required.
12 Maximum permissible dynamic statement depth of 24 exceeded.
13* Ordinal value computation out of range (Array and set selection)
14*
15*
16 Expression result type should be Boolean and is not.
17 Function identifier on left-hand side of assignment does not refer
to a declared function.
18*
19 Type compatibility error in assignment or actual value parameter.
20 Type (s) improper for operator.
21 Attempt to make array selection on a nonarray.
22 String length excessive for operation.
23 Empty string improper for operation
24*
25 Attempt to negate a nonnumeric.
26 Operand should be Boolean.
27*
28 GOTO with destination textual depth greater than that of GOTO.
29 Actual/formal parameter type discrepancy.
30 Control variable has changed in FOR loop.
31 Argument of CHR not in 0. .255.
32 Value less than lower limit of subrange.
33 Value greater than upper limit or subrange.
34 Argument not ordinal (scalar).
35 Argument not real or integer.
36 GOTO refers to an undefined label.
37 Actual/formal VAR parameter type discrepancy.
38 Array reference to STRING with noninterger subscript.
39 Right operand of IN not a set or packed set.
40 Source String to long for receiving string.
41 Improper argument of record select ( .) operator.
42*
43 No match between value of expression and CASE constants.
44 Argument of WITH is not a record variable.
45 More than the maximum of 16 records in a program.
46 Field identifier not preceded by “.” and not in the scope of a WITH.
47*
48 Processor stack pointer is higher than when break discontinued
execution: Break-in-progress is now false and <-G will start at beginning.
49 Processor stack is about to overflow.
50 Attempted division by zero.
51 Floating-point overflow.
52 Fixed-point overflow in TRUNC or ROUND.
53 MOD with negative divisor.
Diagnostic messages occuring during binding have the following distinctive form: an indicator line describing the error, followed by one or more program text tines describing where the error occurred. The following indicator lines can occur:
*UNDEF* | identifier |
*DUP* | identifier |
*UNDECL* | label |
*DUP* | label |
*TYPE* | identifier |
The indicator lines *DUP* identifier and *UNDEF* identifier are each followed by one text unit which contains the cited identifier occurrence.
The *DUP* diagnostic is generated at a defining occurrence of an identifier if the identifier has a prior defining occurrence at the same block level.
The *UNDEF* diagnostic is generated at a referring occurrence of an identifier if the identifier has no prior defining occurrence at the same or at any higher block level which would be visible to this referring occurrence.
The indicator line *TYPE* identifier can indicate an inconsistency between the types of the upper and lower bounds of a subrange type; it can also be generated by a STRING type with a noninteger length. The identifier in the indicator line is a type identifier appearing in either the subrange or string type; this identifier refers to a type which is inconsistent with the definition in which it occurs. This definition occurs in the text unit following the indicator line.
Nederlandse versie
|