Trailing-Edge
-
PDP-10 Archives
-
decuslib10-03
-
43,50320/scat2.rnd
There are 2 other files named scat2.rnd in the archive. Click here to see a list.
.BOTH SIDES
.LEFT MARGIN 5
.RIGHT MARGIN 70
.SPACING 1
.DOCUMENT ID UMNT-1
.CENTRE
^&^^SCAT2
.BLANK 2
.CENTRE
VERSION##2##OF
.BLANK 2
.CENTRE
STANDARD#COMPLEX#ALGEBRA#TRANSLATOR#FOR#PDP-10\&
.BLANK 2
.INDENT -5
AUTHOR: C.J. ANDREWS
.INDENT -5
DATE: 26-MAR-74
.CHAPTER 1
.CENTRE
1.0##INTRODUCTION
.BLANK 4
.PARAGRAPH 5
.FILL
.JUSTIFY
SCAT2\\ IS A PROGRAM WRITTEN IN ^^MACRO-10\\ FOR THE PDP-10 AND
IS THE SECOND VERSION OF ^^SCAT\\ PREVIOUSLY DESCRIBED [1].
.FOOTNOTE 5
.INDENT -5
[1]###ANDREWS,#C.J.,#"^STANDARD ^COMPLEX ^ALGEBRA ^TRANSLATER FOR ^^PDP-10\\",
^COMPUTER ^CENTRE ^BULLETIN, ^JUNE 73.
!
^IT IS DESIGNED PARTICULARLY FOR THOSE WHO MAKE MANY REPETITIVE
CALCULATIONS USING COMPLEX NUMBERS, FOR EXAMPLE, IN ELECTRICAL CIRCUIT
THEORY, AND IN ANTENNA, TRANSMISSION LINE AND WAVEGUIDE THEORY. ^SUCH CALCULATIONS ARE TEDIOUS TO PERFORM, AND SUBJECT TO ERROR. ^^SCAT2\\
ENABLES THE USER TO OPERATE THE COMPUTER AS A SOPHISTICATED DESK
CALCULATOR WITH PREDEFINED FUNCTIONS.
.PARAGRAPH
^WHERE ^^SCAT\\ [1] WOULD ONLY ACCEPT A SINGLE OPERATOR
BETWEEN NUMBERS AND VARIABLES, ^^SCAT2\\ WILL ACCEPT FULL ARITHMETIC
EXPRESSIONS WITH OPERATOR PRECEDENCE, AND USE OF BRACES
TO INDICATE EVALUATION PRECEDENCE OF SUB-EXPRESSIONS. ^ITS ONLY MINOR
LIMITATION IS THAT THE UNARY MINUS OPERATOR IS NOT PERMITTED.
.PARAGRAPH
THE INPUT FORMAT HAS BEEN ALTERED TO ALLOW A MORE LOGICAL
COMMAND CONSTRUCTION, WITH ASSIGNMENT (IF DESIRED) APPEARING AT THE BEGINNING OF THE COMMAND. A FULL RANGE OF SWITCHES IS ALSO PERMITTED.
.PARAGRAPH
^EACH OF THESE FACILITIES IS DESCRIBED IN SUBSEQUENT SECTIONS OF THIS MANUAL.
.CHAPTER 2
.CENTRE
^&^^2.0 COMMAND ELEMENTS\&
.BLANK 4
.PARAGRAPH
T\\HIS SECTION DESCRIBES THE VARIOUS ELEMENTS WHICH MAY BE
INCLUDED IN A COMMAND, EXCEPT SWITCHES, WHICH ARE DEALT WITH
IN SECTION 4.
.BLANK 1
.INDENT -2
^^2.1##COMPLEX NUMBERS
.PARAGRAPH
C\\OMPLEX NUMBERS ARE INPUT TO ^^SCAT2\\ ENCLOSED IN PARENTHESES,
THE REAL AND IMAGINARY PARTS BEING SEPARATED BY A COMMA. ^IF
EITHER PART IS OMMITTED, IT IS ASSUMED ZERO, PROVIDED THAT IF ONLY
ONE NUMBER APPEARS BETWEEN THE PARENTHESES IT IS ASSUMED TO BE
THE REAL PART OF THE COMPLEX PAIR, AND THE IMAGINARY PART ZERO.
.PARAGRAPH
^THE NUMBERS THEMSELVES MAY BE INTEGERS, FLOATING POINT, OR ^E-FORMAT,
OR A MIXTURE OF THESE. ^ALL CALCULATION IS,
HOWEVER PERFORMED IN FLOATING POINT.
.PARAGRAPH
^THE FOLLOWING ARE LEGAL COMPLEX PAIRS:
.BREAK
.NOFILL
.NOJUSTIFY
(1.0,2.0) (1,2) (.01^E2,20.^E-1)
(1.0,) (1,) (.001^E+3,)
(,2.0) (,2) (,2.0^E0)
(1.0) (1) (.1^E+1)
.FILL
.JUSTIFY
.BLANK 1
.INDENT -2
^^2.2##VARIABLES
.BREAK
.PARAGRAPH
V\\ALUES MAY BE ASSIGNED TO VARIABLES (SEE SECTION 2.3)
AND THESE USED IN SUBSEQUENT COMMANDS.
.PARAGRAPH
^THE VARIABLES ARE REFERENCED BY NAME, WHICH MUST START WITH
AN ALPHABETIC CHARACTER, AND MAY BE UP TO SIX CHARACTERS IN LENGTH.
^SUBSEQUENT CHARACTERS MAY BE NUMERIC OR ALPHABETIC.
.PARAGRAPH
^EXAMPLES OF LEGAL NAMES ARE:
.BREAK
.BLANK 1
##########A##ABC##A12##ABCDEF##ZBY3
.BLANK 1
.BREAK
.FILL
.JUSTIFY
.INDENT -2
^^2.3##OPERATORS
.PARAGRAPH
F\\IVE ARITHMETIC OPERATORS ARE PERMITTED BETWEEN COMMAND ELEMENTS,
AND THEY ARE:
.BREAK
.BLANK 1
.CENTRE
+##-##_/##*##_^
.PARAGRAPH
^ASSIGNMENT IS ACHIEVED BY PRECEDING THE COMMAND BY A VARIABLE
NAME FOLLOWED BY THE ASSIGNMENT OPERATOR, __.
.PARAGRAPH
^^SCAT2\\ INDICATES WHEN ASSIGNMENT HAS BEEN MADE (SEE SECTION 3.2).
.PARAGRAPH
^TO SEPARATE THE COMMAND INTO SUB-EXPRESSIONS TO INDICATE PRECEDENCE
IN EVALUATION, THE USER TYPES THE SUB-EXPRESSION INSIDE BRACES,
[ (SHIFT-K) AND ] (SHIFT-M).
.BLANK 1
.INDENT -2
^^2.4##FUNCTIONS
.PARAGRAPH
C\\ERTAIN PREDEFINED TRIGONOMETRIC FUNCTIONS ARE ALLOWED IN
^^SCAT2\\. ^THESE ARE SHORTENED TO THREE CHARACTERS, AND ARE
INDICATIVE OF THE COMMONLY KNOWN FUNCTIONS. THEY ARE:
.BREAK
.BLANK 1
.CENTRE
^^SNH\\[] - SINH FUNCTION
.CENTRE
^^CSH\\[] - COSH FUNCTION
.CENTRE
^^TNH\\[] - TANH FUNCTION
.CENTRE
^^MAG\\[] - MAGNITUDE FUNCTION
.CENTRE
^^ANG\\[] - ANGLE FUNCTION
.CENTRE
^^CAR\\[] - CONVERT TO CARTESIAN FORM
.CENTRE
^^POL\\[] - CONVERT TO POLAR FORM
.BLANK 1
.PARAGRAPH
^SUGGESTIONS FOR OTHER NEEDED FUNCTIONS ARE
WELCOMED, AND ENDEAVOUR WILL BE MADE TO INCORPORATE THEM.
.BLANK 1
.INDENT -2
^^2.5##EXAMPLES
.PARAGRAPH
T\\HE FOLLOWING ARE EXAMPLES OF VALID COMMANDS:
.BLANK 1
.INDENT 2
(1,2)+(3,4)-(7.01,9.86)_/(2.3,8.6)
.BREAK
.INDENT 2
[[(1.0,)+(,9.3)]*(8.1,3.2)]_^(2.1,3.6)
.BREAK
.INDENT 2
ABCD1__[(2.6E1,3.1E-2)*SNH[AB+(2.6,5.1)*Z1]]_^(2,3)
.BREAK
.BLANK 1
.CHAPTER 3
.CENTRE
^&^^3.0##OPERATING##INSTRUCTIONS##AND##OUTPUT\&
.BLANK 5
3.1##OPERATION
.PARAGRAPH
SCAT2\\ IS SET IN OPERATION IN THE FOLLOWING MANNER:
.NOFILL
.NOJUSTIFY
.INDENT 4
#^^.RU SCAT2[111,132]
.BLANK 1
.INDENT 5
SCAT2 (19-MAR-74) READY\\
.INDENT 5
*
.FILL
.JUSTIFY
.BLANK 1
.PARAGRAPH
^THE ASTERISK INDICATES READINESS FOR A COMMAND. ^ONCE A COMMAND
IS INPUT ^^SCAT2\\PROCESSES THE COMMAND IN THE FOLLOWING WAY:
.LEFT MARGIN 7
.BREAK
.BLANK 1
(I)##^IT CARRIES OUT A SINGLE PASS PROCESSING OF THE COMMAND
TO "COMPILE" A POLISH STRING FROM IT.
.BREAK
(II)#^THIS POLISH STRING IS THEN SUBJECT TO A SINGLE SCAN, AND IS
EXECUTED.
.BREAK
(III)THE RESULTS ARE THEN OUTPUT.
.BREAK
.LEFT MARGIN 5
.PARAGRAPH
^^SCAT2\\ INPUTS THE COMMAND CHARACTER BY CHARACTER.
^THIS IS DONE SO THAT IMMEDIATE PROCESSING OF SWITCH CHARACTERS CAN BE
MADE. ^THIS CARRIES WITH IT THE LIMITATION THAT A RUBOUT CHARACTER
CANNOT BE ISSUED. ^IF AN ERROR CONDITION OR MISTAKE OCCURS AN ^R
SWITCH SHOULD BE USED TO RESTART THE COMMAND (SEE SECTION 4.0).
.BLANK 1
.INDENT -2
^^3.2##OUTPUT
.BLANK 1
.INDENT -1
3.2.1##ASSIGNMENT
.PARAGRAPH
SCAT2\\ INDICATES WHEN ASSIGNMENT HAS BEEN MADE BY OUTPUTTING
THE RESULT OF ITS CALCULATION, AND THE VARIABLE NAME TO WHICH
ASSIGNMENT HAS BEEN MADE. ^FOR EXAMPLE,
.BREAK
.INDENT 5
.BLANK
^^ABC12\\##=#(1.032,-4.301)
.BREAK
.BLANK 1
.INDENT -1
^^3.2.2##NO##ASSIGNMENT
.PARAGRAPH
W\\HEN NO ASSIGNMENT HAS BEEN MADE ^^SCAT2\\ MERELY TYPES THE
RESULT IN THE FOLLOWING FORM:
.BREAK
.BLANK 1
.INDENT 5
^^RESULT\\ = (1.032E+6,-4.301E-2)
.BREAK
.BLANK 1
.INDENT -2
^^3.3##LIMITATIONS
.PARAGRAPH
T\\HE OPERATING LIMITATIONS OF ^^SCAT2\\ ARE AS FOLLOWS:
.BREAK
.LEFT MARGIN 7
(I)##^COMMANDS MAY NOT BE EXTENDED BEYOND ONE LINE
.BREAK
(II)#^NO MORE THAN 40 VARIABLES MAY BE ASSIGNED.
.BREAK
(III)^NO UNARY MINUS IS PERMITTED.
.BREAK
.LEFT MARGIN 5
.CHAPTER 4
.CENTRE
^&^^4.0##SWITCHES\&
.BLANK 4
.PARAGRAPH
A\\ NUMBER OF SINGLE LETTER SWITCHES CAN BE USED TO INSTRUCT
^^SCAT2\\ TO PERFORM SPECIFIC FUNCTIONS TO ASSIST THE USER.
^THESE ARE GIVEN IN SECTION 4.3.
.BLANK 1
.INDENT -2
^^4.1##SPECIFYING A SWITCH
.PARAGRAPH
T\\O SPECIFY A SWITCH THE USER TYPES AN "ALTMODE" OR "ESCAPE"
CHARACTER. ^THIS PLACES ^^SCAT2\\ IN SWITCH MODE, AND THE CHARACTER
IMMEDIATELY FOLLOWING THE ALTMODE OR ESCAPE IS INTERPRETED AS A
SWITCH. ^IT IS THEN PROCESSED IMMEDIATELY, AND IN MOST CASES
CAUSES SOME OUTPUT. ^THE COMMAND STRING HOWEVER IS UNAFFECTED
BY THE ACTION OF A SWITCH AND MAY BE CONTINUED UPON TERMINATION
OF THE SWITCH LIST (SEE SECTION 4.2).
.BLANK 1
.INDENT -2
^^4.2##TERMINATING##THE##SWITCH##LIST
.PARAGRAPH
A\\FTER PROCESSING A SWITCH ^^SCAT2\\ WILL ACCEPT, AND EXPECT,
ANOTHER. ^IF NO FURTHER SWITCHES ARE REQUIRED, AN ALTMODE, OR ESCAPE,
TERMINATES THE LIST.
.BLANK 1
.INDENT -2
^^4.3##SWITCH##ACTIONS
.BLANK 1
.INDENT -1
4.3.1##D\\##SWITCH
.PARAGRAPH
^THE ^D SWITCH CAUSES A DUMP OF ALL VARIABLES ASSIGNED TO DATE,
AND THEIR CURRENT VALUES.
.BLANK 1
.INDENT -1
^^4.3.2##E##\\SWITCH
.PARAGRAPH
^THE ^E SWITCH CAUSES ^^SCAT2\\ TO EXIT TO MONITOR.
.BLANK 1
.INDENT -1
^^4.3.3##R\\##SWITCH
.PARAGRAPH
^THE ^R SWITCH CAUSES ^^SCAT2\\ TO RESTART A COMMAND. ^THIS
SWITCH CAUSES THE CURRENT COMMAND TO BE LOST.
.BLANK 1
.INDENT -1
^^4.3.4##Q\\##SWITCH
.PARAGRAPH
^WHEN TYPING A LONG COMMAND, A USER MAY WISH TO QUERY IF
ERRORS DO EXIST IN WHAT HAS ALREADY BEEN TYPED. ^THE ^Q SWITCH IS
IMPLEMENTED TO ENABLE HIM TO DO THIS.
.PARAGRAPH
^IF NO ERRORS EXIST, ^^SCAT2\\ AUTOMATICALLY OUTPUTS A SWITCH LIST
TERMINATOR,AND EXPECTS THE USER TO CONTINUE THE COMMAND.
.PARAGRAPH
^IF ERRORS DO EXIST, THE USER IS INFORMED, AND ASKED FOR ANOTHER
SWITCH, MOST LIKELY THE ^L SWITCH.
.INDENT -1
.BLANK 1
^^4.3.5##^L\\##SWITCH
.PARAGRAPH
^THE ^L SWITCH WILL LIST ANY ERRORS EXISTING IN THE CURRENT
COMMAND. ^IF NO ERRORS EXIST, A SWITCH LIST TERMINATOR IS
OUTPUT, AND THE COMMAND CONTINUED. ^AFTER LISTING THE ERRORS, THE
PROGRAM AUTOMATICALLY PERFORMS AN ^R SWITCH FUNCTION.
.BLANK 1
.INDENT -1
^^4.3.6##^C\\##SWITCH
.PARAGRAPH
^THE ^C SWITCH CLEARS THE COUNT OF ERRORS IN THE CURRENT
COMMAND. ^IT DOES NOT REMEDY THE ERRORS THEMSELVES, BUT MERELY
CLEARS THE COUNT. ^FOR THIS REASON PECULIAR RESULTS MAY BE ENCOUNTERED
WHEN THIS SWITCH IS USED, AND A COMMAND CONTINUED.
.BLANK 1
.INDENT -1
^^4.3.7##H\\##SWITCH
.PARAGRAPH
^THE ^H SWITCH ISSUES A HELP TEXT TO THE USER, DETAILING EACH
OF THESE SWITCHES.
.BLANK 1
.INDENT -1
^^4.3.8##X\\##SWITCH
.PARAGRAPH
^THE ^X SWITCH ENABLES A USER TO DELETE VARIABLES PREVIOUSLY
STORED. ^^SCAT2\\ WILL ASK:
.BLANK 1
.INDENT 10
CONFIRM:
.BLANK 1
.PARAGRAPH
TO WHICH IS TYPED THE LIST OF VARIABLES IT IS DESIRED TO DELETE.
^IF A '*' IS TYPED IN REPLY, ALL VARIABLES ARE DELETED.
.BLANK 1
.INDENT -1
^^4.3.9##\\ALTMODE##OR##ESCAPE
.PARAGRAPH
^THE ALTMODE, OR ESCAPE, TERMINATES A SWITCH LIST AND ALLOWS THE CONTINUATION
OF A COMMAND.
.CHAPTER 5
.CENTRE
^&^^5.0##ERROR DETECTION\&
.BLANK 4
.PARAGRAPH
SCAT2\\ OUTPUTS A NUMBER OF DIAGNOSTIC ERROR MESSAGES IN THE
EVENT OF THE OCCURRENCE OF ERROR CONDITIONS.
.BLANK 1
.INDENT -2
^^5.1##"COMPILE"##TIME##ERRORS
.PARAGRAPH
W\\HEN TRANSLATING THE COMMAND INTO A POLISH STRING THE FOLLOWING
ERROR MESSAGES MAY OCCUR:
.NOFILL
.NOJUSTIFY
.BLANK 1
.LEFT MARGIN 7
^^ILL. CHAR IN INPUT
TOO MANY CHARS
UNDEFINED VARIABLE
DELIMITER EXPECTED
EXP OUT OF RANGE
UNBAL PARENTH\\
.LEFT MARGIN 5
.FILL
.JUSTIFY
.BLANK 1
.INDENT -2
^^5.2##"EXECUTION"##TIME##ERRORS
.PARAGRAPH
D\\URING EXECUTION OF THE POLISH STRING, THE FOLLOWING ERROR
CONDITIONS MAY OCCUR:
.BLANK 1
.NOFILL
.NOJUSTIFY
.LEFT MARGIN 7
TOO MANY VARIABLES
EXEC OV/UND FLOW
UDF FCN
.BLANK 1
.FILL
.JUSTIFY
.PARAGRAPH
^THESE ARE THOUGHT TO BE SELF-EXPLANATORY.
.BREAK