home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / calculat / rpncalc.lbr / RPN.DZC / RPN.DOC
Text File  |  1987-09-12  |  3KB  |  49 lines

  1. RPN.DOC    Documentation                  August 11, 1987
  2.  
  3. This program can be distributed freely provided no charge is made for
  4. its use.  Copyright is reserved for the author, C. Scott Blackwell.
  5.  
  6.  
  7. The files RPN.DOC, RPN2.PAS, RPN2.COM, RPN.PAS, and RPN.COM are the
  8. distribution files for the RPN (Reverse Polish Notation) calculator program.
  9. The program is written in Turbo Pascal; however, with the exception of the
  10. Turbo string handling functions and procedures it should be pretty 'plain
  11. vanilla' Pascal.  As such it should be transportable and compilable in a
  12. variety of systems.  It compiles with Turbo on IBM PC's with no problems.
  13. The programs were actually written for an Apple ][+ CP/M system.  The RPN and
  14. RPN2 versions differ only in that the latter can handle strings of up to
  15. 20 numbers and commands.  The RPN version handles numbers and commands
  16. strictly in the scope of a calculator, i.e. number <enter> or number command.
  17. Addition of hyperbolic functions or other functions would be relatively
  18. easy in the context of the Pascal code.  The logic of the parser and extended
  19. stack/command string handling is the only 'tricky' part.
  20.  
  21. The compiled code should run on CP/M-80 systems o.k. since no Apple
  22. specific I/O or screen codes were used.
  23.  
  24. The calculator emulates most of the functions of a RPN (HP-style) calculator
  25. with the exception of the hyperbolic functions.  If needed they would be
  26. trivial to add in the Pascal code.
  27.  
  28. The system implements the usual RPN stack; namely X,Y,Z, and T registers.
  29. There are 10 memories, R0 to R9.  They can be stored to and recalled from.
  30. The usual STO +1 will store X and add it to the value in R1. STO 1 will
  31. store X and overwrite previous R1 value.  STO -n, +n, *n, and /n are all
  32. legal. In the command string version STO + n, separated by spaces, is the
  33. required syntax.  The parser uses spaces to permit separation of commands
  34. and numerical values.
  35.  
  36. The trig functions, sin, cos, and tan as well as asin, acos, and atan are
  37. implemented.  The values returned from the arc trig functions are between
  38. 2Pi and -2Pi.
  39.  
  40.  
  41. I wrote this program for use on an Aspect 2000-3000 minicomputer used
  42. in an NMR spectrometer.  Admittedly a HP calculator is cheaper and more
  43. accurate; however, sometimes it is troublesome to have to find one, so
  44. this program can turn a $500K spectrometer into a $70 calculator.
  45.  
  46. I hope the program is useful to others; I have found it so.
  47.  
  48.                                  C. Scott Blackwell
  49.                                  August 11, 1987