|  | pilotsoft.com

> BinCalc for PalmPilot - User's Guide
> Copyright 1997 - Scotts Valley Software Group - All Rights Reserved
> Updated 30 May, 1997

|  | Background

> BinCalc is a calculator designed for computer software and hardware engineers. BinCalc works with binary numbers of 8, 16, 32 and 64 bits in length. Numbers are either unsigned or two's complement. Numbers can be entered and displayed in base 2, 8 , 10 and 16. Operationally, BinCalc uses Reverse Polish Notation (RPN). BinCalc contains a 5 element stack (including the display) and 10 elements of memory.

|  | Main Form

> This is BinCalc's main form. This form is divided into three areas, the control area at the top of the screen, the display area where the number is displayed, and the keypad where numbers are entered.

> There are three controls in the control area:

- The base selector is on the left. Use the base selector to choose the base that is used to enter and display numbers. The currently selected choice (in this case 16) is highlighted.
- The word size selector is in the middle. Use word size selector to choose the size of the words that BinCalc operates on. The choices are 8 bits, 16 bits, 32 bits and 64 bits. The currently selected choice (in this case 64 Bits) is shown. Tapping the word size selector displays a list of allowable choices. When converting to a larger word size, the sign extension is controlled by the state of the sign selector.
- The sign selector is on the right. Use the sign selector to choose whether or not the words are treated as 2's complement signed (2's) or unsigned (uns). The sign selector controls whether sign extension is performed conversion to larger word sizes, and for right shifts. It also controls the interpretation of numbers entered in base 10

> The display area shows the number in stack position 0. When the base is 2 and the word size is 32 or 64, the display area also contains controls to scroll the number on the display. For base 2 the bit numbers (bit 0 is the least significant bit) is also displayed in order to give the display some context.

> The keypad is the primary means of operating BinCalc. A single key labeled either 'Alt' or 'Nrm' changes the behavior of the key pad (referred to as 'Alt' mode and 'Normal' mode). The first picture shows the keypad's appearance in 'Normal' mode. This picture shows the keypad's appearance in 'Alt' mode.

|  | Operations

> BinCalc is a Reverse Polish Notation (RPN) Calculator with 5 stack registers and 10 memory registers.

> Stack registers are called "Stack[0]" through "Stack[4]". The number displayed by BinCalc is the contents of Stack[0].

> Operations that require a single operand (eg. NEG) use Stack[0]. The contents of the other stack registers is not changed with single operand operations.

> Operations the require two operands (eg '+') use Stack[0] and Stack[1] and the result is saved in Stack[0]. The other stack registers are moved down to fill the space left in Stack[0].. For example, consider the '+' operation. The following pictures show the stack registers before and after a '+' operation.

> Before: After:

> The keys have the following meanings:

0-9, A-F
  Enter a digit into the current number. Digits are entered in most significant digit first order. Digits can also be entered through the Graffiti pad.
ENT
  Push a number onto the stack. Stack[3] is moved to Stack[4], Stack[2] is moved to Stack[3], Stack[1] is moved to Stack[2], and Stack[0] is moved to Stack[1]. Stack[0] is left empty. While Stack[0] is empty, the contents of Stack[1] are displayed. This prepares the calculator for the next number.
+
  Addition. Stack[0] is added to Stack[1].
-
  Subtraction. Stack[0] is subtracted from Stack[1].
*
  Multiplication. Stack[0] and Stack[1] are multiplied together. Any bits that overflow the current word size are lost.
/
  Division. Stack[1] is divided by Stack[0].
MOD
  Modulus. The remainder left when Stack[1] is divided by Stack[0].
+/-
  Arithmetic negation. Stack[0] is replaced with it's additive inverse.
NOT
  Logical negation. Stack[0] is replaced with it's bit wise logical negation.
AND
  Logical AND. The bit-wise logical AND of Stack[0] and Stack[1].
OR
  Logical OR. The bit-wise logical OR of Stack[0] and Stack[1].
XOR
  Exclusive OR. The bit-wise exclusive OR of Stack[0] and Stack[1].
>>n
  Right Shift. Stack[1] is shifted right by Stack[0] bits. If the current sign type (see sign selector) is signed, then the result is sign extended. If the current sign type is unsigned, then the result is not sign extended.
<<n
  Left shift. Stack[1] is shifted right by Stack[0] bits.
CLR
  Set all of the elements in the stack equal to zero.
CLx
  Set Stack[0] to zero.
SWP
  Swap Stack[0] and Stack[1].
Alt/Nrm
  Toggle the keyboard mode.

> The following keys are active in 'Alt mode:

SBn
  Set a bit in Stack[1]. The bit number is contained in Stack[0]. The least significant bit is numbered bit 0.
CBn
  Clear a bit in Stack[1]. The bit number is contained in Stack[0]. The least significant bit is numbered bit 0.
STO
  Store Stack[0] into memory. The next key entered is interpreted as the the memory cell number (See Memory) and must be in the range 0-9. While waiting for memory cell number, an indicator is displayed in the display area. Any key other than 0-9 will cause an error sound. The memory indicator is cleared and the unexpected key is ignored.
RCL
  Load Stack[0] from memory. The next key entered is interpreted as the the memory cell number (See Memory) and must be in the range 0-9. While waiting for memory cell number, an indicator is displayed in the display area. Any key other than 0-9 will cause an error sound. The memory indicator is cleared and the unexpected key is ignored
MEM
  Go to the memory screen.
STK
  Go to the stack screen.

|  | Menu Functions

> BinCalc contains a number of functions that are accessed through the menu bar. There are three menus available from the BinCalc menu bar.

> ### Display Menu

> The display menu contains functions that display the calculators state in various ways. The display menu functions are:

- Memory (M). Bring up the memory control form (see Memory section).
- Stack (S). Bring up the stack control form (see Stack section).
- ASCII (A). Bring up the ASCII display form (see ASCII section).
- Number Name (N). Bring up the number name form (see Number Name section).

> ##

> ### Edit Menu

> The edit menu contains function that interact with the system clipboard. The edit menu functions are:

- Copy (C). Copy the contents of the display to the system clipboard.

> ### Options Menu

> The options menu contains functions that control the optional operation of BinCalc. The functions available on the options menu are:

- About (A). Display information about BinCalc. Online help is available from the information icon on the 'About' form.
- Register (R). Display information about registering BinCalc (see Registration).

|  | Stack

> The Stack Form is used to display the contents of the stack. The Stack Form also allows the values in the stack to manipulated. Stack manipulations are controlled with the buttons on the stack form. Items on the stack are numbered from 0 to 4 with 0 being number currently displayed. The following buttons are defined on the stack form.

- Clear. Set all of the numbers in the stack to 0.
- Copy. Copy the currently selected number to the display. The number that was displayed before this operation is lost.
- Move. Move the currently selected item to the display. The numbers following the selected number are moved to fill the vacated space. The last item in the stack is set to 0.
- Swap. Swap the currently selected number with the displayed number.
- Rotate. Rotate the numbers in the stack.The displayed number in position 0, is moved to position 1, the number in position 1 is moved to position 2, etc. The number in position 5 is moved into the display.
- Done. Return to keypad.

> When the Stack Form comes up, the displayed number is selected. New numbers on the stack can be selected either by tapping the new number with the pen, or by moving the selector through the stack with the up and down buttons.

> ##

|  | Memory

> The Memory Form is used to display the contents of memory. The Memory Form also allows the contents of memory to be manipulated. Memory manipulations are controlled with buttons on the memory form. Items in memory are numbered from 0 to 9. The following buttons are defined on the memory form.

- Store. Copy the current displayed number into the selected memory cell.
- Recall. Copy the number in the currently selected memory cell to the display.
- Done. Return to the keypad
- Clear. Clear all memory elements.

> The Store button is only displayed when a memory cell is selected. The Recall button is only displayed when the selected memory cell is non-empty.

> Individual memory cells are either empty or they contain a number. Numbers in memory retain the word size and sign configuration they had when they were stored. Except for base 2, numbers also retain the base that was defined when they were stored. For numbers stored in memory when base 2 is selected, base 16 is stored in memory.

> Numbers in the memory list are displayed in the following format:

> <cell>:<sign><size><base>=<number>

> Where <cell> is the memory cell number, <number> is the number stored, <sign> is sign configuration of the number ('S' means signed, 'U' means unsigned), <size> is the word size of the number ('8', '16', '32', or '64'), and <base> is the base of the number ('o' for octal [base 8], 'd' for decimal [base 10], and 'h' for hexadecimal [base 16]).

> For example, the entry:

> 4:U32o=256

> means cell 4 contains the unsigned 32 bit octal number 256.

> Memory cells are selected by tapping the desired memory cell. Memory cells can also be selected with the up and down keys.

> ##

##

|  | Number Name

> The Number Name form calculates the name and the prefix for the number in the display. This form is meant to give context to the very large integers that are possible in 64 bits. The Number Name form displays two approximations for the number, one where 1K=1024 which is common among digital engineers and computer scientists, and another where 1K=1000 which is common among everyone else.

##

|  | ASCII

> The ASCII Form is used to display the 7 bit USA ASCII translation for the number currently in the display. Non printable characters are displayed as periods ('.').

|  | Registration

> BinCalc 1.0 is distributed in evaluation form. This means that you have a chance to try BinCalc before you decide to pay for it. Until BinCalc is registered it will display the following behavior:

- The label '* unregistered *' will show in the display area.
- The Register Form will appear occasionally after pressing an operation key

> BinCalc is registered for each Palm Pilot it runs on. When you register BinCalc you provide the HotSync user name for the Pilot that you are going to run BinCalc on . Your HotSync user name is displayed on the Registration Form for your convenience. Once you register, you will receive an eight character registration key. Enter this key in the 'Key:' field of the registration form and press the 'Register' button.

> Details about registering BinCalc are included in the BinCalc distribution. Details about registering BinCalc can also be found at http://www.pilotsoft.com.

Copyright 1997 - Scotts Valley Software Group - All Rights Reserved