home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
bcdclass.zip
/
BCDCALC.INF
(
.txt
)
< prev
next >
Wrap
OS/2 Help File
|
1995-09-25
|
5KB
|
104 lines
ΓòÉΓòÉΓòÉ 1. BCD Calculator Overview ΓòÉΓòÉΓòÉ
The BCD Calculator is a simple four-function desktop calculator that is
intended to demonstrate the facilities and functions of the BCD Class object.
The calculator resembles other Windows and PM Calculators with a keypad and
standard arithmetic function keys. The big difference is that it operates on
integers of up to 32 decimal digits in length.
Since this version does not have floating point, you probably wouldn't want to
replace your favorate desktop calculator. Besides, I can't imagine anyone
needing 32 digit arithmetic to balance their checkbook, even in countries with
currencies that have very small unit values.
ΓòÉΓòÉΓòÉ 1.1. Registers ΓòÉΓòÉΓòÉ
Three registers are displayed at the top of the calculator:
o Memory
o Accumulator
o Entry
The registers are more or less conventional except that all three are
displayed. The Memory register is set from the Accumulator and Memory Recall
returns it's data to the Entry register. The Accumulator is set as a result of
some process on data from the Entry register.
ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇSh Right CpldΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
Γöé ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
ΓööΓöÇ>Γöñ Γöé Γöé Γö£ΓöÇΓöÇΓöÿ Γöé Γöé
KeyPadΓöÇΓöÇΓöÇ>Γöñ Entry Γö£ΓöÇΓöÇΓöÇΓöÇ>Γöñ Accum Γö£ΓöÇΓöÇΓöÇΓöÇ>Γöñ Memory Γö£ΓöÇΓöÇΓöÉ
ΓöîΓöÇΓöÇ>Γöñ Γöé Γöé Γöé Γöé Γöé Γöé
Γöé ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ Γöé
ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇMemory RecallΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
The Entry register is set from the keyboard, from a memory recall, or from the
low-order digits from the accumulator on a Shift Right-Coupled operation. The
Entry register has a "constant" capability such that its contents will be
retained after an arithmetic function key is pressed so that you can add,
(e.g.), the same value to the Accumulator multiple times. The Entry register
will clear after the += key is pressed or if a numeric key is pressed signaling
the entry of a new value.
The registers are read only and cannot be set from the keyboard. However, you
can mark a register and capture it's contents on the clipboard with a
Ctrl-Insert.
ΓòÉΓòÉΓòÉ 1.2. Shift Function Keys ΓòÉΓòÉΓòÉ
Directly below the registers are four shift function keys. These are not
particularly useful on a desktop calculator and are intended to demonstrate the
shift functions available in the BCD Class. The keys are:
Key Description
<<n Shift Accum left n places. The contents of the Accumulator are
shifted left by the amount specified in the Entry register. The
BCD Class will not allow significant digits to be shifted out of
the Accumulator to the left.
>>n Shift Accum right n places. The contents of the Accumulator are
shifted right by the amount specified in the Entry register.
Unlike shift left, the BCD Class will allow you to shift right
up to 32 digits regardless of the contents of the Accumulator.
>>n, Rnd Shift Accum right n places and round. Five is added to the nth
position before it is shifted out of the Accum. If the nth
digit was >= 5, the result in the Accum is increased by one.
>>n, Cpld Shift Accum right n places and place the shifted digits into a
"coupled" register. For the purposes of this demo, I am using
the Entry register to keep the digits shifted out of the
Accumulator. The same result can be obtained by doing a modulus
to get the right-most digits and a divide to get the left.
Shift Right Coupled on the other hand, produces both results in
a single operation without using the divide algorithm and is
therefore much faster.
ΓòÉΓòÉΓòÉ 1.3. Conventional Keys ΓòÉΓòÉΓòÉ
The keys below the shift functions are a set of conventional calculator keys:
o Numeric key pad.
o Delete key which removes the last digit entered.
o Arithmetic function keys.
o A += key which clears the Entry register after adding it's contents to the
Accumulator.
o The Memory +,-,Clear and Recall keys.
o Clear/Clear Entry keys.
ΓòÉΓòÉΓòÉ 1.4. For Further Information ΓòÉΓòÉΓòÉ
For further information on the BCD Class please contact:
Bill Connors
JBC Enterprises, Inc.
(301)330-8223
CompuServe: 73124,1260