Copyright: Excalibur - Copyright 1998 David Bernazzani


Contents
Excalibur For Windows - v1.05

EXCALIBUR was written to create a full featured RPN calculator for Windows.  It is an exclusively RPN calculator designed for ease of use and quick results.  For a full description on how to use the RPN notation with this calculator see the RPN Quick Start Guide in this document.

Although using the RPN notation greatly facilitated the programming effort, that was not the reason it was chosen.  I fully believe that RPN notation is superior to the more common algebraic notation for long or complex equations.  I also feel that, given some practice to undo the old method, this method is more natural and more similar to how you would work out an equation given just a pencil and paper (more on this in the RPN Keypad and Stack Usage section).  I hope that using the RPN notation has not turned any potential users from trying this tool and I think the small effort in learning RPN may be worth the investment.  Learning RPN does not mean that you will forget how to use other calculators which use the standard algebraic notation but will give you the ability to use either variety with ease.

Use the Contents button in this help program to see a list of all features of Excalibur or use the << and >> buttons to move through the Excalibur help one topic at a time.  And be sure to read the disclaimer.

If you find a bug in this program or just want to let me know you enjoyed using Excalibur, please email me at dber@tiac.net or drop by my homepage at www.tiac.net/users/dber for the newest version.  If you contact me, please include your Excalibur version number and whether you use the 16 or 32 bit version.


Basic Operations (RPN Quick Start Guide)

This section describes how operations and calculations take place in Excalibur.  It is intended that after you read this section you will have enough knowledge to work both basic and more advanced equations in Excalibur with a minimum of difficulty.  Excalibur does not use more conventional "algebraic" notation like many low-end calculators on the market.  Instead it uses the high-powered parenthesis-free RPN notation (Reverse Polish Notation).  This notation was named in honor of a Polish mathematician and logician named Jan Lukasiewicz.  Polish notation places the operators in an expression before the numbers.  RPN places them after the numbers (which is why they call it Reverse Polish Notation).

RPN is really nothing more than the method of entry of numbers and operators into the calculator.  For example, to compute the following "algebraic" expression:

3*4+5=

You would enter 3 4 * 5 +

The operands are simply inserted after the numbers are entered.  On an RPN calculator, we use a key typically labeled ENTER to separate two numbers.  This whole method works because of something we call the "Memory Stack" which are place holders for the numeric entries before any operators are used.  Even some of the best algebraic calculators break down into the simpler and more consistent RPN mode when it comes to unary operators.  Very rarely do you enter SIN(90).  More often you enter 90 and hit the SIN key (in this case since you hit SIN after the number you have preformed an RPN calculation)  RPN simply takes it a step further by being more consistent and using this entry method for virtually all of the calculators functions.  For longer calculations, you will be amazed at how much control you feel when entering the numbers and producing the results.  Some of the most difficult chain calculations are daunting with an algebraic calculator but are easy work for an RPN one.  Notice that there are no parenthesis on an RPN calculator - they are not needed.  Precedence is handled by the stack and by how you enter the numbers into the calculator.

The Memory Stack

The automatic memory stack is at the heart of all calculations in this (or any) RPN calculator.  It provides for an efficient storage of intermediate results during complex equations and allows for easy visualization of where your entered numbers are stored.

The automatic memory stack is shown as follows (class 4-level stack is shown, Excalibur allows for a bigger stack if desired):

T	0	Oldest register
Z	0
Y	0
X	0	Newest or Current register

Values which you are currently entering are placed in the X register.  Older values have been pushed up the stack to Y, Z or T.

Here is an example which will fill in the stack with a desired set of numbers:

(1)	Press the CLS button to clear out all of stack memory.  The stack will look like the table above with zeros for all elements.

(2)	Press the following digit keys:  157. The stack display should look as follows:

T	0	Oldest register
Z	0
Y	0
X	157_	The underscore tells you current edit position

(3)	Press the ENTER key.  This separates one number on the stack from another number. The old value is pushed up the stack to the Y register and makes room for a new entry on the X register.  The stack will look as follows:

T	0	Oldest register
Z	0
Y	157	Pushed value
X	157	Last value is copied to the X register

(4)	Notice the X register has the same value as the Y register.  This is done for convenience since you may want to do something with the value in both registers.  However, if you now press any digit key the new number will automatically replace the X register contents.

(5)	Press the following digit keys:  90.5  This will enter a new value in the X register.  The memory stack looks as follows:

T	0	Oldest register
Z	0
Y	157	Pushed value
X	90.5_	New value is being entered here

(6)	Again, press ENTER to force a stack push so that a new number can be entered.

T	0	Oldest register
Z	157	Pushed value
Y	90.5	Pushed value
X	90.5	Room for new number

(7)	Press the following digit keys:  3.14  This will enter a new value in the X register.  The memory stack looks as follows:

T	0	Oldest register
Z	157
Y	90.5
X	3.14_	New value is being entered here

(8)	Again, press ENTER to force a stack push so that a new number can be entered.

T	157	Oldest register
Z	90.5
Y	3.14
X	3.14	Room for new number

(9)	Press the following digit keys:  50  This will enter a new value in the X register.  The memory stack looks as follows:

T	157	Oldest register
Z	90.5
Y	3.14
X	50_	New value is being entered here

(10)	You have now filled the stack with chosen numbers.  New numbers can be entered and the stack will continue to behave as you have seen here except that the contents of the T register will be pushed off the stack and are lost.  Only the last four values can ever be shown and used.

Now that you know how enter numbers on the stack its time to learn how to perform basic operations on those numbers.  See the summary of Numeric Entry to see all the forms of numeric entry then move onto the Addition/Subtraction/Multiplication/Division section of this help file to see how work with these numbers on the stack.


How to Enter Numbers

Basic Number Entry

Numbers are entered directly into the X register of the calculator.  To enter a number, simply start pressing numeric keys.  When you have finished entering the number, you can press an operator to perform some action (addition, multiplication, etc) or you can press ENTER to push this number up the stack (to the Y register) and start to enter a new number into the X register.  If this is confusing, better go back and read the Basics section.

Exponents

To enter a number with an exponent you must first enter the base (mantissa) part of the number.  Then press the E/EEX key to insert the "e+" exponent.  Then type the exponent.  For example, to enter 6.02e+23 you would enter the 6.02 first, then press the EEX key, then enter 23.

Change Sign

To change of a number in the X register, simply press the CHS (change sign) key.  To change the sign of an exponent you must do it as you enter the number.  After you hit the EEX key and before you finish entering the exponent, hit the CHS key to change the sign of the exponent.  For example, to enter 1.34e-12 you would first enter in 1.34 then press EEX.  Then you could press CHS and 12 to get the 1.34e-12 value to show in the X register.

Fractions

Fractions can be entered in two ways.  The most common way is to use the Frac key to separate the components of the fraction.  For example, to enter 5 and 3/8 you would enter 5, hit the Frac key, then hit 3 and hit the Frac key again and finally enter 8.  This will lead to the fractional display of 5~3/8

You can also use the decimal point to enter fractions.  To enter the same 5 and 3/8 using only the decimal point, you enter 5 then hit the decimal point to get "5." on the display.  Then enter the 3 and press the decimal point again and finally enter the 8.  The display will, once again, read 5~3/8.

Once a fraction is entered, pressing ENTER or any numeric operation key will automatically convert the fraction to its decimal equivalent.

Now you can move onto the Addition/Subtraction/Multiplication/Division section of this help file to see how work with these numbers on the stack.


Addition Subtraction Multiplication and Division

Basic math operations (Add, Subtract, Multiply and Divide) in an RPN calculator (like Excalibur) is easy.  First you need to get the two numbers you want on the stack.  See the Basics section if you don't already know how to do this.

Lets try Addition.  To add 13.3 and 45.3 we must first get those numbers on the stack.

T	0
Z	0
Y	45.3
X	13.3

We simply hit the + key on the keypad (or click the + key in the Excalibur window).  This will add the contents of the X and Y register.  The contents of the X and Y register will be popped off the stack (shifting T and Z down) for the addition.  The result of the addition will be pushed back on the stack.  After the addition operation, the stack will look as follows:

T	0
Z	0
Y	0
X	58.6

To illustrate this point further, if the stack looked as follows:

T	30
Z	20
Y	10
X	5

And addition is performed, the stack will look as follows:

T	30
Z	30
Y	20
X	15

As you can see, the X and Y registers are popped off the stack, the T and Z registers are shifted down (with the T register repeating to fill in the back end) and after the addition, the result of 15 is pushed back on the stack.  The pushing and popping to and from the stack is an important thing to remember about RPN calculators.  It can let you work out complex equations in little or no time.

Subtraction is exactly the same as addition.  X is subtracted from Y and the result pushed back on the stack.

Multiplication will multiply X and Y and push the result on the stack.

Division will divide X into Y and push the result on the stack.

Always remember, it's just like working out the equation on paper.  If you wanted to divide 8 by 2 you would write down 8.  Under that you would write down 2 and you would divide them.  Do the same with any RPN calculator.  Enter 8, enter 2 and hit the Divide key.  This is the basis for any calculations you will ever work out.

Some operations require two numbers (such as Addition, Multiplication, Subtraction and Division).  For these, you enter the two numbers in the X and Y registers.  Some operations are unary and only require a single number (such as Change Sign and Log) and for these only the X value is needed.  There are even some built in formulas which require 3 or 4 numbers in which case Z and T come into play.

The RPN calculator makes quick work of long chain calculations.  The trick is to remember what's on the stack (Excalibur makes it easy since you can see all four stack locations on screen).  The trick with long calculations is to work from the innermost set of parenthesis out and knowing the precedence of operations (multiply and divide before addition and subtraction).

For example, the equation 45.2 + (6 / 2.98) * 44.33

You would enter 6, enter 2.98 and press the Divide key.  Enter 44.33 (which pushes the result of the previous divide up to the Y register) and press the multiply key.  Once again, the result is in the X register.  Enter 45.2 and press the plus key.  The result is the final result of the equation above.


Menu Items Explained

File Menu

Settings	This menu item brings up a dialog box to display common Excalibur settings.  See the Settings page for more detail.
Program Usage Stats	Shows the number of pushes and pops to and from the RPN stack.  Also shows the number of minutes the Excalibur window has been in focus.
Define Custom Set	Brings up a dialog box to allow a custom set of keys to be configured.  These are saved to the EXCAL32.DAT file for use on future starts of the program.  There is also a list box containing all previously saved macros which can be linked to any open key.
Macro Manager	Brings up a window to allow the user to store the currently active macro to one of 100 named macro registers.  The user can also recall any macro into the current active macro (for use with the PLAY key).  A small list pane to the right of the main macro list shows the contents (key names) of the selected macro.
Exit	Exits the program (you can also use the standard window close button on the top of the frame.

Edit Menu

Copy X	The current X value is sent to the clipboard for pasting into your favorite application.  In programming mode it will copy the format shown on screen (that is - Decimal, Hex, Octal or Binary).
Copy All	The current X, Y, Z and T values are sent to the clipboard for pasting into your favorite application.
Copy Program	Copies the currently loaded program to the clipboard for pasting in an email or another application.
Paste	Pastes the contents of the clipboard to the X register.  Currently will only paste decimal numbers.  It will not paste correctly to the Hex, Octal or Binary modes.

Bank Menu

Scientific	Selects the Scientific function Bank.
Statistics	Selects the Statistical function Bank.
Business	Selects the Business function Bank.
Conversion	Selects the Conversion function Bank.
Comp Sci	Selects the Computer Science function Bank.
Geometry	Selects the Geometry function Bank.
Complex/Vector	Selects the Complex/Vector function Bank.
Physics	Selects the Physics function Bank.
Miscellaneous	Selects the Miscellaneous function Bank.
Program	Selects the Program Mode function bank.
Custom	Selects the Custom function Bank.  See Define Custom Set above in the File menu.
Always On Top	Instructs Excalibur to always remain on top of the current set of windows being displayed.

Help Menu

Excalibur Help	Displays this help file.
About Program	Excalibur version number and Copyright Information.


Precision Notes (Overflow and Underflow)

Currently, Excalibur for Windows uses an 8 byte IEEE floating point representation of all numbers. This means that it is approximately accurate to about 15 decimal places.  Because of the use of 8 byte IEEE floating point the numbers in Excalibur may not be as accurate as in a hand-held calculator.  In addition, the calculator only does a minimum amount of checking for overflow (numbers greater than the maximum or less than the minimum).  The 8 byte float limits for Excalibur are shown below:

DBL_MIN	2.2250738585072014e-308
DBL_MAX	1.7976931348623158e+308

In addition, for programming mode (assuming using full 32-bit word size) the maximum decimal value is:

ULONG_MAX 	4294967295

This floating point inaccuracy is evident when you use functions such as Floor, Ceil and Round.  Entering a number such as 3.9999999999999 and hitting Floor should yield 3 but will actually give 4 because of the precision inaccuracies inherent in floating point representation.   The precision should not be a concern for most users but it should be understood.

As stated in the disclaimer, this program has no guarantees associated with it.  If the precision (or lack thereof) is a problem for you, please discontinue use of Excalibur.


Key Shortcuts

Although all functions and digit entry can be carried out with the use of the mouse, a few keyboard shortcuts are used in Excalibur for those who wish to speed up their calculations:

Key 0-9	Enters the digit 0-9
Decimal Pt Key	Enters a single Decimal Point.  If pressed twice, it will enter a fraction.
Backspace	Erases the last typed character on the display (X Register).
Key C	Clear Stack
Key X	Exchange X and Y
Key +	Add
Key -	Subtract
Key *	Multiply
Key /	Divide
Key ENTER	Same as ENTER on the keypad.  Used to enter a number on the stack.
Key N	Change Sign (Negate)
Key E	Exponent
Key S	Store
Key R	Recall
Key L	Last X
Key M	Display Mode
Key H	Help Key
Key F	Last Function Bank
Key TAB	Clear X
Key UP	Rotate stack up.
Key DN	Rotate stack down.
F1-F10	First column of the currently selected function bank.
SHIFT F1-F10	Second column of the currently selected function bank.
CTRL F1-F10	Third column of the currently selected function bank.
CTRL-SHIFT F1-F10	Last  column of the currently selected function bank.
Ctrl 0 thru Ctrl 9	Using the Control key and the numeric key combination will allow quick selection of the number of decimal places you wish to show.  The display format must be either Sci, Fix or Eng (see Mode button).  If the calculator is in Std mode, it will be placed in Fix mode.
Ctrl-S	Settings Dialog
Ctrl-P	Program Usage Stats
Ctrl-D	Define Custom Set
Ctrl-A	Macro Manager
Ctrl-X	Exit
Ctrl-V	Paste X
Ctrl-C	Copy X


Basic RPN Key Layout
Main RPN Key Layout

The most basic keys in Excalibur are the number keys.  These consist of 0-9 and the decimal point.  These, along with the ENTER key allow any number to be entered into the calculator.

To the right of the digit entry keys are the 4 basic math operator keys: Addition(+), Subtraction(-), Multiplication(*) and Division(/).

To the right of these keys are three columns of frequently used keys.   These keys include:

Help	Press this key and you will see the work Help displayed in the status bar at the bottom of the program.  Click any other button in Excalibur and a short but useful description of the key will be shown (more information that the standard tool-tips).
X<>Y	Exchange the contents of the X and Y register.
+/-  or  CHS	Change sign of the value in the X register.
E or EEX	Exponent.  Used when entering a number with an exponent.  For example, 6.23E-03 could be entered by pressing 6.23 then the EEX key then the CHS key then 03.
STO	Store number to one of 26 internal registers.  These are save when the program terminates and are restored when Excalibur restarts.
RCL	Recall a number from one of the 26 internal storage registers.
C	Clear X register only.
CLS	Clear Stack.
R UP	Rotate stack up.  T wraps to X.
R DN	Rotate stack down.  X wraps to T.
Last X	Recalls the last value of X before the last operation took place.
Mode	Brings up the precision display mode dialog box.  Allows selection of Best Fit, Scientific, Engineering and Fixed format.  Up to 12 decimal places can be specified.  In addition, there is an option to specify the stack display as right-aligned as opposed to the default left-aligned.
BSP	Erase the last character typed in the X register (only works when you are entering a number – not after you have performed some operation).
Rec	Puts the calculator in Record mode.  The REC indicator should be shown in the status bar.  It will record all button presses (but not menu selections or dialog box inputs) until Rec is hit again.  Use Play to playback the buttons.  Used for Macro-style programming of the calculator.  Up to 200 button presses can be recorded (up to 100 button presses in the 16-bit version).
Play	Plays back the last recorded button sequence.
Larg	Recalls the last X and Y arguments to the stack previous to the last operation.  This will always return 2 arguments (X,Y).  If you only want the last X value, use the Last X key.
Drop	Drops the stack shifting contents down (Y to X, Z to Y, etc)
Edit	Puts the calculator back in Edit mode for the X register if not already there.
Sto A	Stores the current X value to the A register.  This is simply a shortcut key to avoid having to press STO and selecting the A register.
Rcl A	Recalls the A register.  A shortcut for RCL and selecting the A register.
Sto B	Stores the current X value to the B register.  This is simply a shortcut key to avoid having to press STO and selecting the B register.
Rcl B	Recalls the B register.  A shortcut for RCL and selecting the B register.
Notes	Brings up a quick scratchpad for storing up to 1000 characters.
Copy X	Copies the current X value to the Windows clipboard.
Frac	Inserts a fraction into the currently edited X value.  Pressing again will allow whole number and fractional entry.  For example, pressing 5 [FRAC] 3 [FRAC] 4 will enter an X value of 5 and 3/4

All of the above keys are always visible regardless of what function bank is selected (for example, Scientific, Business, Conversion, etc).


Tool Tips and Key Help

By default (you can turn it on and off in the Settings dialog box) each function key outside of the typical numbers and ordinary arithmetic operations has a tool tip associated with it.  If you rest the mouse cursor over a button, the tool tip will show in a small window below the mouse cursor.  The tool tip will tell you a the full name of the key (the key names are often abbreviated to save space).  If you want more help on how to use a particular key, you can click the Help button then click any button to get a better description for that key.  As a shortcut, you can right-click on any key for additional information (saves having to hit the Help key first).


Settings
Excalibur Settings

This File/Settings menu item brings up a dialog box to display common Excalibur settings.  The are:

Angle Mode:  Degrees, Radians, Gradients

Tax Constant: Constant for calculating Tax (see Business Key Layout)

Numlock: You can have the numlock key active on entry or you can tell Excalibur not to change the numlock state.

Comma Display: On or off.  Determines if you want commas shown on numbers greater than 1000.

Key Settings: For you die-hard HP fans you can have your choice of key labels for exponents and change sign.

Comma Format: Allows the user to swap decimal points and commas in the display.  This is done for some international users who require the XXX.XXX,yy format instead of the XXX,XXX.yy format.

Tool Tips: Configures tool-tips on or off.

Footprint:  The footprint setting determines how much screen space Excalibur requires when running.  The default layout is the most spacious.  You must restart Excalibur for the new layout to take effect.  Note - if you choose the X-Only footprint, there will be no standard Excalibur menu (this footprint is the smallest of the lot).  To access the Excalibur settings, you can choose "Excalibur Settings" from the title-bar system menu.  The "No Funcs" option is for those of you who do not require the specialized function bank (the 40 buttons to the right of the main keys).

Stack Options - This allows you to select the classic 4-level stack or the deeper 8-level stack (those stack values are off screen and are internally labled as A, B, C and D).  When the 8-level stack is chosen, some stack operations such as rotate up / rotate down and a few functions such as LCM and GCD still use the visible 4-level stack (which seemed most appropriate since these are operations carried out on the visible stack).  All other operations use the 8-level stack, if chosen.  In addition, traditionally the T register (in the 4-level stack) or the D register (in the 8-level stack) repeats when the stack is popped.  You can override this default behavior by selecting "Zero Fill Pop" which will fill a zero at the back end of the stack on a pop operation.  In addition, you can also select "Show X Min" to show the current X value when the main Excalibur window is minimized to the task bar.

Pause/Trace Delay - This controls the number of milliseconds (1000 milliseconds = 1 second) of delay between program trace steps (using FWD) and also how long the PAUSE command will wait.  This is only useful if you are programming Excalibur.


Function Bank Selection

To the right of the main keypad there are some radio-button selections which allow quick switching between the various Excalibur supported function banks.  They are:

Scientific	Selects the Scientific function Bank.
Statistics	Selects the Statistical function Bank.
Business	Selects the Business function Bank.
Conversion	Selects the Conversion function Bank.
Comp Sci	Selects the Computer Science function Bank.
Geometry	Selects the Geometry function Bank.
Complex/Vector	Selects the Complex/Vector function Bank.
Miscellaneous	Selects the Miscellaneous function Bank.
Physics	Selects the Physics function Bank.
Program	Selects the Program Mode function Bank.
Custom	Selects the Custom function Bank.

These function bank radio buttons will remain selected until you choose another function bank.


Scientific Functions

The scientific function bank is used to select a set of keys for work with scientific calculations.  The following functions are available with this layout:

Sine	Computes the Sine of X.
Cosine	Computes the Cosine of X.
Tangent	Computes the Tangent of X.
Hyperbolic Functions	Press this key then Sine, Cosine or Tangent to get Hyperbolic versions of these functions.
ArcSine	Computes the ArcSine of X.
ArcCosine	Computes the ArcCosine of X.
ArcTangent	Computes the ArcTangent of X.
Absolute Value	Computes the Absolute Value of X.
X Squared	Computes the square of X.
Square Root	Computes the square root of X.
Inverse (1/X)	Computes the inverse of X (which is 1/X).
10 ^ X	Returns 10 raised to the X power.
Exponential	Returns e.
Natural Log	Computes the natural log of X
Log Base 10	Computes the Log base 10 of X
Factorial	Computes the factorial of X.
Power	Raise Y to the X power.
INT	Returns the Integer portion of X.
FRAC	Returns the fractional portion of X.
RAND	Returns a random number between 0 and 1 in the format 0.XXXX
Combinations	Returns the number of Y combinations grouped X at a time.
Permutations	Returns the number of Y permutations grouped X at a time.
PI	Returns the transcendental number 3.1416….
Constants	Brings up a dialog box with many useful constants which can be inserted into the X register.  Up to 1000 user-defined constants can be created in up to 5 user-named banks.
Round	Rounds X to the nearest integer.
Floor	Truncates X to the nearest integer.
Ceil	Returns the next integer higher than X (if X is not already an whole number).
RndYX	Rounds the Y value at the X decimal position (X must be positive).
GCD	Returns the Greatest Common Divisor for any non-zero X,Y,Z,T.
LCM	Returns the Least Common Multiple for any non-zero X,Y,Z,T.
MinR	Returns the Minimum real that can be represented in Excalibur.
MaxR	Returns the Maximum real that can be represented in Excalibur.

Warning - See the Precision Notes section for things you should know about Excalibur floating point.


Statistical Functions

The statistical function bank is used to select a set of keys for work with statistical calculations.  Statistical functions use an internal set of registers to keep track of X and Y values.  There is an internal register N (number of elements) to keep track of how many pairs of X  and Y values have been accumulated.

The following functions are available with this layout:

Summation+	Adds X and Y to the summation registers.  Adds one to N and returns N in the X register (replacing the current contents of X).
Summation-	Subtracts X and Y from the summation registers.  Subtracts one from N and returns N in the X register (replacing the current contents of X).
Clear Summation	Clears the internal summation registers and sets N back to zero.
Summation N	Recalls the internal variable N to the stack.
sX	Sample Standard Deviation of X.
X	Population Standard Deviation of X.
sY	Sample Standard Deviation of Y.
Y	Population Standard Deviation of Y.
Ave X	Returns the Mean value of X.
Ave Y	Returns the Mean value of Y.
Sum X	Returns the total sum of all X values entered into the statistics registers.
Sum Y	Returns the total sum of all Y values entered into the statistics registers.
Sum X Squared	Returns the total sum of all X values squared.
Sum Y Squared	Returns the total sum of all Y values squared.
Sum XY	Returns the total sum of all X * Y products.
r	Returns the Correlation Coefficient.
b	Returns the Y intercept.
m	Returns the slope.
Y	Estimates Y based on previous statistical entries and the value in the X register.
X	Estimates X based on previous statistical entries and the value in the X register.


Conversion Functions

The conversion function bank is used to select a set of keys for common conversions.

For single number conversions, enter the value in the X register.   Functions which require more than one value to be entered on the stack will identify those inputs.  To preform the inverse conversion, simply press the INV key first then the normal conversion key.

The following functions are available with this layout:

Kb->Lbs	Converts Kilograms to Pounds.
Oz->g	Converts Ounces to Grams.
flOz->ml	Converts Fluid Ounces to Milliliters
Gal->l	Converts US Gallons to Liters.
gal->cm^3	Converts US Gallons to cubic Centimeters.
pnt->l	Converts Pints to Liters.
Igal->l	Converts Imperial gallons to liters.
F->C	Converts Fahrenheit to Celsius.
F->K	Converts Fahrenheit to Kelvin.
in->cm	Converts Inches to Centimeters.
in->mm	Converts Inches to Millimeters.
ft->mi	Converts Feet to Miles.
ft->km	Converts Feet to Kilometers.
ft->fa	Converts Feet to Fathoms.
ft->m	Converts Feet to Meters.
mi->km	Converts Miles to Kilometers.
in^2->cm^2	Converts square Inches to square Centimeters.
ft^2->m^2	Converts square Feet to square Meters.
in^3->cm^3	Converts cubic Inches to cubic Centimeters.
ft^3->m^3	Converts cubic Feet to cubic Meters.
Acr->ft^2	Converts Acres to square feed.
At->Psi	Converts Atmospheres to Pounds-per-square-inch
h->hms	Converts Hours to Hours,Minutes,Seconds.  For example, 2.15 hours converts to 2 hours, 8 minutes and 6 seconds.
D->Rad	Converts Degrees to Radians.
R->P	Converts X,Y Rectangular to polar.
kph->mps	Converts Kilometers per hour to meters per second.
kt->mph	Converts Knots to Miles per hour.
AH->Col	Converts Amp-Hours to Coulombs.
AH->Far	Converts Amp-Hours to Faradays.
HP->KW	Converts Horse-Power to Kilowatts.
Cal->J	Converts Calories to Joules.
Mil->mm	Converts Mils to Millimeters


Business Functions

The business function bank is used to select a set of keys for work with financial and date calculations.  Business functions use an internal set of registers which are necessary for the computations to work.  Those registers are accessed through the keys that are labeled for them.  We use the STOF and RCLF keys store and recall the financial registers.  The registers are defined as follows:

*Register Name*	*Register Description*	*How To Store*	*How To Recall*
PV	Present Value Register	FSTO PV	FRCL PV
PMT	Payment Register	FSTO PMT	FRCL PMT
FV	Future Value Register	FSTO FV	FRCL FV
i	Interest Register	FSTO i	FRCL i
n	Number of Payments Reg	FSTO n	FRCL n
MUC	Markup Cost Register	FSTO MU%C	FRCL MU%C
MUP	Markup Price Register	FSTO MU%P	FRCL MU%P
COST	Cost Register	FSTO COST	FRCL COST
PRICE	Price Register	FSTO PRICE	FRCL PRICE
CFj	Cash Flow Registers (100)	CF0, CFj and CFNj.  Do not use FSTO with cashflows.	Not Supported

It is always the X value which is stored to these registers (using STOF) and it is always the X register which receives the recalled value (using RCLF).  When STOF-ing a value, the X register will blink momentarily to confirm that the value was stored (since there is no other real visual indication).

The following functions are available with the Business layout:

TAX	Multiplies the X value by the tax constant (see Files/Settings).
%	Calculates Y percentage of X.
% Change	Calculates the percentage change from Y to X.
% Total	Calculates the percentage X is of Y.
Clear Fin Reg	Clears the contents of all the financial registers.
Store Fin Reg	Activates the store mode for the financial registers.  After pressing this key, you will see FSTO at the bottom of the status bar and you can now select a financial button which corresponds to a financial register and store the X value.  See the financial register table above.  Values must be stored in the financial registers before many of the financial buttons will work.
Recall Fin Reg	Activates the recall mode for the financial registers.  After pressing this key, you will see FRCL at the bottom of the status bar and you can now select a financial button which corresponds to a financial register and recall the financial register to the stack.  See the financial register table above.
n	Calculates the Number of Periods.  Present value, Future Value, interest and the payment amount must be stored in the financial registers.  The resulting value is shown in X and stored in the n register.
i%	Calculates the interest (expressed as a percent) based on Present Value, Future Value, Number of Periods and Interest.  Interest entered into Excalibur is always expressed as interest per period (see examples below).  The resulting value is shown in X and stored in the i register.
PV	Calculates the Present Value given the Future Value, Payment, Interest and Number of Periods.  The resulting value is shown in X and stored in the PV register.
PMT	Calculates the payment given Present Value, Future Value, Interest and Number of Periods.  The resulting value is shown in X and stored in the PMT register.
FV	Calculates the Future Value given the Present Value, Interest, Payments and Number of Periods.  The resulting value is shown in X and stored in the FV register.
fModes	Allows the user to set a number of financial settings.  The user can selects whether the payments are made at the beginning of a compounding period or the end of a compounding period.  They can set the date mode in either DD.MMYYYY or MM.DDYYYY for the date mode.  For working with dates, it is convenient to put the calculator in fixed 6 decimal point mode.  The depreciation mode can also be selected.
Amort	Based on the values in the Financial Registers, displays a table of payments, interest paid, total paid, etc.  See below for an example of how to use this.
DATE	The user keys in a date in the Y register in either DD.MMYYYY or MM.DDYYYY (depending on date mode) and a number of days from that date in the X register (either positive or negative).  The calculator returns the resulting date in X and the day of the week in Y (1=MON..7=SUN).  Note, the calculator will currently only correctly handle dates from 1900 to the year 9999.  For working with dates, it is convenient to put the calculator in fixed 6 decimal point mode.
DAYS	The user keys into the X and Y register two dates in either DD.MMYYYY or MM.DDYYYY format (depending on the date mode) and the calculator will return the number of days between those dates.  Note, the calculator will currently only correctly handle dates from 1900 to the year 9999   For working with dates, it is convenient to put the calculator in fixed 6 decimal point mode.  The actual number of days is returned in X, the number of days based on a 30/360 basis is returned in Y.
TODAY	Returns today’s date in the X register.  The format will be either DD.MMYYYY or MM.DDYYYY depending on the date mode selected.  For working with dates, it is convenient to put the calculator in fixed 6 decimal point mode.
DEPR	Depreciation.  Original cost in {PV}, Salvage value in {FV}, life expectancy in {n} and declining balance factor in {i} if required.  Use fModes to set depreciation type.
12 Divide	Divides the contents of the X register by 12.  Useful when interest is compounded monthly and the annual interest is entered in X but the interest financial register must be set to interest per compounding period.
12x	Multiplies the contents of the X register by 12.
100 Divide	Divides the contents of the X register by 100.  Useful when converting percents to and from parts per 100.
100x	Multiplies the contents of the X register by 100.  Useful when converting percents to and from parts per 100.
CF0	Cash flow. Initial value.  Stores X to the CF0 register.
CFj	Cash flow, subsequent values.  You may store up to 100 cash flow amounts (including the initial value).  The X value is stored into the CFj registers at the next cash flow index (CF0 or CLRF will reset the index).  Also, the number of cash flows currently in memory in addition to the initial cash flow is stored in the n financial register.
CFNj	Repeats the last cash flow making X entries of the last cash flow amount.
NPV	Calculates the Net Present Value based on a set of cash flows an a rate of return stored in the i financial register.  The NPV calculated is shown in the X register and is also stored in the PV financial register.
IRR	Calculates the Internal Rate of Return based the Net Present Value and the stored cash flows.  If no value can be found, a message will be given to indicate this.  The value is shown in the X register and is also stored in the i financial register.
MU%C	Calculates the markup cost as a percentage of price as entered into the financial registers.  The resulting value is shown in X and stored in the MUC register.
MU%P	Calculates the markup price as a percentage of cost as entered into the financial registers.  The resulting value is shown in X and stored in the MUP register.
COST	Calculates the cost based on Price and Markup%C (or Markup %P if Markup%C is zero).  The resulting value is shown in X and stored in the COST register.
PRICE	Calculates the price based on Cost and Markup%C (or Markup %P if Markup%C is zero).  The resulting value is shown in X and stored in the PRICE register.
CURR	Currency Conversion Table.  This table lets you select a Source and Destination Country currency and convert the value shown in the X register.  All of these values can be redefined as the prices change in relationship to each other.  Note - to have the conversion work, all values are expressed in a common unit of US Dollars.  You can convert to and from any currency you like, but the conversion values are all in relation to the US Dollar.  The exchange rates in this program reflect the exchange rates near the time of release.  If you use this feature please keep the exchange rates current with values you can obtain from the Business/Financial section of most newspapers, etc.
SPPV	Calculates the Single Payment Present Value of $1 based on the interest in i and the number of periods in n.  This is the present value of a single $1 payment made after n periods have elapsed.  For example, to find the present value of a single dollar paid to you in 12 years with an interest of 8% you would enter in 8 into i and 12 into n and hit SPPV for a value of 0.40 which means that the 1 dollar paid 12 years from now is as good as 40 cents paid today.
SPFV	Calculates the Single Payment Future Value of $1 based on the interest in i and the number of periods in n.  This is the future value of $1 after n periods.  For example, a single dollar invested today at 8% interest for 12 years will be worth $2.52 in 12 years.
USPF	Calculates the Uniform Payment Present Value of $1 based on the interest in i and the number of periods in n.  This is the present value of a $1 payment that occurs n times.
USFV	Calculates the Uniform Payment Future Value of $1 based on the interest in i and the number of periods in n.  This is the future value of a $1 payment that occurs n times.
EFF%	Calculates the effective interest rate of nominal-interest i compounded for n periods.  For example, a 5% nominal interest compounded monthly for a year (12 periods) would have an effective interest rate of 5.116%.  The value is returned to the X register only.
INFL	Calculates the effective buying power of a dollar amount in X with inflation i and periods n.  For example, $5000 (entered into the X register) at 4% inflation would only have the buying power of $4,109.64 after 5 years.  The value is returned to the X register only.
BOND	Calculates Bond price based on Annual Coupon rate in {PMT} and YTM in {i}.  Uses a 30/360 day basis and semi-annual coupons only.
YTM	Calculates Yield-To-Maturity based on an Annual Coupon rate in {PMT} and bond price quote in {PV}.  Uses a 30/360 day basis and semi-annual coupons only.

Financial Examples

Calculate Future Value

Let’s say you have a savings account which pays 3.9% interest compounded monthly.  You have $9500 to deposit for two years.  What will be the future value (in 2 years) of the money you deposit today.  First, you are deposing money so money is leaving you and going to the bank so this is a negative cash flow. Key in –9500 and store that in the Present Value register.  Key in 3.9 (for the percentage) but don’t store that into the Interest register yet – we are compounding monthly so that annual figure needs to be divided by 12 to give us the interest % per compounding period (which is what the calculator wants).  We can use the convenient Divide by 12 key before we store the interest register.  We are going to leave it in the savings account for 2 years which is 24 compounding periods.   Enter 24 and store that value in the N register.  Now we are all set, we can simply hit the FV key to get the result of 10,269.37 which is how much money will be in the account after 2 years.

You can also get more complicated answers if you include a payment.  For example, you want to know how much money you will have with an initial deposit of $9500 at 3.9% interest (compounded monthly) for 2 years but you will be depositing an additional $200 each month.  This is exactly the same as above except you want to store –200 (remember it’s an outgoing cash flow to the bank) to the Payment register.  Hit the FV key and you will get 15,253.12 which is quite a bit more than the figure above due to the additional payments (the calculator figures in all the interest on each of these payments).

Calculate Payment Amount

You take out a $15000 loan on a car at 4.8% financing for 4 years.  What will be your payment each month?  First key in 15000 into the Present Value register (it’s positive because you are receiving the money from the bank).  Enter 4.8% (divided by 12 for monthly compounding) into the Interest register.  Enter 48 (12 months X 4 years) into the N register.  Be sure Future Value is set to zero (you are paying off the loan until you owe $0 in the future).  Hit the PMT key and you will see that your payments each month will be $344.08 (shown with a negative sign to indicate a payment out).

Calculate Present Value

Let’s say you want to have $10,000 accumulated in 5 years.  How much money would you need to put into an account today giving 5.5% interest (compounded monthly) to get this amount?  First, enter 10000 into the Future Value register (it’s positive because this amount will be paid to you).  Then enter 5.5% (divided by 12 since we are compounding monthly) into the Interest register.  Enter 60 (12 months X 5 years) into the N register.  Be sure the Payment register is set to zero.  Now hit the PV key and the calculator will tell you that you need 7,600.50 dollars deposited to this account to yield $10,000 in 5 years (the calculator will return a negative number indicating a deposit to the account).

Calculate Interest

Let’s say you want to take out a $15000 loan for 4 years but don’t want to pay back more than $325 per month.  What interest would you need to get to achieve this?  First, key in 15000 in the Present Value register (it’s positive because this is the amount that will be paid to you by the loan).  Enter –325 into the Payment register (it’s negative since you will be paying out each month).  Enter 48 into the N register (12 months X 4 years).  Hit the i% key which will give 0.1612 which is the interest per period.  You need to hit the 12x key to get this number expressed as an annual interest rate.  This will give 1.93% which is the annual interest rate that you must get on the loan so that you will only pay $325 per month to pay off the loan in 4 years.

Calculate Number of Pay Periods

This is not used very often but you can figure the number of pay periods assuming you know the Present Value, Future Value, Payment and Interest ahead of time.  Just key those values in and press the N key to calculate the number of pay periods.

Amortization

You take out a $15000 loan on a car at 4.8% financing for 4 years and will be paying back $344.08 per month.  What will your payment schedule look like?  First key in 15000 into the Present Value register (it’s positive because you are receiving the money from the bank).  Enter 4.8% (divided by 12 for monthly compounding) into the Interest register.  Enter 48 (12 months X 4 years) into the N register.  Be sure Future Value is set to zero (you are paying off the loan until you owe $0 in the future).  Finally, enter -344.08 into the Payment register (it’s negative since you are paying the money out).  Now hit the Amort key and you will see a month by month breakdown of your payments – how much is applied to principal, how much is applied to interest, etc.  At the bottom you will see your total payment out and how much you have paid in interest in total over the 4 years (this can be very interesting information).

Markup and Cost Percent

If you buy something for $25 and sell it for $36 what percentage was the markup.  There are two ways to look at this.  First enter 25 into the Cost (what you paid for it) financial register.  Then enter 36 into the Price register (what you are selling it for).  Then hit the MU%C button.  This will yield 44 (percent) in the X register.  This means that the $25 item is marked up 44% to be sold at $36.   If you press the MU%P button instead, it will give 30.55 (percent) in the X register indicating that you paid 30.55% less than the selling price of $36 for the item.

Markup and Cost

If you buy something for $25 and you want to mark it up 65% then you would enter $25 in the Cost register and 65.0 in the Markup%C register.  Hitting PRICE will give the desired resulting price of $41.25 which is a 65% markup over the cost of $25.

If you know an item can be sold for $75 and you want to have a 40% markup, you would enter $75 into the Price register and 40% into the Markup%C register.  Hit COST and this tells you how much you would need to pay for the item to get 40% and sell it for $75.  Entering these numbers and hitting the COST key gives 53.57 which means that you would need to pay $53.57 for an item in order to mark it up 40% for a final selling price of $75.

Cash Flows - Net Present Value and Internal Rate of Return

When you are entering values for calculating net present value you should first clear out the financial registers.  Then set the initial investment in CF0 (changing sign if it is a negative cash flow) and all subsequent values are entered into the calculator and then CFj is pressed to store the next cash flow.  You can also use the CFNj to store multiple cash flows of the same amount into the Cash Flow registers.  For example, you can enter -2000 using CF0, 200 using CFj and then hit 5 CFNj to repeat the last cash flow for a total of 5 $200 cash flow entries.  Be sure to observe cash flow conventions of values being entered (negative cash flows out would be entered with a negative sign while cash in would be a positive entry).  After all cash flow values are entered,.you must enter the Rate of Return in the i financial register.  You can then press the NPV to calculate the Net Present Value.  The solution is also stored in the PV financial register.  To calculate the IRR, enter all values as above except instead of entering the i value, enter the NPV value (in the PV register) and press the IRR key to calculate the Internal Rate of Return.  This value will be shown on screen and also stored in the i financial register.


Geometry Functions

The Geometry function bank is used to select a set of keys for geometry calculations.

The following functions are available with this layout:

CircC	Calculates Circle circumference with radius X.
CircA	Calculates Circle Area with radius X.
Elip A	Calculates the area of an ellipse with radii X and Y.
Tri A	Calculates the area of a triangle with base X and height Y.
Rect C	Calculates the circumference of a rectangle with sides X and Y.
Rect A	Calculates the area of a rectangle with sides X and Y.
Box A	Calculates the area of a cube with side length X.
Box V	Calculates the volume of a cube with side length X.
Sphr A	Calculates the area of a sphere with radius X.
Sphr V	Calculates the volume of a sphere with radius X.
Cyl A	Calculates the area of a right cylinder with radius X and height Y.
Cyl V	Calculates the volume of a right cylinder with radius X and height Y.
Cone A	Calculates the area of a right cone with base radius X and height Y.
Cone V	Calculates the volume of a right cone with base radius X and height Y.
Pyramid A	Calculates the area of a pyramid with height X and base area Y
Pyramid V	Calculates the volume of a pyramid with slant height X and base perimeter Y.
Quad	Computes the two roots of the quadratic equation for X, Y and Z and stores the result in X, Y.
Pyth	Pythagorean Theorem.  Computes the hypotenuse in a right triangle with lesser sides X and Y.
Hero’s	Computes hero’s (or Herons) formula.  Computes the area of a triangle with side lengths X, Y and Z.
Inscrb	Computes the radius of an Inscribed Circle of a Triangle with sides X, Y, Z


Programming Functions
Computer Science Functions

The Computer Science function bank is used to select a set of keys for computer science type conversions and computations.  Current word sizes supported are 8-bit, 16-bit and 32-bit signed/unsigned integers.  Remember, these are integer values, not floating point.  When in programming mode, everything is geared in terms of the word size.

The following functions are available with this layout:

Dec	Puts the calculator in Decimal Mode (base 10).  This is the default when you enter the programming layout mode.
Hex	Puts the calculator in Hexadecimal Mode (base 16).  Keys A-F are used to key in the upper hex digits.
Bin	Puts the calculator in Binary Mode (base 2).  Only zeros and ones are allowed.   Only 16 binary digits are shown at a time.  Use the BinHI and BinLO buttons to switch between the upper and lower bits.
Oct	Puts the calculator in Octal Mode (base 8).  Only digits 0-7 are allowed.
A-F	These buttons are used for Hex mode only to key in those “digits”.
AND	Logical AND of X,Y
OR	Logical OR of X,Y
NOT	Logical complement of X
NAND	Logical NAND of X,Y
NOR	Logical NOR of X,Y
XOR	Logical XOR of X,Y
SHL	Shifts the contents of register X left one bit.  A zero bit is shifted into the first position.
SHR	Shifts the contents of register X right one bit.  A zero bit is shifted into the last position.
ROL	Rotates the contents of register X left one bit shifting the last bit into the first bit.
ROR	Rotates the contents of register X right one bit shifting the first bit into the last bit.
ASCII	Brings up the ASCII chart dialog box.  This shows the relationship between the ASCII character, decimal value, hex value, binary value and octal value.
MOD	Computes Y MOD X.
BinHI	Shows the upper 16 bits when in binary mode.
BinLO	Shows the lower 16 bits when in binary mode.
SHL,x	Shift Y left X bits.
SHR,x	Shift Y right X bits.
RL,x	Rotate Y left X bits.
RR,x	Rotate Y right X bits.
ASR	Arithmetic Shift Right shifts the X register right 1 bit and keeps the sign bit on the left end.
#B	Computes the number of 1 bits in the current X value (for example, the equivalent of 01100010 would return 3).
SB	Sets the Xth bit in Y (zero-based).
CB	Clears the Xth bit in Y (zero-based).
MaskL	Creates a left justified string of 1s (or equivalent value if not in BIN mode).  For example, MaskL of 5 would create the Binary equivalent of 11111.
MaskR	Creates a right justified string of 1s (or equivalent value if not in BIN mode).
WSIZE	Allows selection between 8 bit, 16 bit and 32-bit mode and if the value should be treaded as a signed or unsigned.  For example, if 8-bit unsigned mode is chosen, the range of values in decimal would be 0 to 255.  All programming layout keys will work in this new word size.  For signed modes, the sign is only shown in Decimal mode.  This button also allows the choice of padding zeros on Binary and Hex data where the value shown will be left-zero padded out to the chosen word size.
2's	Takes the 2's complement of X.  Same as Change Sign (CHS).
MINW	Returns the minimum representable value based on word size and mode.
MAXW	Returns the maximum representable value based on word size and mode.
Mirror	Mirror flips bits.  Most significant bit becomes least significant, etc.


Miscellaneous Functions

The Miscellaneous function bank is used to select a set of keys for computations and functions not falling into one of the other categories.

The following functions are available with this layout:

Prime#	Brings up a dialog box with all primes from 1 to 10000.  Allows any of these values to be inserted into the X register of the calculator.
Resist	Brings up the resistor dialog box for quick work with resistor color codes.  Allows any of these values to be inserted into the X register of the calculator.
Elmnts	Brings up a dialog box for the Periodic Table of Elements.  Allows any of these values to be inserted into the X register of the calculator.
Prefix	Brings up a dialog box with metric prefixes.  Allows any of these values to be inserted into the X register of the calculator.
Log 2	Computes the Log base 2 of the number in the X register.
T Start	Starts a stopwatch timer which counts up in tenths of a second in the lower right hand corner of the window.
T Stop	Stops the running stopwatch timer.
T Clear	Clears the stopwatch timer.
Astro	Brings up the astronomy table for quick insertion of astronomical constants.
Merlyn	Plays the game of Merlyn.  A simple game of "copycat" where the computer will select a random button and then you repeat it's selection.  Each time you get it right, the computer selects an additional button and it gets harder and harder to repeat the same sequence that the computer presents.  Consider yourself excellent to get a score of 15.
StoXth	Store the Xth register.  The registers are normally named A, B, C up to Z but for this button they are named A=1, B=2, C=3 up to Z=26.  Using this button, you can key in a value, then press ENTER and key in a register number and press StoXth and it will store the value to that corresponding register.  This is not any different than using the STO and RCL buttons directly but for macro record use this button helps quite a bit (since menu items are not saved as part of the macro record - just button presses).
RclXth	Recall Xth register.  See StoXth above for details on register mapping.


Complex and Vector Functions

**Complex Numbers:

Complex Functions are currently only supported by the 32-bit version of Excalibur.  The 16 bit version does not support this function bank layout.

Up to 2 Complex pairs can be entered into Excalibur in the X,Y pair (X is the real part and Y the imaginary part) and in Z,T (same real/imaginary arrangement).

The following functions are available with this layout:

Cpx+	Complex Addition. {Z,T} + {X,Y}
Cpx—	Complex Subtraction.  {Z,T} – {X,Y}
Cpx Div	Complex Division. {Z,T} / {X,Y}
Cpx X	Complex Multiplication. {Z,T} * {X,Y}
cSIN	Complex Sine of {X,Y}
cCOS	Complex Cosine of {X,Y}
cTAN	Complex Tangent of {X,Y}
Conj	Complex Conjugate of {X, Y}
Cpx e	Complex Natural Exponential of {X,Y}
cLN	Complex Natural Log of {X,Y}
cLOG	Complex Log (base 10) of {X,Y}
cPOW	Complex Power {Z, T} raised to the {X,Y}
cSQRT	Complex Square root of {X,Y}
cABS	Complex Absolute Value of {X,Y}

**Vectors:

Vector operations also appear on this function bank.  Vectors functions are always done using 2 sets of 3 registers.  The calculator should be placed in 8-stack mode for this to be of any use (with a 4-level stack you can only effectively enter one vector).  To put the calculator in 8-level stack mode, use the File/Settings dialog box.

Once in 8-level stack mode you need to enter the vectors onto the stack.  One vector goes into X, Y, Z and the other goes into Z, A, B (A and B are not shown, they are off the display and are only available in the 8-level stack mode).  All vector operations are done using rectangular coordinates but there is a convenient button to convert both pairs of vectors from rectangular to polar and back again so you can easily work in Polar coordinates (if you do, you might find it handy to record a macro to convert, perform the function and convert back automatically).

As for the vectors themselves, let's take a look at the X,Y,Z vector (the Z,A,B is basically the same).

For X,Y,Z in coordinate form:

X - the X axis coordinate of the point.
Y - the Y axis coordinate of the point.
Z - the Z axis coordinate of the point.

For X,Y,Z in polar form:

X - This is the radius (sometimes denoted R).
Y - This is the angle in the x/y plane (sometimes denoted T)
Z - This is the angle from the z-axis (sometimes denoted P)

Easy, right?  The only tricky thing to remember is that a point X, Y, Z of 5, 6, 0 would lie flat on the X-Y plane (since Z is zero) and when this is converted to polar form it would be Z=90, Y=50.2, X=7.8.  The x-y plane we are used to in the 2 dimensional world lies at 90 degrees from the Z axis vertical.

Otherwise, just remember that all vector functions (except conversion from polar to coordinate form) take their arguments in coordinate form.

Vect +	Vector Addition.  Adds vector X,Y,Z with T,A,B.  This is done in rectangular coordinate form.
Vect --	Vector Subtraction.  Subtracts vector X,Y,Z with T,A,B.  This is done in rectangular coordinate form.
Vect x	Computes the cross product of vector X,Y,Z with vector T,A,B.
Vect o	Computes the dot product of vector X,Y,Z with vector T,A,B.
Vect A	Computes the angle between vector X,Y,Z with vector T,A,B.
Vect->R	Translates the vectors X,Y,Z and T,A,B from polar to rectangular form.
Vect->P	Translates the vectors X,Y,Z and T,A,B from rectangular to polar form.


Physics Functions

The business function bank is used to select a set of keys for work with physics and electronics calculations.

The following functions are available with this layout:

Moles	Gas - Computes # Moles with X=Atomic Weight and Y=Mass of Gas
Molecules	Gas - Computes # Molecules from # moles in X
Gas Vol	Computes Gas Volume (in liters) with # moles in X
Ohms Voltage	Computes Voltage (in volts) from current in Y and resistance in X
Ohms Current	Computes Current (in Amps) from voltage in Y and resistance in X
Ohms Resistance	Computes Resistance (in Ohms) from voltage in Y and current in X
Gravitation	Computes Gravitational Force (in newtons) given  X=distance between objects.  Y=mass of object 1 (in kg) and Z = mass of object 2 (in kg).
Energy	Computes Energy (in Joules) of an object with mass X (in kg).
Centripetal Force	Computes Centripetal Force (in Newtons) given mass in X (kg), linear speed in Y (m/s) and radius of circle in Z (meters).
Centripetal Accel	Computes Centripetal Acceleration (m/s^2) with linear speed in X (m/s), radius in Y (m)
Accel Distance	Computes the falling distance (in meters) of an object at X seconds with Y acceleration (m/s^2)
Projectile Range	Computes the range of a projectile (in meters) given firing angle X and initial velocity Y (in m/s).
Projectile Height	Computes the height of a projectile (in meters) given firing angle X and initial velocity Y (in m/s).


Program Bank

The Program function bank is used during Program Recording and gives access to some powerful programming abilities.  Some people don't need this kind of programming power, but it's included in Excalibur for those wishing to explore more powerful programming than just keystroke programming (see the Programming section for details on how to program).  These functions allow the programmer to perform branching, looping and subroutines.  They should not be attempted by someone who is not familiar with the programming mode of Excalibur.  Allowing branching and looping means that the programmer now has enough rope to hang themselves.  Programs with bugs can cause infinite loops or incorrect results to be given.  Care should be taken when using this (or any) programming mode.

Programming is done when the user presses the "Rec" key.  The following functions are available with this layout:

LblA - LblG	Sets a label at the current program line.  Labels are used for Gotos and Gosubs.
GotoA - GotoG	Sets a goto at the current program line.  During program playback, when this line is run Excalibur will search the current program for a corresponding label (goto A searches for LblA) and unconditionally branch to that label.
GsbA - GsbG	Same as a goto except this branches to a subroutine and will return when the next "Return" instruction is reached.
Ret	Return from subroutine.  Returns to the last Gsb executed or if no Gsb has been executed it will end the current program.
X<=Y?	Tests if X is less than or equal to Y.  If true, the next program line is executed otherwise the next program line is skipped.
X>Y?	Tests if X is greater than Y.  If true, the next program line is executed otherwise the next program line is skipped.
X=Y?	Tests if X is equal to Y.  If true, the next program line is executed otherwise the next program line is skipped.
X!=Y?	Tests if X is not equal to Y.  If true, the next program line is executed otherwise the next program line is skipped.
X<=0?	Tests if X is less than or equal to Zero.  If true, the next program line is executed otherwise the next program line is skipped.
X>Y?	Tests if X is greater than Zero.  If true, the next program line is executed otherwise the next program line is skipped.
X=0?	Tests if X is equal to Zero.  If true, the next program line is executed otherwise the next program line is skipped.
X!=0?	Tests if X is not equal to Zero.  If true, the next program line is executed otherwise the next program line is skipped.
SFx	Set Flag X.  There are 32 internal user flags numbered from 0 to 31.
CFx	Clear Flag X.  There are 32 internal user flags numbered from 0 to 31.
TFx?	Test Flag X.  If set, execute the next program line else skip the next program line.
Pause	Inserts a pause during program running so the contents of the stack may be viewed.  Pause time value is defined in File/Settings.
Inp A	Pause program and prompt for A register value.
Inp B	Pause program and prompt for B register value.
REV	Will step backwards one program line while in program record mode.  This allows editing of the current program.  Remember that new buttons pressed are inserted after the currently displayed step.
DEL	Will delete the current program step while in program record mode.  The stack will NOT change nor will any results of any computations made, but the program will step backwards and allow you to correct mistakes.
FWD	Will skip forward one program line while in program record mode.  This allows editing of the current program.  Remember that new buttons pressed are inserted after the currently displayed step.  If not in record mode this button will act like PLAY except that Excalibur will step through the current program slowly (this is called TRACE mode and the step time is defined in File/Settings).  You can see the current step number as it executes on the status bar.  Press ESC to stop the program or let it run to completion.
EDIT	Same as REC but will not overwrite the current program but will instead allow editing of the program in memory.  Use FWD, REV, DEL and new type buttons to edit the program.  Remember that new buttons pressed are inserted after the currently displayed step.


Custom Bank

From the main menu, you can select the Define Custom Bank.  This will bring up a dialog box to allow you to select each of the function bank layouts and choose any button combinations to copy to the custom bank.  Once the custom bank is accepted, you can select it by choosing Custom from the Type menu or selecting the Custom button.  All of the buttons you selected will be available.  This lets you create a layout that is right for you.  You may mix and match buttons from any layout when defining the custom set.  If you select a button that is a programming mode button, when that button is selected, the stack will automatically switch from Floating Point Mode to Integer Mode.  When a non-programming mode button is selected, the mode will automatically switch back.  Macros can also be recorded, saved and stored to custom bank keys.  See the Macro Programming section for more details.


Programming Basics

Basics

Recording programs is very easy.  On the primary keypad you will see a button labeled REC and one labeled PLAY.  The REC key puts the calculator into program record mode.  A "Rec" indicator will appear in the status bar near the bottom to indicate this and the stack will change and will show normal X, Y but the Z, T will now show the current program line and function.  It is important to note that when you are in Programming REC mode, the keystrokes are being recorded but also the stack is still "live" and you are actually performing the calculations you are entering.  I feel this is superior to the more traditional method of only showing the user the key values as they are pressed but not actually taking action on them until the program is run.  In this way, you can feel your way though the programming effort and end up with less bugs in your program sequence.  Every calculator key pressed (clicked) is stored in sequence until "Rec" is hit again which will turn off the record feature.  Pressing PLAY will then cause the key sequence recorded to playback in rapid succession.  So, for example, you could hit REC, 9, * and REC which would effectively multiply the X value by 9 every time PLAY is hit.  Several hundred Excalibur keys can be recorded in this way.  Once recorded, it will stay with the calculator (even between sessions - its saved to disk) until a new REC takes place.  If you want to save your program more permanently, simply use the "Program Manager" menu selection from the File menu.

Keystroke Programming

Keystroke programming is the most simple form of programming and the most common.  Most of the users who ever venture into programming will only venture as far as Keystroke programming - and with good cause since it will allow you to do countless useful programs of your own choosing.  Keystroke programming does not use branching, loops or subroutines.  Only repetitive keystrokes are recorded for playback.  Using only this method, user-defined constants, conversions and straight-line programs can be created and used with little effort.  Let's take an example of keystroke programming.  Suppose you wish to compute the circumference of a circle given the radius in X (I know this already exists as a built in Excalibur function but it makes a simple and nice example).  First, start by pressing REC to turn the programming mode on.  You will see at the top of the display the program counter set at 000.  Starting in the Scientific bank, enter in the following program simply by pressing the keys in the order shown:

000 - <Program Start>
001 - X Squared
002 – PI
003 – Multiply
Program Checksum: 0193  (you can see the program checksum from the File/Program Manager dialog box)

You have now entered the sequence of keystrokes to produce the area of a circle given the radius in X.  Now enter a radius into X and press Play - you will see the answer displayed in X.  A vast amount of similar programs can be created in this manner.

Labels, Branching and Conditionals

Normally the program execution flows from the beginning of the program to the end one step at a time.  Labels and branching allows the programmer to skip lines either forwards or backwards.  This is done with a label and a corresponding goto.  A series of backwards gotos is called a loop (normally terminated using conditions on the Program bank layout).  Here is a simple program which demonstrates labels, branching and conditionals.  It takes a value in X and if the value is greater than 200 it will divide it by 3 otherwise it will multiply it by 6.

001-Digit 2
002-Digit 0
003-Digit 0
004-Exchange X and Y
005-X <= Y?
006-Goto A
007-Goto B
008-Label A
009-Digit 6
010-Multiply
011-Return
012-Label B
013-Digit 3
014-Divide
015-Return

Checksum: 0BC2

Looping

Looping is simply a branch to an earlier instruction that is predicated on the outcome of a conditional test.  We loop for several reasons - but mainly to count or sum a series of numbers or calculations.  Here is a program to compute a simple summation sequence of 0+1+2+3+4...X.  If you enter and X of 6 you should get 0+1+2+3+4+5+6 for a total of 21.  The program looks as follows:

001-Digit 0
002-Stores A Register
003-Drops X Register
004-Label A
005-Enter
006-Enter
007-Recalls A Register
008-Plus
009-Stores A Register
010-Drops X Register
011-Digit 1
012-Minus
013-X > 0?
014-Goto A
015-Clear Stack
016-Recalls A Register

Checksum: 060B

WARNING - If you ever goto an earlier programming step and do not provide a way to break the looping cycle you will end up with an infinite loop.  It is also possible that given the speed at which Excalibur executes instructions (which is many thousands of instructions per second) extremely long loops could take significant time.  During this time, the program will show the word "Run..." in the status bar and with be otherwise oblivious to keystrokes or mouse clicks.  To interrupt an infinite loop you should click the Play key or press the ESC key and the program will return to the non-running state.

Subroutines

Subroutines are useful for repetitive calculations.  Each subroutine must start with a label and end with a "Return" statement.  All of the tools for subroutines are found on the Program bank of functions.

For example, to compute the area of 2 circles with the first circle's radius in X and the second circle's radius in Y you would key in the following program:

001-Gosub A  {This computes the first area}
002-Exchange X and Y  {Now do the 2nd radius}
003-Gosub A  {Compute the area}
004-Exchange X and Y  {Put them back in order again}
005-Return
006-Label A  {Subroutine A computes Area of a circle given radius in X}
007-X Squared
008-PI
009-Multiply
010-Return

Checksum: 0A01

Now entering a radius in X and a radius in Y and pressing "Play" will yield the area of both circles.

Binding Programs to Custom Keys

To assign a program directly to a key, simply record any program you wish.  Save it using "Program Manager" from the File menu.  You can give it a short "key" name and a longer more descriptive name.  Then you can go to the Define Custom Set menu item also in the File menu.  There you will see a list of all keys and programs and you can click to assign any key or program to any desired custom key on the custom key bank.  When you show the Custom bank you will see the short key name of your program and the tool-tip will be the longer more descriptive name.  Pressing that key will load and invoke the program (but will not harm the contents of any current REC/PLAY macro).

This should allow you to make your own constants, conversions, formulas, etc. with relative ease.  As of right now, menu items are not saved as part of the macro record process - just buttons.  This should pose very little problem since you can always type in the constant value as part of the macro or use the StoA/RclA or StoB/RclB keys to get at more saved storage.

Tracing Programs

If you want to see the program played out slowly so you can try and debug it, you use the FWD button on the program bank.  This button has dual meaning and in record mode it moves forward one program step.  When not in record mode, it behaves the same as the PLAY key but plays the program back slowly so you can see the steps and the stack.  To control the delay time between steps, use File/Settings.

Editing Programs

We all make mistakes during programming or need to add/remove features to existing programs.  Excalibur allows the editing of the current program while recording by use of the REV, DEL, FWD keys.  These keys will step around the current program from beginning to end if necessary.  Use DEL to remove the current program step.  Any new buttons pressed are inserted after the currently displayed program step.  If you are not recording a program and wish to edit the currently loaded program, simply hit EDIT and Excalibur will enter the program record mode but will not erase the current program (as REC would do) and you can use the REV, DEL, FWD keys to edit the program.  When done you can press either REC or EDIT to end the program edit.

Here are some other useful programs as starting points or examples for program you might write.


Other Useful Programs

Here is a small collection of useful programs (well at least useful as examples).  If you should create any programs, feel free to copy them to the clipboard (using the Edit/CopyProgram menu item) and send them to me and if I get enough programs perhaps I'll update and store them on my homepage.

Dice Average Program

This program will roll 2 standard dice (generated using the random number generator on the Scientific menu) and add the results together.  It will then sum them in the statistics register so that average results can be retrieved.  Place any number in the A register - this will be the number of "rolls" to take and average.  For example, store 1000 into A and press PLAY with this program loaded and you will get 1000 simulated dice rolls and the stack will show the average of all such rolls X in A and the number of rolls in Y.

001-Digit 0
002-Stores B Register
003-Summation Clear
004-Label A
005-Random Number
006-Digit 6
007-Multiply
008-Digit 1
009-Plus
010-Integer
011-Random Number
012-Digit 6
013-Multiply
014-Digit 1
015-Plus
016-Integer
017-Plus
018-Summation +
019-Recalls B Register
020-Digit 1
021-Plus
022-Stores B Register
023-Recalls A Register
024-X!=Y?
025-Goto A
026-Clear Stack
027-Number of Elements
028-Mean X

Checksum: 0EF5

Time Addition Program

This program will take a time value (in the format HH.MMSS) in X and Y and add them - returning a time value in the format (HH.MMSS).  For example, 06.2500 + 02.4000 would yield 09.0500.  It is best to place the calculator in 4 place fixed mode for time arithmetic.

001-Conversion Inverse
002-Hours to Hours.Minutes
003-Exchange X and Y
004-Conversion Inverse
005-Hours to Hours.Minutes
006-Plus
007-Hours to Hours.Minutes

Checksum: 0614


Licensing Info
Licensing Info and Disclaimer - Excalibur v1.05

Copyright Notice and Disclaimer

Excalibur for Windows is Copyright (c) 1994-1998 by David Bernazzani.  All rights reserved.  This version is distributed as FREEWARE and may be freely copied and distributed as long as the entire unmodified program is copied and no fee is charged.  This program may not be placed on a shareware/freeware CD collection without my permission.

This program is provided 'as is' and no warranties are implied or given.  The author shall not be held responsible for any errors, incompatibilities or consequential  losses before, during or after use of this program.  The author does not guarantee fitness for a particular purpose.  The risk as to the quality and performance of the Software is taken on by you.

Grant of Use

The author grants you a non-exclusive license to use this software product ("Software").  This Software is currently free of charge.  (However, if you find it useful, please send me some email and let me know what you liked).

Bugs and Features - Contact Info

Although I cannot fix every bug in a timely manner or even respond to every email question I do need to know about bugs in the program or features you would like to see in future releases of the program.  Please email me with comments/suggestions at the following address:

  dber@tiac.net

And put as the first word in the subject line: Excalibur so it will be easy for me to know what the message is about (you can put as long a subject as you like, just put Excalibur somewhere in the subject line).  I'm working on some feedback forms for my home page (see below).   If you contact me, please include your Excalibur version number and whether you use the 16 or 32 bit version.

Patches and new releases will (hopefully) be available on my home page:

  http://www.tiac.net/users/dber

System requirements

Excalibur 32-bit requires Windows 95/98 or WinNT (intel version) with 8MB of RAM and a hard drive with 500K free.

Excalibur 16-bit requires Windows 3.1 or 3.11 with 4MB of RAM and a hard drive with 500K free.

Uninstalling

The 16-bit version can simply be deleted (along with its associated help file).

The 32-bit program was distributed with Install Shield to automatically install the program.  To uninstall it, simply use the normal Win95/98/NT Control Panel Add/Remove Programs to remove Excalibur 32-bit.


For the Technically Curious
Excalibur Technical Information

Excalibur was written over the course of 1994 to 1998.  It grew from an antiquated DOS program I wrote called FCALC (1992) which, at the time, was switchable from RPN to algebraic.  Although buggy, this was a tool I used daily as I did not have the cash outlay for a good quality RPN calculator.  In early 1994 work was started on Excalibur for Windows 3.1.  Most of the code was abandoned and rewritten for this new effort.  For several years, it grew steadily but it was not released to the public.  In 1995 I switched to Windows 95 and the Microsoft Visual C compiler.  For the next couple of years, Excalibur was enhanced and improved until I was ready to release it officially in the summer of 1997.  I estimate that Excalibur has taken more than 500 hours to develop.

Because Excalibur was written using mostly straight ANSI C with Win32 API calls (for the Windows functions), the main program EXCAL32.EXE is reasonably small (about 300Kb) and is completely standalone.  It does not require additional DLLs or other files to run (well except EXCAL32.HLP which is the help file but even that is not technically needed).  You can simply place the small EXCAL32.EXE file onto a floppy and move it to any other computer with no hassle.  The reason the distribution file for Excalibur is larger (about 900Kb) is simply because of the installation program (which many users prefer rather than installing Excalibur manually).  In any event, once Excalibur is installed the single EXCAL32.EXE is all that is required.

In order to keep the size of the file small, the load time quick and the memory consumption to a minimum -- Excalibur uses standard windows dialog and button features.  There are no fancy buttons and no customized graphics used in the program.  In my experience, these tend to bloat the package (although they certainly look nice).  I wanted to pack as much computational power into Excalibur as possible and keep the size reasonable.


Thanks To All

I would like to take this opportunity to thank everyone who took the time to download and try this program in its previous version.  The many emails and excellent feedback I got gave me the inspiration to continue developing this tool.  Always feel free to let me know what you liked and didn't like about Excalibur so that I can keep it as up-to-date and useful as possible.

I especially want to thank my Beta testers who took pre-release versions of this program and put it through its paces.


Version Information

About Version 1.05

Fixed large number crash when using FIX notation with numbers greater than about 1.0x10^50.
Added footprint size selection (see Settings).
Added 4-level and 8-level stack selection (with zero pad of stack pop option).
Added Stopwatch functions to the Misc bank.
Added Astronomical tables to the Misc bank.
Cleaned up STO and RCL dialogs so that keystroke entry is easier.
Added additional user-defined constants with 200 constants per bank and 5 user-defined banks.
Added Mirror function to Comp-Sci bank.
Allow CTRL-0 thru CTRL-9 to automatically change decimal places when in non FIX, SCI or ENG display mode.
Added the game of Merlyn!
Increased number of stored macros to 100.
Added a new Excalibur scratch notepad for quick notetaking during calculations.
Changed Macro Save/Recall to new enhanced Macro Manager.
New and improved method of financial register entry.
New Physics function bank.
New StoXth and RclXth buttons on Misc function bank.
New option to show X register in the title bar when window is minimized.
New Modes option to right-align stack display.
New STO/RCL mini-labels.
New CopyX button on main window.
New Vector support.
Fractions now support whole number, fraction (ie- 5 & 3/5)
New method of calculating Combinations and Permutations so that larger numbers can be handled.
Fixed Word-Size selection bug where the X register was not automatically converted to the new word size.
New shortcut keys for Copy X and Paste X (Ctrl-C and Ctrl-V)
Pressing EEX with no value (or a zero value) entered will result in "1e+"
ASCII chart much improved.
Right-Click on key automatically brings up context sensitive help for that key.
Help file updated with RPN and Numeric Entry (Fractions, Exponents, etc).
Business bank now has new functions for Bond calculations, Actuarial functions, better Cash Flow support, etc.
New programming mode in place.  Labels, Branching, Looping, Subroutines.

Better alignment on buttons and other dialog box items.
Some support for overflow and underflow detection added.
General cleanup of dialog boxes and new footprint layouts.
New support for international users.  The first time Excalibur loads it will set the comma/dp format and time format (AM/PM or 24-hour).

About Version 1.01

General bug fixes.
Reorganized Comp Sci bank (formally known as the Programming bank).
Fixed NT compatibility issues.
Fixed ASCII chart.
General layout cleanup.  Went with radio-style buttons for function bank selection.
Fixed Amort and PMT calculations when using a pay mode set to "beginning".

About Version 1.00

Word Size implemented.
Comma Format is Configurable.
Clear All added to STO register dialog.
Fixed cut and paste to and from Programming mode stack.
Cut and copy fixes when commas in string.
Now will copy binary, hex and octal modes to clipboard.
Auto size window if no EXCAL32.DAT config file exists.
Run minimized fixed.
New buttons - LARG, DROP, EDIT, RCLB, STOB, STOA
Minor fixes and better font handling for main display.
Added ability to store and recall up to 10 macros (with names).
Fixed keyboard comma as DP separator for better international support.
Added keyboard UP and DOWN keys to rotate the stack.
All keys on the currently selected function bank are now accessible through the keyboard.  The first column is F1 - F10 and the second column is SHIFT F1-F10.  The third column is CTRL F1-F10 and the last column is CTRL-SHIFT F1-F10
Tax constant now handles larger range so that things like 8.25% tax can be handled properly.
Double click is finally working on the 32-bit version for list boxes (STO/RCL registers, Constants
list, etc).  For example, to store a value you can simply click on STO and then double click on any register and it will perform the "default" operation of a store.
Based on feedback the Clear X and Clear All keys have been swapped on the keyboard.
New keys on the scientific layout for rounding, Greatest Common Divisor and Least Common Multiple, etc.
Increased macro capacity to longer sequences and up to 40 saved.
New key names can be saved with the macro for easy assignments to custom keys.
On the "Define Custom Set" dialog the saved macros are listed and can be assigned to any open key.
Lots of smaller improvements.  New keys for the Programming (comp sci) bank.
Macro key assignments cleaned up.
User defined constants added.
Copy and Paste operations fixed when in Programming Decimal mode.
Save and Recall of "Programming Mode" values fixed.
Currency Conversion added to the Business bank.
Misc Business Date bug fixed.
Status bar cleanup and better sizing on first-time startup.
Time of 12AM now shows correctly.
New window creation at startup which should be more compatible with NT4.0
Version 1.00 is the last created 16-bit version of Excalibur.

About Beta Version 0.99a

First beta release.


Where can I get a handheld RPN calculator?
Where can you get a handheld RPN calculator?  Well, many years ago the best calculators were made by Hewlett Packard (HP) and virtually all their early series handheld calculators were RPN.  Today the best manufacturer of handheld calculators is still HP (surprise, surprise!).  Their solid built-like-a-brick designs are simply the best.  They tend to be a bit expensive but in my experience they are worth it.  They have a number of current models which are RPN only, some that are Algebraic only and some that switch-hit between the two notations.  I don't like algebraic calculators and I find the ones that switch are typically labeled with algebraic in mind since the majority of users tend to use that notation.  If you want an RPN calculator, stick with an RPN only.  Current models include the HP 12C - a classic financial calculator (but a real workhorse for any calculations) sold in most office supply stores and most bigger electronic chain stores.  The 32SII is an RPN scientific calculator with tons of features and functions.  The 48G is the big-boy and has graphics screen for serious computational work.  Since they have been making handheld RPN calculators for something like 30 years, you should be able to find a second-hand one for short money.  Try looking at yard sales or flea-markets or even the local want ads.  Some interesting discontinued models include the 32S which is the predecessor to the 32SII and has nearly the same functionality.  The 42S which packs hundreds of functions onto soft-keys and is a more advanced scientific than the 32SII.  The 10C basic scientific, 11C advanced scientific, 15C scientific with matrix and complex math, 16C computer scientist - all of which are built like the 12C financial calculator mentioned above (they are part of a group of calculators that make up the 10C series).  Even older would be the classic HP25 scientific or the classic HP35.  It should be easy to determine if a calculator is RPN - it should have a prominent ENTER key and no equals key (some of the newer RPN only calculators have an equals key for equation solving, but it's fairly obvious it's not for primary use).  Good luck...


Reverse Polish Notation