
CALCULATE, a Multibase Calculator Program

     CALCULATE is a program which will do number base
  conversions and calculations for decimal, hexadecimal,
  octal and character data in integer or floating point
  modes.

     Upon entry, the mode is requested: Integer 
  calculator, Floating point calculator, $, Help, or Quit:
  Enter I, F, $, H, or Q.   $ enters the Floating point mode
  with the $ base selected.  H(elp) prints this document.
  Q(uit) exits the program.  The default mode if a <cr> is
  entered is Floating point calculator.

     For the calculator modes, operations are then requested:
  OP[B] #? is printed.  Enter the operation character(s)
  (and the optional base character, if desired), then the number,
  if any, to be operated upon, and a carriage return.
  If a base is given, a blank must precede the number,
  except when the first character of the entry is numeric.
  For single character operations, the blank is also optional,
  except for hex entry where the first character may be
  confused with specification of a base.
  Decimal, octal, hex, and $ are list directed input.
  Hex entry may be up to an 8 digit string.  Character
  input is up to 4 characters.  If no number is given,
  the contents of the main register is used.

     The operations allowed are: +,-,*,/, C(clear),
  E(enter), ^ or P(raise to power), M(reverse sign), =(print result
  or save), D(display a memory), Q(quit), S(sqrt, integer or float),
  A(logical AND), O(logical OR), X(logical exclusive OR),
  N(logical NOT or complement), L(shift left), R(shift right),
  F(float from integer), I(fix to integer), H(get help), 
  and T(print time and date).  Enter only the single upper
  case letter of the operation.  An operation of <blank> is
  interpreted as Enter.  For convenient use with the VT100 keypad,
  a comma (,) as a leading character is interpreted as a plus (+).
  To exit the program, enter Q or ^Z at any prompt or use ^Y.

     A number of extended operations are allowed:
  SIN, COS, TAN, ATAN, ASIN, ACOS, SINH (hyperbolic sine),
  COSH, TANH, SIND (sine of degree argument), COSD, TAND,
  ATAND, ASIND, COSD, LN (natural log), LOG (log base 10),
  EXP (e to power), RADEG (radians to degrees), DEGRAD
  (degrees to radians), INV (invert or reciprocal), and
  FAC (factorial).  These operations require the full name 
  in caps to be entered, and may NOT include a base.  These
  extended operations will give unexpected results if used
  in integer calculator mode.  

     The commands AUTO and NOAUTO turn on and off automatic
  printing of results.  The default is to automatically print
  the results of each calculation.  The commands REC and NOREC
  turn on and off the recording of all input and output to a file.
  When REC is entered, you will be prompted for a file name
  to which to write the recorded information.  When you exit
  the program, you will be reminded of the name of the file
  containing the recorded information.  The recording of
  the calculations can be turned on and off multiple times
  in a session, but the file is opened only once and is
  closed only when the program is exited.  As an aid to
  using the recorded data, comments may be entered at the
  end of each line of input.  These are entered by following
  the command and operand (if any) with a tab character or
  an exclamation mark (!), then enter your comment, up to
  the end of the input line.

     The bases allowed are: D(decimal), H(hexadecimal),
  O(octal), C(character-ASCII,A4), B(binary, output only),
  $(dollars, to maintain accuracy), A(angles, dddd:mm:ss.ss),
  T(time, hhh:mm:ss.ss), and M(to or from memory).  The $
  base shifts the decimal point internally 2 places to the
  right, maintaining cents as integers.  The default base is
  decimal, but can be changed by entering DBASE O to change
  to octal, DBASE H for hex, DBASE $ for dollars, DBASE A for
  angles, or DBASE T for time.  DBASE D restores the base to
  decimal.  C and B bases are not available for the default base.
  Unexpected results will occur if a default base or entry base
  of O or H is selected in floating point mode, although these
  bases may be used for display of floating point results.
  Bases A and T are internally the same, and are not available
  in integer mode.

     Operations are done on one register which is used for both
  integer and floating point calculations.   There are 20 memory
  locations for saving integer or floating point results.
  Operations require an operand (except C,M,S,N,I,F,Q,H,T).
  Operands are a base plus a number (except =).
  Memories for D(display memory) operation or M(use memory) base
  are 1 thru 20; D 0 displays all memory registers.  Anything
  else uses the main register.  Memories are loaded by the
  =M # operation, where # is the memory number, and are used by
  specifying base M, e.g., *M #.  The base for the Display may
  be default or specified.  All memories are clear upon entry to
  the program and are not changed by switching from integer to
  floating point calculator mode, or reverse.

     The internal representation for all modes of operation
  is standard VAX binary form.

     When working with both integer and floating point numbers,
  one may exit one mode with the command CMODE and reenter with
  another mode and all registers and memories are unchanged from
  the last operation in the original base.  This works for going
  from F mode to I mode, I mode to F mode, and includes the $ mode
  which is F mode with the default base set to $.  I and F
  operations assume that the register is one mode and convert
  it to the other.  All saves and entries from memory are 
  independent of the mode of operation.   Also all bit manipulation
  operations (A,O,X,N,R,L)  are independent of the mode of operation.
  D,T,H,CMODE, and = (except =M) operations do not change any registers.


  EXAMPLES:
     To add 8 and 9 enter:
  ED 8 (or E 8)  enters decimal 8 into main register
  +D 9 (or + 9)  adds decimal 9 to current value
  =D   (or =)    prints result in decimal
  =H             prints result in hex
  =M 2           stores result in memory 2
  *M 2           multiplies current result by contents of memory 2
  PD 2 (or ^ 2)  raises result to power 2 (squaring)
  RD 2 (or R 2)  right shift result 2 (decimal) bits
  DH 2           print contents of memory 2 in hex (no registers
                      are changed)
  D 0            print contents of all memory registers
   5.6           enters 5.6 into the result register
  5.6            enters 5.6 into the result register
  E5             enters 5 into the result register
  +10            adds 10 to the result register
  E$ 12.50	  enters dollars, $12.50
  EA 12:25:32	  enters angle 12 degrees, 25 minutes, 32 seconds
  ET 1:20	  enters time 1 hour, 20 minutes
  ET :1:32.5	  enters time 1 minute, 32.5 seconds
  C              clears current result register
  S (or SQRT)    takes square root of result (integer or flt.pt.)
  I              converts result to integer from floating point
  SIN            takes the sine of the result register
  COS .566       takes the cosine of .566 (result in main register)
  DBASE O        sets the default base to octal
  REC            enter record mode
  *2.54! convert to centimeters	sample with ! comment
  *2.54<tab> convert to cm.		sample with tab comment

				4/2/87   JMB
