home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
develop
/
calcprg
/
calc.doc
< prev
next >
Wrap
Text File
|
1995-02-27
|
9KB
|
277 lines
Calc 37.302
by
Douglas Keller
Copyright 1993 Synthetic Technologies
February 28, 1993
0. Introduction
----------------
Calc is a RPN programmers calculator with only integer support, it
does not support floating point numbers. It is unique in that it
displays four bases at the same time, binary, octal, decimal, and
hexadecimal. It supports the basic integer arthritic like addition,
subtraction, multiplication, division, and modulus. It also supports
all the basic logical arthritic like shift, and, or, xor, and not.
Calc requires AmigaDOS 2.0 and has been tested with Enforcer and
Mungwall.
1. Contents
------------
Calc - Calc executable.
Calc.info - Icon for Calc.
Calc.doc - Doc file for Calc.
2. Command Line Options
------------------------
P=PUBSCREEN/K,F=FRONTSCREEN/S,FORCEFRONT/S:
P=PUBSCREEN/K - Pubscreen lets you specify a public screen to open
Calc on.
F=FRONTSCREEN/S - Frontscreen lets you open Calc on the front most
screen, if it is a public screen.
FORCEFRONT/S - Forcefront lets you open Calc on the front most
screen even if the screen is NOT a public screen.
This can be kind of nasty to the front
screen that is why it is an option.
3. Window Layout
-----------------
Calc's window is made up of two parts, the Display Area and the
Keyboard Area.
3.1 Display Area
-----------------
On the top of the window is the display area that looks like this:
.----------------------------------------.
| bin 0000 0000 ... 0000 0000 | 3: 0 |
|------------------------------|---------|
| oct 0 | 2: 0 |
|------------------------------|---------|
| dec· 0 | 1: 0 |
|------------------------------|---------|
| hex 0000 0000 0000 0000 | 0: 0 |
`----------------------------------------'
There are four text areas labeled bin, oct, dec, and hex. Each one
displays the current number in the respective base, they can be
selected with the mouse to select the base. The current input base is
shown in the highlighted text color and with a small box after the
base name. The current input base can also be changed from the menus.
To the right is the stack which is used like any standard RPN
calculator.
3.2 Keyboard Area
------------------
Below the display area are the keys which look like this:
Drop | & « » / *
Clr a b 7 8 9 -
Swap c d 4 5 6 +
Undo e f 1 2 3
± % ^ ~ 0 . E
Drop/<= - The drop gadget displays either drop or a <= (backarrow).
It is a backarrow while a number is being entered and it is
drop once enter has been pressed. When it is a backarrow it
will delete the last entered digit. When it is drop it will
drop the bottom level off the stack and bring each level
down one. The keyboard equivalent of this gadget is the
backspace key.
Clr - The clr gadget will clear the entire stack. They keyboard
equivalent of this gadget is the spacebar.
Swap - The swap gadget will swap the bottom two levels of the
stack, levels zero and one. The keyboard equivalent of this
gadget is the 's' key.
Undo - The undo gadget will undo the last operation. Since it
undoes the last operation, if undo is pressed twice the
original stack will be restored. The keyboard equivalent of
this gadget is the 'u' key. This gadget is the same as the
undo menu item in the Edit menu.
± - The ± (plus/minus) gadget will toggle the current number
between the positive and negative state. This gadget will be
disabled if Calc is in unsigned mode, see the Options menu
for changing between signed and unsigned mode of the
calculator. The keyboard equivalent of this gadget is the
'p' key.
% - The % gadget performs the modulus operation on the bottom
two levels of the stack. The keyboard equivalent of this
gadget is the '%' key.
| - The | gadget performs a logical OR between the bottom two
levels of the stack. The keyboard equivalent of this gadget
is the '|' key.
& - The & gadget performs a logical AND between the bottom two
levels of the stack. The keyboard equivalent of this gadget
is the '&' key.
^ - The ^ gadget performs a logical exclusive OR between the
bottom two levels of the stack. The keyboard equivalent of
this gadget is the '^' key.
~ - The ~ gadget performs a logical complement of the current
number. The keyboard equivalent of this gadget is the '~'
key.
« - The « gadget performs a logical shift left of the current
number. The keyboard equivalent of this gadget is the '('
key.
» - The » gadget performs a logical shift right of the current
number. The keyboard equivalent of this gadget is the ')'
key.
/,*,-,+ - These gadget perform integer arithmetic on the bottom two
levels of the stack. There keyboard equivalents are the same
as there symbol.
If there an overflow these operations will appear to do
nothing. For example if the current mode is unsigned byte
where the valid range of numbers are 0 to 255, and 250 + 6 is
entered it will do nothing. Maybe this should be changed to
do the operation all the time and somehow show that overflow
has occurred.
E - The E gadget is the standard enter key found on RPN
calculators. The keyboard equivalents of this gadget are
the Enter and the Return keys.
. - The . gadget cycles through the input bases; binary, octal,
decimal, and hexadecimal. The input base can also be
changed by clicking on the display area or using the Input
Base Item in the Options menu. The keyboard equivalent of
this gadget is the '.' key.
0,1,2, - These gadgets are used to enter digits for the current
3,4,5, number. Some of these gadgets might be disabled depending
6,7,8, on the current input base. For example in binary mode only
9,a,b, the 0 and 1 gadgets will be enabled.
c,d,e,
f
3.3 Other keys
---------------
The arrow keys can be used to move Calc's window around, they will
move the window twenty pixels in appropriate direction.
If shift is held down when an arrow is pressed the window is moved to
edge of the screen.
The escape key will cause Calc to quit. When Calc quits, it saves the
stack and the current state of the calculator to a file called
'env:calc'. When Calc is run again it will read 'env:calc' so it will
have the same stack and be in the same state as when it exited. This
is the same as the Quit menu item.
4. Menus
---------
Calc has the following menus:
Project Edit Options
About Cut Input Base
Quit Copy Binary
Paste Octal
Undo Decimal
Hexadecimal
Word Size
Byte
Word
Long
Sign
Signed
Unsigned
4.1 Project Menu
-----------------
About A-? - Shows a little about Calc.
Quit A-Q - Quits Calc, the escape key can also be used to quit Calc.
4.2 Edit Menu
--------------
Cut A-X - Cut will cut the current number to the clipboard in the
format of the current base.
Copy A-C - Copy will copy the current number to the clipboard in the
format of the current base.
Paste A-V - Paste will paste from the clipboard to the current number
Undo A-Z - Undo will undo the last operation. This is the same as
the undo gadget.
4.3 Options Menu
-----------------
Input Base - This is used to select the input base. The current input
base is shown in the highlighted text color and with a
small box after the base name. The current input base
can be changed by selecting the input base with the
mouse. The valid input bases are:
Binary A-2 - base 2
Octal A-O - base 8
Decimal A-D - base 10
Hexadecimal A-H - base 16
Word Size - This is used to select the word size. The word size can
be byte, word, and longword.
Byte A-B - 8 bit
Word A-W - 16 bit
Longword A-L - 32 bit
Sign - This is used to select between signed and unsigned mode.
Signed A-S
Unsigned A-U
5. Legal junk
--------------
Permission is granted to distribute this program and its documentation
for non-commercial purposes as long as the copyright notices are not
removed. This program may not be distributed for a profit without
permission from Doug Keller. Fred Fish has permission to distribute
this program as part of the Fred Fish library.
7. Bugs and Info
-----------------
If you would like to get in touch with me I can be reached on the
following:
Bix : dkeller
Internet: dkeller@vnet.ibm.com