PAD program listing
|
| Program: | Comments: |
|
|
|
|
|
| « |
|
|
| →STR | Makes sure the object is in string form. (Strings |
|
|
| are unaffected by this command.) |
|
| WHILE | Repeats if the string contains fewer than 22 |
|
| DUP SIZE 22 < | characters. |
|
| REPEAT | |
|
| " " SWAP + |
|
|
| END | End loop. |
|
| » |
|
|
| `OPAD K | Stores the program in PAD. |
|
|
| |
|
|
| |
Checksum: # 6577d |
| ||
Bytes: | 57.5 |
|
PAD is demonstrated in the program BDISP.
PRESERVE (Save and Restore Previous Status)
PRESERVE stores the current calculator (flag) status, executes a program from the stack, and restores the previous status.
Level 1 | → | Level 1 |
|
|
|
«program» | → | result of program |
'program' | → | result of program |
|
|
|
Techniques used in PRESERVE
Preserving calculator flag status. PRESERVE uses RCLF (recall flags) to record the current status of the calculator in a binary integer, and STOF (store flags) to restore the status from that binary integer.
Error trapping. PRESERVE uses IFERR to trap faulty program execution on the stack and to restore flags. DOERR shows the error if one occurs.