home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / bcdclass.zip / BCDCALC.INF (.txt) < prev    next >
OS/2 Help File  |  1995-09-25  |  5KB  |  104 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. BCD Calculator Overview ΓòÉΓòÉΓòÉ
  3.  
  4. The BCD Calculator is a simple four-function desktop calculator that is 
  5. intended to demonstrate the facilities and functions of the BCD Class object. 
  6.  
  7. The calculator resembles other Windows and PM Calculators with a keypad and 
  8. standard arithmetic function keys.  The big difference is that it operates on 
  9. integers of up to 32 decimal digits in length. 
  10.  
  11. Since this version does not have floating point, you probably wouldn't want to 
  12. replace your favorate desktop calculator.  Besides, I can't imagine anyone 
  13. needing 32 digit arithmetic to balance their checkbook, even in countries with 
  14. currencies that have very small unit values. 
  15.  
  16.  
  17. ΓòÉΓòÉΓòÉ 1.1. Registers ΓòÉΓòÉΓòÉ
  18.  
  19. Three registers are displayed at the top of the calculator: 
  20.  
  21. o Memory 
  22. o Accumulator 
  23. o Entry 
  24.  
  25. The registers are more or less conventional except that all three are 
  26. displayed.  The Memory register is set from the Accumulator and Memory Recall 
  27. returns it's data to the Entry register.  The Accumulator is set as a result of 
  28. some process on data from the Entry register. 
  29.  
  30.              ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇSh Right CpldΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  31.              Γöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ     ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  Γöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  32.              ΓööΓöÇ>Γöñ           Γöé     Γöé          Γö£ΓöÇΓöÇΓöÿ  Γöé          Γöé
  33.       KeyPadΓöÇΓöÇΓöÇ>Γöñ   Entry   Γö£ΓöÇΓöÇΓöÇΓöÇ>Γöñ  Accum   Γö£ΓöÇΓöÇΓöÇΓöÇ>Γöñ  Memory  Γö£ΓöÇΓöÇΓöÉ
  34.             ΓöîΓöÇΓöÇ>Γöñ           Γöé     Γöé          Γöé     Γöé          Γöé  Γöé
  35.             Γöé   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  Γöé
  36.             ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇMemory RecallΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  37.  
  38. The Entry register is set from the keyboard, from a memory recall, or from the 
  39. low-order digits from the accumulator on a Shift Right-Coupled operation. The 
  40. Entry register has a "constant" capability such that its contents will be 
  41. retained after an arithmetic function key is pressed so that you can add, 
  42. (e.g.), the same value to the Accumulator multiple times.  The Entry register 
  43. will clear after the += key is pressed or if a numeric key is pressed signaling 
  44. the entry of a new value. 
  45.  
  46. The registers are read only and cannot be set from the keyboard.  However, you 
  47. can mark a register and capture it's contents on the clipboard with a 
  48. Ctrl-Insert. 
  49.  
  50.  
  51. ΓòÉΓòÉΓòÉ 1.2. Shift Function Keys ΓòÉΓòÉΓòÉ
  52.  
  53. Directly below the registers are four shift function keys.  These are not 
  54. particularly useful on a desktop calculator and are intended to demonstrate the 
  55. shift functions available in the BCD Class.  The keys are: 
  56.  
  57. Key            Description 
  58.  
  59. <<n            Shift Accum left n places.  The contents of the Accumulator are 
  60.                shifted left by the amount specified in the Entry register.  The 
  61.                BCD Class will not allow significant digits to be shifted out of 
  62.                the Accumulator to the left. 
  63.  
  64. >>n            Shift Accum right n places.  The contents of the Accumulator are 
  65.                shifted right by the amount specified in the Entry register. 
  66.                Unlike shift left, the BCD Class will allow you to shift right 
  67.                up to 32 digits regardless of the contents of the Accumulator. 
  68.  
  69. >>n, Rnd       Shift Accum right n places and round.  Five is added to the nth 
  70.                position before it is shifted out of the Accum.  If the nth 
  71.                digit was >= 5, the result in the Accum is increased by one. 
  72.  
  73. >>n, Cpld      Shift Accum right n places and place the shifted digits into a 
  74.                "coupled" register.  For the purposes of this demo, I am using 
  75.                the Entry register to keep the digits shifted out of the 
  76.                Accumulator.  The same result can be obtained by doing a modulus 
  77.                to get the right-most digits and a divide to get the left. 
  78.                Shift Right Coupled on the other hand, produces both results in 
  79.                a single operation without using the divide algorithm and is 
  80.                therefore much faster. 
  81.  
  82.  
  83. ΓòÉΓòÉΓòÉ 1.3. Conventional Keys ΓòÉΓòÉΓòÉ
  84.  
  85. The keys below the shift functions are a set of conventional calculator keys: 
  86.  
  87. o Numeric key pad. 
  88. o Delete key which removes the last digit entered. 
  89. o Arithmetic function keys. 
  90. o A += key which clears the Entry register after adding it's contents to the 
  91.   Accumulator. 
  92. o The Memory +,-,Clear and Recall keys. 
  93. o Clear/Clear Entry keys. 
  94.  
  95.  
  96. ΓòÉΓòÉΓòÉ 1.4. For Further Information ΓòÉΓòÉΓòÉ
  97.  
  98. For further information on the BCD Class please contact: 
  99.  
  100. Bill Connors 
  101. JBC Enterprises, Inc. 
  102. (301)330-8223 
  103. CompuServe: 73124,1260 
  104.