Programmer's Calculator 100 Version 1.0 --------------------------------------- Introduction Progcalc is a programmer's calculator for the HP100/HP200 LX palmtop computers. It can read and display numbers in binary, octal, decimal, internet, hexadecimal, and ASCII notations and perform many functions using no-precedence infix notation (like a four function calculator). The calculator has 10 memory registers for storing results or operating upon. 1. Package Contents The package contains the following files. As a minimum only progcalc.exm needs to be installed on the system (possibly with the progcalc.icn icon file). readme This file progcalc.icn Program icon progcalc.exm Program executable (System Manager compliant) 2. Program Installation The program is system manager compliant and must therefore be added to the manager's list of programs using the "Application Manager" (&..., File, Application, Add). The program is started using a hot-key, or via the Application Manager. The program stores the register contents and its environment into the file _dat\progcalc.env 3. Program Usage Most functionality is evident from the program menus. Letter case is not significant except when entering values in ASCII mode. The calculator operates like most simple calculators using two registers. Register X is the value being entered. As soon as an operator (+-* etc.) is typed register X becomes register Y and the next value can be entered in register X. When the next operator or '=' is typed X and Y are combined using the previous operator and the result is put into register X. All immediate commands operate directly on register X. After an infix operation pressing the '=' key again results in the repetition of the operation using the current X and the previous Y values. If all this sounds confusing do not worry. It is just a description of simple four function calculators. Numbers are always entered and displayed using the current number base. The program will not allow the entry of a number that would overflow a 32 bit word. All operations are performed on unsigned 32 bit words. It is possible however to display the numbers interpreted in two's complement notation (the usual negative number representation). Overflow is silently ignored, division by 0, and logarithm of 0 result in an error beep. A summary of all commands follows. 3.1 Infix operators These operators are entered between two operands. For example 45<2 will shift the value 45 two places to the left. Key Function --- -------- + Addition - Subtraction * Multiplication / Division % Remainder & Bit and | Bit or ^ Bit exclusive or < Shift left > Shift right { Rotate left } Rotate right 3.2 Immediate operators These operators operate directly on the current entry value (X). For example pressing L when entering a number will convert it to its negative value. Key Function --- -------- ~ Negate bits L Change sign (using two's complement notation) G Base 2 logarithm S Endian swap (Intel x86 to Motorolla 680x0) R Reverse bits (bit 0 becomes 31, 31 becomes 0) I Count 1 bits O Count 0 bits 3.3 Other commands Key Function --- -------- ENTER/= Evaluate DEL/ESC Clear the current X and Y registers Backspace Delete last character F1 Change number base to binary F2 Change number base to octal F3 Change number base to decimal F4 Change number format to 32-bit internet address notation F5 Change number base to hexadecimal F6 Change number base to ASCII F7 Swap display format between signed and unsigned F8 Swap the contents of the X and Y registers F9 Store current value to memory (register 0) F10 Set current value from memory (register 0) N Store to memory register N Operate current value with memory register M Recall from memory register 4. Author Contact The program has been written by: Diomidis Spinellis Myrsinis 1 GR-145 62 Kifissia GREECE E-mail: D.Spinellis@senanet.com 5. Copyright and Disclaimer Copyright (c) 1995,96 Diomidis Spinellis. All rights reserved. Redistribution and use in binary form, without modification, is permitted provided that the following conditions are met: 1. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 2. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. 3. Redistribution for profit is not allowed. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.