home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / calculat / calc32.lbr / CALC.DZC / CALC.DOC
Text File  |  1988-03-24  |  3KB  |  112 lines

  1.       32 BIT CALCULATOR
  2.       BY  GUY COUSINEAU
  3.        1059 Hindley St
  4.         OTTAWA Canada
  5.            K2B 5L9
  6.  
  7. This program has no copyrights and is
  8. being freely released to the public
  9. domain.  No charge shall be made for its
  10. distribution nor shall it be included in
  11. any sold software without the written
  12. permission of the author.
  13.  
  14. This double precision calculator is not
  15. intended to replace the pocket
  16. calculator, just to provide a useful
  17. tool for quick reference, especially for
  18. those who have a RAMDISK.  It handles 7
  19. basic functions, 3 logicals and HEX to
  20. DEC conversion.
  21.  
  22.           FUNCTIONS
  23.  
  24.     +    add
  25.     -    subtract
  26.     *    multiply
  27.     /    divide
  28.     ^    exponent
  29.     !    factorial
  30.     &    logical AND
  31.     %    logical OR
  32.     #    logical XOR
  33.     <n    shift left  by n over 32 bits
  34.     >n    shift right by n over 32 bits
  35.     (n    rotate left  over 8 bits
  36.     )n    rotate right over 8 bits
  37.     M    USE PREVIOUS RESULT
  38. eg
  39.     5*7<CR>
  40.     35
  41.     M*2<CR>
  42.     70
  43.     
  44.             SYNTAX
  45.  
  46.       number[op][number]
  47.  
  48. Enter just a number and return for HEX to DEC to HEX
  49.  
  50. All other functions require three inputs.
  51.  
  52. Put all inputs on one line in upper or
  53. lower case with NO SPACES.  My parser
  54. doesn't like them.
  55.  
  56. For convenience, you can put commas in
  57. your input -- they are ignored by the
  58. parser.
  59.  
  60. For simplicity in the parser, use the
  61. following prefixes:
  62.  
  63.     '    one ASCII character
  64.     H    HEX
  65.     I    individual bits(binary)
  66.  
  67. The result is always displayed in HEX
  68. and DECIMAL as well as the last 8 bits
  69. in binary and ASCII--this should be
  70. useful for checking out logicals.  For
  71. example:
  72.  
  73.     9<CR>
  74.     00001001 ^I
  75.     9 <-> 9
  76.  
  77.     'B+1<CR>
  78.     01000011 C
  79.     43 <-> 67
  80.  
  81. In the first example, I ask to see the
  82. value 9 displayed.  The binary
  83. equivalent is shown and its
  84. corresponding ASCII value of CONTROL-I. 
  85. On the next line, I see the HEX and
  86. DECIMAL equivalents.  In the second
  87. example, I ask to Add 1 to the ASCII
  88. value of the letter B.  The result is
  89. ASCII C which corresponds to 43HEX and
  90. 67DECIMAL.
  91.  
  92. See additional comments in source
  93. code...note the following hardware
  94. specific item:  the program uses 3
  95. <ESC>A to move the cursor up.  You may
  96. need to change these for your terminal. 
  97. See the UP label.  Other than that, the
  98. only other control characters used are
  99. <TAB> (CONTROL-I) and <BEL> (CONTROL-G).
  100.  
  101. It should also be relatively easy for
  102. programmers to extract parts of
  103. functions to include in programs.  Feel
  104. free to do so provided your programs
  105. will be public domain.
  106.  
  107. Please report any bugs or suggestions.
  108.  
  109.     Guy
  110.  
  111. rams.  Feel
  112. free to do so prov