******* NAC ******* Programmer's calculator Version 1.1 Copyright Eric Malafeew ************ OVERVIEW ************ NAC (Not Another Calculator) is an integer calculator designed for programmers who work with addresses, bitmasks, and integer math. Features: - Hexadecimal, decimal, and binary modes - Selectable word size and sign - HP-compatible RPN behavior - Programmable buttons and storage registers - Useful bitwise and integer operations Requirements: Palm OS 2.x/3.x, 10K memory License: Freeware Contact: ktelmagic@yahoo.com ************* OPERATION ************* NAC uses Reverse Polish Notation (RPN) like the HP-10C series calculators. Values are entered onto a stack, and operations combine stack values. The NAC stack has 4 registers: Register Description T Entered before Z (hidden) Z Entered before Y (hidden) Y Entered before X (hidden) X Current entry or latest result (always displayed) Pushing the stack makes T = Z, Z = Y, Y = X. Popping the stack makes Y = Z, Z = T. Find more help with RPN at http://www.hpmuseum.org/rpn.htm#learn. NAC also has 16 storage registers, and 4 programmable buttons that can replay up to 32 button presses. Press h, d, or b to switch between hexadecimal (base 16), decimal (base 10), and binary (base 2) modes. Only decimal mode displays negative values with a sign. Hexadecimal mode results are padded with zeros to the selected word size. Select word size and sign from the menu: Word Description char signed 8 bits uchar unsigned 8 bits short signed 16 bits ushort unsigned 16 bits long signed 32 bits ulong unsigned 32 bits NAC remembers all of your settings and values between runs. *********** BUTTONS *********** Button Description f toggle extra buttons + add X and Y, pop the stack - subtract X from Y, pop the stack x multiply X and Y, pop the stack / divide X from Y, pop the stack X:Y swap X and Y BSP backspace 0 - F enter digit, push the stack if new value ENT push the stack & bitwise-and X and Y, pop the stack | bitwise-or X and Y, pop the stack ~ bitwise-not X ^ bitwise-xor X and Y, pop the stack << left-shift Y by X bits, pop the stack >> right-shift Y by X bits, pop the stack MOD modulus of Y against X, pop the stack ALN align X to next multiple of Y, pop the stack CHS change sign of X MSK make bit-mask of X bits SBZ set Y left-shifted by X bits into Z, pop the stack twice CBZ clear Y bits left-shifted by X bits from Z, pop the stack twice BZ? query Y bits left-shifted by X bits in Z, pop the stack twice CLR clear X STO store X to register 0 - F RCL push the stack, recall X from register 0 - F UND undo last stack operation RDO redo last stack operation REC record following button presses to F1 - F4 F1 - F4 replay recorded button presses up roll the stack up down roll the stack down *********** CHANGES *********** Version 1.0 - Initial release Version 1.1 - Added binary mode - Changed SB (set-bit) to SBZ (set-bits) - Changed CB (clear-bit) to CBZ (clear-bits) - Changed B? (query-bit) to BZ? (query-bits) - Fixed display overflow from leading zeros - Move ROL (roll-down) to down key - Added roll-up to up key - Changed CHS (change-sign) location - Added CLR (clear) - Renamed RMD (remainder) to MOD (modulus) - Added STO (store) and RCL (recall) with storage registers - Added REC (record) and F1 - F4 (functions) - Added UND (undo) and RDO (redo) - Renamed to NAC (was xCALC) *********** LICENSE *********** The disassembly or reverse engineering of this software is prohibited. THIS SOFTWARE IS PROVIDED FOR FREE "AS IS", WITHOUT WARRANTY, MAINTAINANCE, OR SUPPORT OF ANY KIND, EXPRESSED OR IMPLIED. IN NO EVENT SHALL ERIC MALAFEEW BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM, OR IN CONNECTION WITH, THIS SOFTWARE. ******** TODO ******** - Support clipboard - Bitmap icons & text - Faster redraw of extra buttons