home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega CD-ROM 1
/
megacd_rom_1.zip
/
megacd_rom_1
/
MATH
/
XACT51.ZIP
/
X16.DOC
< prev
next >
Wrap
Text File
|
1991-02-01
|
87KB
|
2,154 lines
XACT-16C Programmer's Calculator
The Hewlett-Packard Compatible
Programmer's Calculator
For Your IBM PC or Compatible
CalcTech Incorporated
6014 NE 60th Street
P.O. Box 15277
Seattle, WA. 98115-0277
Phone: 206-527-9950
Fax: 206-525-1331
Description
XACT-16C is the Programmer's Calculator of the XACT CALCULATORS
series. XACT CALCULATORS emulate the functions of Hewlett-
Packard's handheld HP-11C Scientific, HP-12C Financial, and
HP-16C Programmer's calculators and include additional features
such as program store to disk, simulated tape display, and
constant memory.
XACT CALCULATORS includes an auxiliary shell program. XSHELL.EXE
is a Terminate-Stay-Resident (TSR) program which loads and runs
all three calculators. (Note: A TSR is a program which remains
loaded but inactive after it finishes execution. TSRs are
usually made active by pressing a "hot-key" which pops up the
program, even if another program is executing at the time).
XSHELL.EXE has 3 hot-keys, one for each calculator.
Normally, the disadvantage of TSRs is that they consume a lot of
your computer's memory, even while they're inactive. Thus if you
have loaded one or more TSRs, there may not be enough RAM left
over to run your spreadsheet, word processor, or other DOS
programs. XSHELL.EXE helps reduce "RAM Cram" because it REQUIRES
ONLY 6K BYTES OF RAM! In fact, If you have EMS memory installed
(see section 2.2) in your computer, XSHELL requires an amazingly
small 1.5K bytes of conventional DOS memory!.
Each calculator can be run individually as an ordinary DOS
program by running either X11.EXE, X12.EXE, or X16.EXE. Or, all
three calculators can be run as a single TSR by running
XSHELL.EXE.
XSHELL.EXE will deactivate and unload itself from RAM after 8
minutes until you register your copy. This will allow you to try
XACT CALCULATORS as a TSR before you register. Once XSHELL.EXE
unloads itself, your computer will behave as though XSHELL had
never been loaded in the first place. To re-activate XSHELL,
simply run the program again. It will again remain loaded for
another 8 minutes.
- 2 -
Quick Registration for XACT CALCULATORS
Registration for XACT CALCULATORS is only $27.00. To register,
print a copy of the file ORDERFRM.DOC and fax or mail the
completed form to us. We will quickly fax (or mail) back your
registration serial number and personal unlock code. Run the
QUICKREG.EXE program entering your name, serial number, and
unlock code and that's it, you're registered! QUICKREG.EXE
serializes XSHELL.EXE and "unlocks" it's 8 minute time limit.
AFTER YOU'VE REGISTERED AND SUCCESSFULLY RUN QUICKREG.EXE,
XSHELL.EXE WILL NO LONGER HAVE AN 8 MINUTE TIME LIMIT. It will
remain resident in your computer's RAM (waiting for a hot-key to
become active) until you reboot or manually unload XSHELL.
If you prefer to order your registered copy by mail, feel free to
mail in your completed form. A copy of the file ORDERFRM.DOC is
shown on the following page.
- 3 -
----------------------------------------------------------------------
FAX this form to: (206)-525-1331
or mail to:
CalcTech, Inc.
6014 NE 60th Street
P.O. Box 15277
Seattle, WA. 98115-0277
----------------------------------------------------------------------
XACT CALCULATORS - Version 5.1
QUICK REGISTRATION FORM
I wish to register my copy of XACT CALCULATORS (includes XACT-11C
Scientific, XACT-12C Financial, and XACT-16C Programmer) today for
$27.00 (Washington state residents add 8.2% sales tax). Please
(check one or more boxes below):
[ ] FAX my serial number and personal unlock code
as soon as possible.
My FAX number is: ____________________________
[ ] Mail my serial number and personal unlock code
as soon as possible.
[ ] Send my registered copy by mail. (Enclose an
an additional $5.00 for U.S. or Canada, $10.00
for overseas air mail). I prefer (check one):
[ ] 5.25" or [ ] 3.5" diskettes
Name: ______________________________ Company:_________________________
Phone: (Day) ______________________ (Evening) ________________________
Address: _____________________________________________________________
City: ______________________________ State: ________ Zip: ____________
Comments: ____________________________________________________________
______________________________________________________________________
(check one): [ ] VISA [ ] Mastercard [ ] Check Enclosed
Credit card #: ____________________________________ Expires: ____/____
Cardholder's Name (Please print): ____________________________________
Cardholder's Signature: ______________________________________________
- 4 -
Background Information
CalcTech, Inc. is a company with a respected history in the
development of software calculators. The article "TSR Desktop
Organizers", (PC Magazine, Aug. 1987), contained a review of the
leading desk accessory programs. Three of the fourteen products
reviewed incorporated calculators developed by CalcTech. A
CalcTech calculator has also won PC Magazine's prestigious
"Editor's Choice" award.
CalcTech has developed calculators for publishers and OEM's such
as Software Publishing Corp., Bellsoft Inc., DAC Software,
Popular Programs Inc., Timeworks Inc., Practical Peripherals, and
Monogram Software.
Here's What A Few Industry Experts Have To Say:
"XACT-16C... It has power to burn." --Johnathan Matzkin, PC
Magazine.
"PC-12C's (OEM version of XACT-12C) emulation of the HP-12C is
exact, it gets my vote." --Jim Seymour, PC Magazine
"I found Bellsoft's (OEM version) Pop-Up calculator to be the
best for office work" --Mark J. Welch, BYTE.
"When a program performs flawlessly, it makes writing a review
hard. Such is the case with XACT CALCULATORS." --Jacques
Benavente, PCM Magazine
XACT CALCULATORS have won PC Brand's 1989 award for outstanding
technical merit in a shareware program.
An Important Note About The Shareware Concept
XACT CALCULATORS are copyrighted shareware programs. They are
not freeware or public domain software. Payment is made through
registration and is on the "honor system". We ask that you pay
for the programs by registration if after a reasonable trial
period, you find them to be useful in your work. We hope that
you appreciate the "try before you buy" concept that shareware
products like XACT CALCULATORS provide and that you will take the
time to register.
Anyone who has ever purchased expensive (or even inexpensive)
software can attest to the frustration of being "burned" by a
lousy product. We think XACT CALCULATORS are excellent products
and we're giving you the opportunity to judge for yourself. If
you agree, please take a moment to register.
- 5 -
Customer Support
Support for XACT CALCULATORS is provided to registered users
using our voice messaging "access code" feature. You can call us
at (206)-527-9950 and leave your question on our voice messaging
system. You will be given an "access code" which is a password
for your message. You may then call back (usually within 1 day),
enter your access code using your touch-tone phone, and receive a
voice message response to your question. Alternatively,
registered users can send your question via E-mail on CompuServe
at 71641,1721 or by U.S. mail.
When contacting customer support, please be as specific as
possible with your question and be sure to mention the version
number of your copy of XACT CALCULATORS.
User Groups, Electronic Bulletin Boards, Disk Vendors
User Groups, BBS SysOps, and Disk Vendors may receive an official
copy of the latest shareware version of XACT CALCULATORS by
submitting a written request to CalcTech, Inc. Please add
CalcTech to your organization's mailing list and send any
appropriate information such as your group's newsletter or
catalog.
Private Labels, Custom Versions
Private labellings and/or custom versions of XACT CALCULATORS can
be developed for your organization. Please contact CalcTech,
Inc. by in writing for a quotation.
Government, Corporate, Academic Site Licensing
A site license grants you the legal right to make multiple copies
of a "master" registered version and it's documentation for your
organization or group.
A site license is non-transferable. We accept Visa and
Mastercard, personal or corporate checks, and written (fax ok)
purchase orders (NET 30, FOB Seattle, WA.) for site license
registration. The following page is a site license form you can
use to fax or mail or mail to us for site licensing.
- 6 -
----------------------------------------------------------------------
FAX this form to: (206)-525-1331
or mail to:
CalcTech, Inc.
6014 NE 60th Street
P.O.Box 15277
Seattle, WA. 98115-0277
----------------------------------------------------------------------
XACT CALCULATORS - Version 5.1
Site License Registration Form
Use this form to obtain a site license for your company or
group. Your registered copy will be sent via U.S. mail.
I wish to register XACT CALCULATORS under a multiple (site)
license agreement. Please license my organization to allow
us to duplicate up to: (check one)
[ ] 10 copies .................................... $100.00
[ ] 100 copies ................................... $350.00
[ ] 1000 copies ................................. $1000.00
WA. state residents add 8.2% ................ $_______
TOTAL $_______
Company or Group Name: _______________________________________________
Your Name: ___________________________________ Phone: ________________
Address: _____________________________________________________________
City: ______________________________ State: _________ Zip: ___________
Method of Payment: (check one)
[ ] Check enclosed
[ ] Bill Me. Terms are NET 30, FOB Seattle, Washington
Our Federal taxpayer I.D. number is: 91-1382828
Purchase Order Number (optional): ___________________________
[ ] Charge my Visa or Mastercard
Cardholder's Name: __________________________________________
Credit Card #: ____________________________ Expires:____/____
- 7 -
License Agreement
You are hereby granted permission to use this software and to
distribute copies of the software and documentation in its
original form as long as it is not distributed for profit
(handling fees less than $5.00 are ok). ONLY COPIES OF THE
SHAREWARE VERSION OF THIS SOFTWARE AND DOCUMENTATION MAY BE
DISTRIBUTED IN ANY FORM. You are not allowed to make copies
(except for backup purposes only) or distribute this software and
documentation once the software has been registered.
THE SOFTWARE HEREIN ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE PROGRAMS IS WITH YOU.
IN NO EVENT SHALL CALCTECH OR ANY OF IT'S OFFICERS, DIRECTORS,
SHAREHOLDERS, EMPLOYEES, AFFILIATES, OWNERS, OR OTHER RELATED
PARTIES BE LIABLE TO YOU OR ANY OTHER THIRD PARTY FOR DAMAGES
INCLUDING ANY LOST PROFITS, LOST SAVINGS, OR OTHER INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF OR THE INABILITY
TO USE THIS PRODUCT OR AS TO THE PERFORMANCE OF THIS PRODUCT EVEN
IF WE HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES IN
ADVANCE.
SOME STATES DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY
FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES SO THE ABOVE LIMITATION
OR EXCLUSION MAY NOT APPLY TO YOU.
THIS AGREEMENT IS GOVERNED BY THE LAWS OF THE STATE OF
WASHINGTON.
Trademarks/Copyrights
HP-11C, HP-12C, and HP-16C are trademarks of Hewlett-Packard Co.
Lotus is a trademark of Lotus Development Corp.
Intel is a trademark of the Intel Corp.
PC-DOS, IBM-PC, PC-XT, PC-AT and PS/2 are trademarks of IBM.
MS-DOS, Microsoft Windows and Microsoft Word are trademarks of
Microsoft Corp.
Copyright (C) 1987-1990, 1991 by CalcTech Inc.
All rights reserved.
Specifications herein are subject to change without notice.
- 8 -
TABLE OF CONTENTS
Section Title Page
1. Getting Started .......................................... 11
1.1 Introduction ......................................... 11
1.2 Other Guides ......................................... 11
1.3 System Requirements .................................. 11
1.4 Installing XACT-16C and Making Backups ............... 12
1.5 Command Line Options & Changing Hot Keys ............. 12
1.6 Using XACT-16C with Microsoft Windows ................ 13
1.7 Using XACT-16C on a Network .......................... 13
2. Running XACT-16C .......................................... 14
2.1 XACT-16C as a Standalone DOS Program ................. 14
2.2 XACT-16C as a TSR Program ............................ 14
2.3 XACT-16C as a Removable TSR Program .................. 15
3. XACT-16C Basics ........................................... 16
3.1 Keyboard Conventions ................................. 16
3.2 Function Key Usage ................................... 16
3.3 Prefix Keys .......................................... 16
4. Features .................................................. 17
4.1 Getting Help ......................................... 17
4.2 Viewing the Tape ..................................... 17
4.3 Stamping the Tape .................................... 17
4.4 Printing the Tape .................................... 17
4.5 Storing the Tape ..................................... 17
4.6 Loading a Program .................................... 18
4.7 Storing a Program .................................... 18
4.8 ASCII Table .......................................... 18
5. USING XACT-16C ............................................ 18
5.1 Prefix Keys .......................................... 18
5.2 Clearing the Display and Prefix Keys ................. 19
5.3 Entering Numbers ..................................... 19
5.4 Short Cut Keys ....................................... 20
5.5 RPN Logic, the Stack, and the ENTER key .............. 20
5.6 Stack Operations ..................................... 21
5.7 Memories and Memory Operations ....................... 21
5.8 The Index Register and Using Memories Indirectly ..... 22
5.9 Modes of Operation and Word Size ..................... 22
5.10 1's Complement Numbers ............................... 22
5.11 2's Complement Numbers ............................... 22
5.12 Unsigned Numbers ..................................... 23
- 9 -
Section Title Page
5.13 Word Size ............................................ 23
5.14 "SHOW" Functions ..................................... 23
5.15 Display Windows ...................................... 24
5.16 Flags ................................................ 24
5.17 Status ............................................... 25
6. Arithmetic, Bit Manipulation, and Logical Functions ....... 26
6.1 Addition and Subtraction ............................. 26
6.2 Multiplication and Division .......................... 26
6.3 Remainder after Division ............................. 27
6.4 Square Root .......................................... 27
6.5 Absolute Value ....................................... 27
6.6 Logical Functions .................................... 27
6.7 Bit Functions ........................................ 28
6.8 Summing Bits ......................................... 29
6.9 Masking .............................................. 29
6.10 Left Justify ......................................... 29
7. Shifting and Rotating Bits ................................ 30
7.1 Shift Functions ...................................... 30
7.2 Rotate Functions ..................................... 30
8. Floating Point Mode ....................................... 31
8.1 Converting to Floating Point Mode .................... 31
8.2 Floating Point Calculations .......................... 31
8.3 Returning to Integer Mode ............................ 32
9. Programming XACT-16C ...................................... 32
9.1 Introduction to Programming .......................... 32
9.2 Entering a Program ................................... 32
9.3 Labels in Programs ................................... 34
9.4 Using Subroutines .................................... 34
9.5 Returning from a Program or Subroutine ............... 34
9.6 Entering Data and the Run/Stop Key ................... 34
9.7 Branching Using the Index Register ................... 35
9.8 Program Loops Using the Index Register ............... 35
9.9 Program Loops and Branches Using the X and Y Registers 36
9.10 Branching Using Flags ................................ 36
9.11 Branching On Bit Set/Clear ........................... 37
9.12 The Single-Step Instruction .......................... 37
9.13 Moving to a Program Line Number ...................... 37
10. Appendix ................................................. 38
10.1 Error Conditions ........................................ 38
- 10 -
1. Getting Started
1.1 Introduction
XACT CALCULATORS are software which emulate the functions of the
handheld models of Hewlett-Packard's HP-11C Scientific, HP-12C
Financial, and HP-16C Programmer's calculators. If you are
familiar with one or more of these calculators, you will find
that you already know how to use XACT CALCULATORS. If not,
you'll find XACT CALCULATORS easy to learn and use. They will
become an invaluable tool in your work.
XACT-16C is the Programmer's Calculator program. XACT
CALCULATORS also incorporate the XACT-11C Scientific Calculator
and the XACT-12C Financial Calculator.
If you are already familiar with DOS and with the HP-16C, you may
only need to read Chapters 2 and 3. This will provide enough
information to get you started.
If you are new to DOS and/or the HP-16C, you may wish to read, or
at least skim, Chapters 1 through 8.
1.2 Other Guides
There are a number of guides and references available for the
HP-16C that can be used with XACT-16C as well. These are
generally available in bookstores and other places where Hewlett-
Packard calculators are sold. Some of these publications are
listed below
"HP-16C Owner's Handbook and Problem Solving Guide" Covers
general operations, functions, applications, and programming of
the HP-16C. Published by the Hewlett-Packard Company.
"An Easy Course in using the HP-16C" by Ed Keefe. Published by
Grapevine Publishing, Inc. P.O. Box 118, Corvallis, OR, 97339.
1.3 System Requirements
To operate the XACT-16C Calculator, you will need an IBM PC, PC-
XT, PC-AT, PS/2, or close compatible equipped with at least the
following:
256K RAM
PC-DOS or MS-DOS version 3.00 or later
- 11 -
1.4 Installing XACT CALCULATORS and Making Backups
You should make a copy of the programs contained on the XACT
CALCULATORS diskette for backup purposes. Use the DOS "copy"
command to copy all the files to another diskette or to your hard
disk. There may be a file named README.DOC on your disk. If so,
you should examine it using your word processor or the DOS "type"
command.
1.5 Command Line Options & Changing Hot-Keys
A command line option is an additional command typed when you
first load X16.EXE or XSHELL.EXE. There are several of these
options available. For example, if you wish to start XACT-16C in
octal mode, you would type:
x16 /radix=o [ENTER]
([ENTER] means press the ENTER key). As another example, to start
up XACT-16C with an 8 bit word size and the mouse disabled:
x16 /nomouse /wsize=8
The following is a list of available command line options when
running XACT-16C.
/mono Force XACT-16C into monochrome mode
/sci Start up in scientific notation (XACT-11C only)
/nomouse Disable mouse operation
/nosignon Disable the signon screen
/swap=<path> Directory/Path used to store swap files
/wsize=nn Set word size (XACT-16C only). Valid settings
for nn are 2 to 64.
/radix=n Set radix (XACT-16C only). Valid settings for
n are h,d,o,b, or f (hex,dec,oct,bin,float)
There are additional command line options available when running
the program XSHELL.EXE. The following is a list of these
options.
/alt Changes invocation key to Alt-s (XACT-11C),
Alt-f (XACT-12C), Alt-p (XACT-16)
/alt-ctrl Change invocation key to Alt-Ctrl-s (XACT-11C),
Alt-Ctrl-f (XACT-12C), Alt-Ctrl-p (XACT-16C)
/mono Force XACT CALCULATORS into monochrome mode
/sci Set scientific notation (XACT-11C only)
/noems Disable EMS memory usage (if EMS memory present)
/nomouse Disable mouse operation
/nosignon Disable the signon screen
/swap=<path> Directory/Path used for swap files. (See section
on using XACT CALCULATORS on a network)
/wsize=nn Set word size (XACT-16C only). Valid settings
for nn are 2 to 64.
- 12 -
/radix=n Set radix (XACT-16C only). Valid settings for
n are h,d,o,b, or f (hex,dec,oct,bin,float)
1.6 Using XACT-16C with Microsoft Windows
If you use Microsoft Windows, you may wish to set up Windows to
run XACT-16C. XACT-16C will run as an ordinary "text mode"
application under Windows which can be set up to be either
windowed or in full screen mode.
To run XACT-16C under Windows, you should first create a PIF file
which is used to "describe" the program to Windows. Use the PIF
editor (pifedit.exe) to create an x16.pif file. For the
"optional parameters" field, type in /nosignon so that XACT-16C
won't display it's startup screen every time you click on it's
icon. Also make sure that the "KB required" field is set to 128.
(For additional information on using the PIF editor, see your
Windows documentation).
Once you have created a PIF file, you will probably want to
create an icon so you can easily invoke XACT-16C by double
clicking on an icon. We have supplied a custom icon you can use
to do this. From the Windows program manager, create a new
program item and in the "command line" field, type in x16.pif.
Then select the "change icon" button and type in xact.ico. (If
you're unclear on these procedures, they're also covered in
Microsoft's Windows documentation).
1.7 Using XACT-16C on a Network
XACT-16C and all XACT CALCULATORS are compatible with most
networks. If you wish to use them on a network, read the
following information.
All XACT CALCULATORS use a technique known as swapping in order
to save memory as well as save the state of each calculator each
time you finish using it. Swapping creates a number of
"temporary" files. By default, these files are saved in the same
directory as the XACT CALCULATOR programs themselves. If two or
more users on a network are running a calculator, their swap
files will eventually corrupt each other, causing unpredictable
results. There are 2 different ways to avoid this problem. Both
involve changing the directory in which the swap files are
stored.
The first method is by using an environmental variable to tell
XACT CALCULATORS the path to use to store its swap files. For
example, assume you have 2 network users (Jan and Bill) each of
which have access to network drive N:. Assume also that the
directorys N:\USER\JAN\TEMP and N:\USER\BILL\TEMP have already
been created on drive N: The environmental variable can be set
by putting the following statement in Jan's AUTOEXEC.BAT file:
- 13 -
SET XACT=N:\USER\JAN\TEMP
whereas Bill's AUTOEXEC.BAT file would contain the statement:
SET XACT=N:\USER\BILL\TEMP
Now even though Jan and Bill may be running the same copy of one
of the calculators, they would each have separate copies of swap
files and there would be no conflict.
The second method uses the same idea, however, the swap path is
chosen from the command line. For example:
X16 /SWAP=C:\TEMP
would place the swap files in the directory C:\Temp, assuming it
existed.
2. Running XACT-16C
2.1 Running XACT-16C as a stand-alone DOS program
To run XACT-16C, at the DOS prompt type:
x16 [ENTER]
2.2 Running XACT-16C as a TSR program
To run XACT-16C as a TSR program, type
xshell [ENTER]
You will see the copyright message appear on the screen. The
computer will then return to the DOS prompt and appear as if
nothing had happened. However, the XACT CALCULATORS shell
program has now been loaded into your computer's memory. To
activate XACT-16C, press:
Alt-Shift-P
XACT-16C will now appear on your screen, ready to perform
calculations. To exit from XACT-16C, press the Esc key. In a
likewise fashion, to run the XACT-11C scientific calculator, you
would instead press Alt-Shift-S, and to run the XACT-12C
Financial calculator you would press Alt-Shift-F. You can also
unload XSHELL from RAM by pressing Alt-Shift-U.
When you run XSHELL, it will use between 1.5K and 6K bytes of
your computer's RAM. To determine exactly how much memory XSHELL
is using, you can run the DOS command "chkdsk" both before and
- 14 -
after running XSHELL and noting the difference in memory bytes
free. If you are unfamiliar with this command, see your DOS
reference manual.
EMS (Expanded memory specification) memory is a type of memory
specification that was developed jointly by Lotus, Intel, and
Microsoft. EMS memory was developed as a work-around to get
around the 640K DOS memory limitation. In order to use EMS
memory, a program must be written specifically to use EMS memory
(if available). XSHELL is such a program. If you have an EMS
memory board installed in your computer, XSHELL will put as much
of itself in EMS memory as it can and will also "swap" your
computer's memory to EMS memory when you pop-up a calculator.
With EMS memory installed, XSHELL will require less than 1.5K of
DOS memory!. If you don't have EMS memory but have a 386
computer, there are several commercial programs available which
can "simulate" EMS memory.
Even if you don't have EMS memory installed, XSHELL requires less
than 6K bytes of DOS memory. Without EMS memory, XSHELL will
swap to disk, creating the file XSHELL.SWP. This file may be as
large as 131k bytes.
If you have not registered your copy of XACT CALCULATORS, you
will only be able to use them as a TSR program for 8 minutes
before they automatically unload themselves from memory. After 8
minutes, you will hear a tone telling you that XSHELL is
unloading. You will have to run XSHELL again in order to use
XACT CALCULATORS as a TSR. Once you have registered and received
your serial number and unlock code, you can enter these numbers
into the program QUICKREG.EXE which will remove the 8 minute
limit from XSHELL. You can always run X16.EXE as a (non-TSR) DOS
program without any limitations whatsoever.
2.3 XACT-16C as a Removable TSR Program
When the shell program is loaded as a TSR program as in section
2.1 above, it remains loaded in your computer's memory until your
computer is rebooted or powered off. To unload the shell
program, press:
Alt-Shift-U
Unloading the shell program will not work if any other TSR
programs have been loaded after XSHELL.EXE. Unfortunately, this
is a limitation of DOS itself.
- 15 -
3. XACT-16C Basics
3.1 Keyboard Conventions
Throughout this manual, XACT-16C function keys are denoted within
a box. For example, the function key for a left shift (SL) is
shown as [SL]. In the case of function keys which require a
prefix key (discussed in the next section), the prefix key is not
given in this manual since it can easily be determined.
Keys on the PC keyboard are listed in this manual using single
quotes such as 'a'. Numbers to be entered into XACT-16C are
shown in normal type, except for the hex numbers A through F
which are shown as function keys.
3.2 Function Key Usage
XACT-16C has approximately 70 different function keys arranged in
the same ordering as on the HP-16C. Function keys are arranged
in groups of up to 3 functions per key; an upper, a lower and a
middle function all correspond to one function key. The upper
and lower functions are invoked by first pressing a prefix key
(discussed in the next section) and then the function key. The
middle function does not require the use of a prefix key. The PC
keystroke corresponding to function key is shown immediately to
the left of the function box.
The first row of function keys use the PC keys F1 through F10.
The second through fourth rows use the alphabetic characters as
arranged left to right on your PC keyboard.
For example, the XACT-16C's [Sto] (store) function key is mapped
to the letter 'v' on the PC keyboard. Likewise, the [ A ]
function key is invoked by pressing F1.
3.3 Prefix Keys
The left and the right shift keys on the PC keyboard operate as
prefix keys, functionally equivalent to the gold [ f ] and the
blue [ g ] keys on the HP-16C. They let you activate the upper
and lower sets of functions assigned to a function key. The left
shift key on the PC is used as a prefix key to activate the upper
set of functions. The right shift key is used as a prefix key to
activate the lower set of functions. For example, to invoke the
[SR] function, you would press and release the left shift key,
then press F2. To invoke the [ASR] function, you press and
release the right shift key, then F2. Likewise, to invoke the
[sqrtx] function, you would press and release the right shift
key, then press 't'.
- 16 -
4. Features
4.1 Getting Help
A Help menu is available when you are working with XACT-16C. To
obtain help press:
Alt-F1
An information screen will appear in a window. The help menu can
be removed by pressing F1 again.
4.2 Viewing the Tape
XACT-16C provides a simulated tape display which keeps a record
of your calculations as you perform them. To view the tape
press:
Alt-F2
The tape will appear in a window. To remove the tape, press F2
again.
4.3 Stamping the Tape
To stamp a message on the simulated tape press:
Alt-F4
The message will appear on the tape as well as the printer or
tape disk file if either of these options are being used.
4.4 Printing the Tape
To print the tape as you make calculations press:
Alt-F5
To turn off printing, press F5 again.
4.5 Storing the Tape
The simulated tape may be saved to a disk file as you make
calculations. Each time you use XACT-16C, calculations are
appended to the tape file. To store the tape, press
Alt-F6
- 17 -
The tape will be saved under the name X16.ASC in the directory
which you started XACT-16C in.
4.6 Loading a Program
To load a program previously saved press:
Alt-F7
A window will appear requesting a file name. Enter the DOS
filename of the program you wish to retrieve.
4.7 Storing a Program
XACT-16C allows you to save programs as disk files. To save a
program on disk, press:
Alt-F8
A window will appear prompting you for comments. You can enter
up to 3 lines of comments, associated with the program you are
saving. Press the Esc key after you have entered any comments.
Another window will appear prompting you for a filename. Enter
any valid DOS filename.
4.8 ASCII Table
An ASCII table will appear in a window over XACT-16C by pressing
Alt-F10
Press the PgUp or PgDn keys to move through the ASCII table, or
press Esc to remove the ASCII table.
5. USING XACT-16C
5.1 Prefix Keys
The left and the right shift keys on the PC keyboard operate as
prefix keys, functionally equivalent to the gold [ f ] and the
blue [ g ] keys on the HP-16C. They let you activate the upper
and lower sets of functions assigned to each PC key. The left
shift key on the PC is used as a prefix key to activate the upper
set of functions. Likewise, the right shift key is used as a
prefix key to activate the lower set of functions. The prefix
keys are "sticky", that is, you press a prefix key and it remains
set, even after you release the key. When you press and release
a prefix key, the corresponding set of prefixes will highlight,
- 18 -
indicating which prefix was set. To clear a prefix key, use the
[PRFX] function.
For example, to activate the [HEX] function, press the letter 'e'
on the PC keyboard. On the other hand, the [DSZ] function key is
mapped to the same PC key as the [Hex] function but requires a
prefix key. To invoke the [DSZ] function, press and release the
right shift key, (the lower prefix key), and then press the
letter 'e'.
The prefix keys can also be invoked using the function keys [ f ]
and [ g ].
5.2 Clearing the Display and Prefix Keys
To clear a number in the display, press the [CLx] (Clear X
Register) key. The display will now contain the value 0. While
entering a number, you may clear the last digit entered with the
[BKSP] key. For example, if you meant to enter the number 1234
and mistakenly entered 1235, press [BKSP] and then press 4 to
correct the number. To clear a prefix key, i.e., the lower or
the upper prefix, press the [PREFIX] key. To clear all memory
storage registers, press [REG]. This key doesn't affect values
stored in the stack or the LastX register.
5.3 Entering Numbers
Numbers are entered into XACT-16C by using the numeric keys or
the numeric keypad for the numbers 0 through 9, and the keys
mapped to the hex numbers A through F on the PC keyboard. The
decimal point key is only operational in floating point mode and
is mapped to the '.' key on the numeric keypad. Notice that
XACT-16C will not accept certain numbers in integer mode
depending on the radix value being used. If the radix is Bin
(Binary), XACT-16C will only accept the numeric digits 0 and 1,
all others are ignored. When using the Octal radix, only the
digits 0 through 7 are valid, and so on. XACT-16C will accept
only as many entered digits as the current word size and
complement mode will allow. For example:
Keystroke Display Comment
================================================================
[Dec] Set decimal mode
8 [Wsize]
[2's] 2's comp. 8 bit
255 -1 Dec
[Unsgn] 255 Dec
The number 255 (FF Hex) cannot be represented using 2's
complement 8 bit math. Since the high order bit (interpreted as
a sign bit) is a 1, the 2's complement of the number is formed.
- 19 -
When unsigned math is used, the number is interpreted correctly.
Notice that if you tried to enter the number 256 (100 Hex) while
operating with a word size of 8 bits, the last digit would not
be accepted since 256 requires a word size of at least 9 bits to
be represented.
5.4 Short Cut Keys
You can use the Enter key on the PC, (also known as the Return
key) as the XACT-16C [ENTER] key as a short cut. Also, the '+',
'-', '*', and '/' keys adjacent to the numeric keypad function
as you would expect.
5.5 RPN Logic, the Stack, and the ENTER key
You may already be familiar with Reverse Polish Notation (RPN).
RPN is a type of calculator logic that eliminates the need for
the equals key and for parenthesis in calculator computations.
Instead, operands are entered into the calculator and separated
using the [ENTER] key. For example, to add the numbers 3 and 4:
Keystroke Display Comment
================================================================
[Dec] Decimal mode
3 [ENTER] 3 Dec
4 [ + ] 7 Dec Add
The result, 7, is now displayed. To multiply this result by 5:
Keystroke Display Comment
================================================================
5 [ * ] 35 Dec
The way that XACT-16C performs these calculations with RPN is by
using a stack. The stack consists of 4 registers: X, Y, Z, and
T. It is not generally necessary to understand the internal
workings of the stack but for completeness they will briefly be
discussed below.
Any number displayed is said to be in the X register. When the
[ENTER] key is pressed, a number in the X Register is pushed into
the Y Register and the previous number in the Y Register is
pushed into the Z Register. The previous number in the Z
register is pushed into the T Register. T stands for "Top" and
represents the top of the stack of numbers. The previous value
of the T register is lost. When a function key such as the [+]
key is pressed, the value held in the Y register is added to the
X register and this result is now stored in the X register.
Pressing [ENTER] does one other thing, it leaves the stack
disabled. This means that a number entered after the [ENTER] key
has been pressed is not pushed on the stack, it remains in the X
- 20 -
register. Most operations enable the stack so that when a new
number is entered, the previous contents of the X register are
pushed into the Y register. The most notable exceptions to this
rule are the [ENTER] and the [Clx] function keys.
5.6 Stack Operations
Roll Up - The [R|] (shown on XACT-16C as a 'R' followed by an
arrow pointing up) function rolls up the stack. The X register
is copied into the Y register. The Y register is copied into
the Z register, and the Z register is copied into the T
register. The T register is "rolled around" into the X register.
Roll Down - The [R|] (shown on XACT-16C as a 'R' followed by an
arrow pointing down) function rolls down the stack. The T
register is copied into the Z register. The Z register is
copied into the Y register, and the Y register is copied into
the X register. The X register is rolled around into the T
register.
X exchange Y - The [x<>y] function exchanges the contents of the
X and Y registers.
Last X register - The [LSTx] register holds the previous contents
of the X register before an operation was performed. The [LSTx]
register is used to restore the number entered if an incorrect
function key is mistakenly pressed.
5.7 Memories and Memory Operations
XACT-16C has 16 memories that can be used for storing and
recalling numbers. These memories are called memory registers
and are referred to as registers R0 through R9 and RA through
RF. To store a number in a memory, press [Sto] n, where n is a
number 0 through 9 (using the numeric keypad) or hex number [A]
through [F].
For example:
Keystroke Display Comment
================================================================
32 [Sto] [ A ] 32 Dec 32 in register RA
14 [Sto] 2 14 Dec 14 in register R2
[Rcl] [ A ] 32 Dec Recall reg. RA
[Rcl] 2 [ + ] 46 Dec Add to reg. R2
Notice in the preceding example that the [ A ] key is a mapped
XACT-16C key, not the letter 'A' on the PC keyboard (it is
invoked by pressing the F1 key on the PC keyboard.
- 21 -
5.8 The Index Register and Using Memories Indirectly
Memories can also be accessed indirectly using the Index
register. The index register is accessed with the [ I ]
function key. A number may be stored in the index register
using [Sto] [ I ] and recalled from the index register using
[Rcl] [ I ]. Also, the [x<>I] function key is used to exchange
the X register with the Index Register in the same fashion as the
[x<>y] function key is used to exchange the X and Y registers.
For the examples below, assume STATUS= 2-16-0000.
Keystroke Display Comment
================================================================
5 [Sto] [ I ] 5 Dec Register I= 5
20 [Sto] [(i)] 20 Dec Register 5= 20
[CLx] 0 Dec Clear X reg
[Rcl] 5 20 Dec Reg 5= 20
In the above example, the Indirect Index Register [(i)] was used
to store a number indirectly. The memory register accessed was
determined by the contents of the [I] register. Memories can
also be recalled indirectly using the operation [Rcl] [(i)], and
exchanged with the X register indirectly using the [x(i)]
function.
5.9 Modes of Operation and Word Size
XACT-16C operates in 2 modes, integer and floating point. Integer
mode is active when any of the following radix conversion
function keys are pressed: [HEX], [DEC], [OCT], [BIN]
These keys allow numbers in integer mode to be displayed in hex,
decimal, octal and binary respectively. In addition, numbers in
integer mode may be interpreted as unsigned values, or as 1's
complement or 2's complement numbers using word sizes from 2 to
64 bits.
5.10 1's Complement Numbers
To use 1's complement arithmetic, press [1's]. All numbers and
operations entered while in integer mode will be interpreted as
1's complement numbers. Pressing the [ChS] function key will
display the 1's complement of a number in the display.
5.11 2's Complement Numbers
Pressing [2's] will activate 2's complement arithmetic when in
integer mode. All operations subsequently performed will be done
using 2's complement arithmetic. 2's complement mode is the
default mode when XACT-16C is first loaded.
- 22 -
5.12 Unsigned Numbers
Pressing [Unsgn] will activate unsigned arithmetic when in
integer mode. All arithmetic operations will be interpreted
using unsigned math. When the [ChS] key is pressed, the result
has no meaning. However, the 2's complement of the number is
displayed along with the Overflow flag, shown as the letter 'G'
to the right of the number.
5.13 Word Size
In decimal mode, XACT-16C can operate using any word size from 2
to 64 bits. To set the word size, enter a number from 2 to 64
and press [Wsize]. Notice that if you're using a small word
size, say 4 bits, you won't be able to enter the number into the
calculator larger than +3 (if you're in 2's complement mode).
Thus, you won't be able to increase the word size to say 16 bits
without first resetting the word size to 64 bits.
To reset the word size to 64 bits, press 0 [Wsize]. This will
allow you to then set a word size of say 16 bits if, for
example, you were previously using a 4 bit word size and thus
couldn't enter the number 16 to set a 16 bit word size.
Changing word size will affect numbers held in the XACT-16C
registers. For example:
Keystroke Display Comment
================================================================
[Dec]
16 [Wsize] 16 bit word size
[2's] [Hex] 2's compl, hex
4E20 [ENTER] 4E20 Hex
8 [Wsize] 20 Hex 8 bits word size
Notice when the display was set to 8 bits, the number in the
display was truncated to 8 bits.
5.14 "SHOW" Functions
XACT-16C will display a number in a different radix for about 2
seconds, then revert back to the current radix, whenever the
[Show] function key, immediately above that radix key, is
pressed. For instance, say you have pressed [Bin] to select
binary as your default radix. You may view a number temporarily
in hex by pressing the [Show] key immediately above the [Hex] key
(press the left shift key, then press the letter 'e').
- 23 -
5.15 Display Windows
In decimal mode, XACT-16C can show up to 8 digits on it's
display. Since XACT-16C is capable of word sizes up to 64 bits,
in some cases, not all the digits can be shown on the display at
a time. For example:
Keystroke Display Comment
================================================================
[Hex]
10 [Wsize] 16 bit word
7B2 [Bin] <- 10110010 Bin More digits left
[Wndo] 1 111 -> Bin Leftmost 8 bits.
[Wndo] 0 <- 10110010 Bin Reset window
The number 7B2 Hex (11110110010 Bin) cannot be displayed within 8
digits. Only the lower order 8 bits are displayed. The [Wndo] 1
key sequence sets the display window to the next higher order 8
bits, bits 7 through 15. Likewise, [Wndo] 2 would be used to
display bits 8 through 23 and so on. In the current example,
the number 7B2 is an 11 bit number. Setting [Wndo] 2 would show a
blank display.
Windows may also be "scrolled" one digit at a time. To scroll
the window one digit to the right press [>>]. To scroll the
digit to the left, press [<<]. Window scrolling is reset back to
window 0 whenever an operation key affecting the value displayed
is pressed.
5.16 Flags
XACT-16C incorporates 6 built in "flags" which may be set or
cleared under either program control, or as the result of an
operation, or both. The flags are numbered 0 through 5. Flags
are active in integer mode.
The first 3 flags, 0 through 2, are used in programming only.
These flags can be set, cleared, and tested within a program.
These flags are discussed in detail in the section under
Programming.
Flag 3 is used to control the display of leading zeros in integer
mode. When set, a number in the display will be padded with
leading zeros (leading zeros will not be displayed when the [Dec]
radix is used). To set flag3:
Keystroke Display Comment
================================================================
[Hex]
10 [Wsize] 16 bit word, hex
3A [ENTER] 3A Hex
- 24 -
[SF] 3 003A Hex Set flag 3
[CF] 3 3A Hex Clear flag 3
Flag 4 is also known as the Carry (C) flag. It is set when the
result of an algebraic or bit manipulation function generates a
carry. When performing a subtraction, a carry is generated
whenever there is a borrow in the most significant bit.
Keystroke Display Comment
================================================================
[Hex]
10 [Wsize] [2's]
FF80 [ENTER] FF80 Hex (-128 Decimal)
100 [ + ] 80 Hex C Carry generated
1 [ + ] 81 Hex No carry
Flag 5 is also known as the Overflow (G) flag. It is set by an
arithmetic operation which would result in a value which cannot
be shown with the current word size and/or complement mode. When
Flag 5 is set, the letter 'G' appears in the display, indicating
an overflow. For example:
Keystroke Display Comment
================================================================
[Dec]
16 [Wsize] [2's]
32767 [ENTER] 32767 Dec
16384 [ + ] -16385 Dec G
In the above example, the result created an overflow and the 'G'
flag (overflow) was displayed.
5.17 Status
Pressing the [Stat] function key temporarily alters the display
to show the current complement mode, word size and flags 0
through 3. When [Stat] is pressed, the display appears similar to
the following:
2-16-0000
The value above indicates 2's complement mode, 16 bit word size,
and flags 3,2,1,0 are all cleared.
The first number, shown before the dash, indicates the complement
mode. It is either 0, 1, or 2, for unsigned, 1's complement, or
2's complement respectively. The next number indicates the
current word size in bits. It may range from 1 to 64. The last
- 25 -
4 digits indicate the status of flags 3,2,1,0 in that order. A
value of 1 indicates the flag is set, 0 indicates it is cleared.
6. Arithmetic, Bit Manipulation, and Logical Functions
6.1 Addition and Subtraction
XACT-16C can perform the operations of addition and subtraction
using decimal, hex, binary, and octal radix types as well as
floating point mode. For example, to add the numbers 3c0 hex,
and 126 octal, and then subtract 35 decimal, (assuming STATUS=
2-16-0000):
Keystroke Display Comment
================================================================
[Hex]
3C0 [ENTER] 3C0 Hex
[Oct] 1700 Oct
126 [ + ] 2026 Oct
[Dec] 1046 Dec
35 [ - ] 1011 Dec
The result is 1011 (decimal). The carry flag will be set when
the addition of 2 numbers generates a carry out of the most
significant bit, or when the subtraction of 2 numbers generates a
borrow from the most significant bit.
6.2 Multiplication and Division
Multiplication and division operations can be performed in any
available radix. Results of these operations may set or clear
flag 4 (carry) and flag 5 (overflow) just as in addition and
subtraction (except that multiplication does not affect flag 4).
In a division operation, only the integer portion of the result
is returned, the decimal point part is truncated. Flag 4 (carry)
will be set if the result of the division has a non-zero
remainder.
Keystroke Display Comment
================================================================
[Dec]
12 [ENTER] 12 Dec 12 in X register
4 [ * ] 48 Dec Multiply 12 * 4
5 [ / ] 9 Dec C C Indicates remainder
- 26 -
6.3 Remainder after Division
To compute the remainder after division, (also known as the mod
function), use the [RMD] function key. The [RMD] key will yield
the result of the Y register mod the X register with the sign of
the result set to be the same as the sign of X. In the example
below, assume STATUS= 2-16-0000.
Keystroke Display Comment
================================================================
[Dec]
52 [ENTER] 52 Dec 52 in Y register
7 [RMD] 3 Dec Remainder
6.4 Square Root
The [sqrtx] function can be used in either decimal or floating
point mode. In decimal mode, the fractional part of the result
is truncated just as it is in division. Likewise, flag 4 (carry)
will be set if the fractional part of the square root is non-
zero. Assuming STATUS= 2-16-0000:
Keystroke Display Comment
================================================================
[Dec]
26 [sqrtx] 5 Dec C
The carry flag indicates that a fractional part exists.
6.5 Absolute Value
This function will take the absolute value of a number in the X
register when the [Abs] key is pressed. In unsigned mode, this
function has no effect. Otherwise, a negative number will form
the 1's or 2's complement of the number.
6.6 Logical Functions
The [AND] function logically and's together the corresponding
bits in the X and Y registers and forms the result in the X
register. A particular bit of the result is set to 1 only if the
corresponding bits in both the X and Y registers was set to 1.
For example (assume STATUS= 2-16-0000):
Keystroke Display Comment
================================================================
[Bin]
1010 [ENTER] 1010 Bin
11 [AND] 10 Bin Result of "and"
- 27 -
The [OR] function forms a result by or'ing together corresponding
bits in the X and Y registers. A bit in the result will be set
to 1 if a corresponding bit in either the X or the Y registers
is set to 1. In the example below, assume STATUS= 2-16-0000:
Keystroke Display Comment
================================================================
[Bin]
1001 [ENTER] 1001 Bin
11 [OR] 1011 Bin Result of OR
With the [XOR] (Exclusive OR) function, a bit in the result is
set to 1 if either a corresponding bit in the X register or the Y
register, but not both, is set to 1. In the example below,
assume STATUS= 2-16-0000:
Keystroke Display Comment
================================================================
[Bin]
1001 [ENTER] 1001 Bin
11 [XOR] 1010 Bin Result of XOR
The [Not] function complements all the bits of the value in the X
register. This is equivalent to forming the 1's complement of
the number. In the example below, assume STATUS= 2-16-0000:
Keystroke Display Comment
================================================================
[Hex] 9 9 Hex
[Not] FFF6 Hex Result of NOT
6.7 Bit Functions
A specific bit can be set (1) or cleared (0) within a number. To
set a bit, the [SB] function key is used. The [CB] function is
used to clear a bit. A bit can also be tested to see if it's
set or cleared with the [B?] function. (See the section on
Programming for more information on testing bits). When setting
or clearing a bit, the number in which the bit is to be set, must
be in the Y register and the bit number in the X register. In
the example below, assume STATUS= 2-16-0000:
Keystroke Display Comment
================================================================
[Bin]
10000 [ENTER] 100000 Bin 100000 in Y register
10 [SB] 10100 Bin Set bit 2
To clear a bit in a number:
- 28 -
Keystroke Display Comment
================================================================
[Hex]
FFFF [ENTER] FFFF Hex FFFF in Y register
4 [CB] FFEF Hex Clear bit 4
6.8 Summing Bits
The number of bits in a word can be found by using the [#B]
function. This function takes a number in the X register, and
returns the number of '1' bits, also in the X register. In the
example below, assume STATUS= 2-16-0000:
Keystroke Display Comment
================================================================
[Bin] 1101 1101 Bin
[#B] 11 Bin
[DEC] 3 Dec 3 bits were set
6.9 Masking
The mask functions form a mask of '1' bits in the X register. The
number of '1' bits is set to the value in the X register before
the mask function key was pressed. A mask can be made as large
as the current word size. The [MaskR] function right justifies
the mask and the [MaskL] function left justifies the mask. In
the example below, assume STATUS= 2-16-0000:
Keystroke Display Comment
================================================================
[Bin]
100 [MaskR] 1111 Bin Mask right
[Hex] F Hex
2 [MaskL] C000 Hex Mask left
6.10 Left Justify
A word in the X register can be left-justified using the [LJ]
function key. This operation returns the left justified number
in the Y register. The X register contains the number of '0'
bits preceding the first '1' bit in the number before being left
justified. In the example below, assume STATUS= 2-08-0000:
Keystroke Display Comment
================================================================
[Bin]
111 [LJ] 101 Bin 5 leading zeros
[R|] 11100000 Bin Roll Down stack
Rolling down the stack shows the left justified number.
- 29 -
7. Shifting and Rotating Bits
7.1 Shift Functions
XACT-16C can perform shift operations on numbers when in integer
mode. Shifts can be either logical or arithmetic. A logical
shift simply shifts bits left or right, bringing in a zero bit
from the end. An arithmetic shift is similar except that it
preserves the sign bit when shifting. Both types of shifts can
shift into the carry, causing flag 4 (C) to be set or cleared
accordingly. In the examples below, assume STATUS= 2-08-0000:
Keystroke Display Comment
================================================================
[Bin]
1001 [SL] 10010 Bin Logical shift left
01000000 [SL] 10000000 Bin Logical shift left
[SL] 0 Bin C Shift into carry.
100000000 [ASR] 11000000 Bin Brings in sign bit
7.2 Rotate Functions
Rotate functions are like shift functions except that a bit
shifted out of one end of a word is brought back in at the other
end. As in shifting, rotations can be either left or right using
the [RL] or the [RR] functions. Assume STATUS= 2-08-0000:
Keystroke Display Comment
================================================================
10000010 [RL] 101 Bin C
Rotations may also be made "through the carry". The [RRC] and
the [RLC] functions respectively shift the low order or the high
order bit into the carry. The carry flag (flag 4) will be set if
the bit rotating into the carry was a '1'. The previous state of
the carry flag will be brought back around at the other end.
Keystroke Display Comment
================================================================
1 [RRC] 0 Bin C Rotates to carry
[RRC] 10000000 Bin Carry rotates
Rotate operations may also rotate more than 1 bit at a time with
the [RRn] [RLn] [RRCn] and [RLCn] functions. Each of these
functions use the value in the X register as a count of how many
times to rotate the value in the Y register. Assuming STATUS=
2-08-0000:
Keystroke Display Comment
================================================================
1000 [ENTER] 1000 Bin
100 [RLn] 10000000 Bin Rotate 4 times
- 30 -
8. Floating Point Mode
8.1 Converting to Floating Point Mode
In addition to integer mode, XACT-16C also operates in floating
point mode. In this mode, XACT-16C acts much like a second
"independent" calculator. Many functions operate in either
floating point mode or integer mode, for example the [sqrtx]
function. However, unlike integer mode, this function will not
truncate a result to an integer result, it will return a value
with up to 9 significant digits beyond the decimal point.
To convert XACT-16C to floating point mode:
Keystroke Display Comment
================================================================
[Float] 2 0.00 2 dec pt digits
You may press any number (using the numeric keypad) from 0 to 9
after pressing the [Float] key. The number you press will
determine the number of digits past the decimal point to be
displayed. For example:
Keystroke Display Comment
================================================================
26 [sqrtx] 5.10 2 dec pt digits
[Float] 5 5.09902 5 dec pt digits
Notice that when using 2 digits beyond the decimal point,
XACT-16C will "round" the next digit into the number displayed.
8.2 Floating Point Calculations
Calculations in floating point mode work in the same way as in
integer mode. However, there are a number of functions that
operate only in integer mode and some that operate only in
floating point mode. Generally speaking, all of the bit
manipulation, radix conversion, and logical functions are not
available in floating point mode.
The reciprocal function [1/x] and the exponent function [EEx] are
only available in floating point mode. To illustrate them, for
example:
Keystroke Display Comment
================================================================
[Float] 4 4 dec pt digits
12 [EEx] 3 12. +03
[ChS] 12. -03
[ENTER] 0.0120
- 31 -
.001 [ - ] 0.0110 Subtract
[1/x] 90.9091 Reciprocal
8.3 Returning to Integer Mode
To return to integer mode, press any of the following: [Hex],
[Dec], [Oct] or [Bin]. You may notice that the same value
appears in the display as before you converted to floating point
mode. In fact, all the memory registers, stack, etc., are
retained.
9. Programming XACT-16C
9.1 Introduction to Programming
XACT-16C may be programmed to "memorize" keystrokes for the
purpose of executing a program. Programs may use constructs of
conventional programming languages such as branching, looping,
data input and output, etc. The basics of programming XACT-16C
involve entering, editing, debugging and finally executing your
program.
9.2 Entering a Program
To begin entering a new program into XACT-16C, the calculator
must be placed in program mode by pressing the [P/R] function
key. When in program mode, subsequent keystrokes are simply
stored in the calculator's internal memory. The [P/R] key toggles
between program and run modes.
Keystroke Display Comment
================================================================
[P/R] 000- Program mode
[P/R] (as before) Run mode
The display shows 000-. This represents the current program line
number of the program you are entering. Line 000 is special in
that it always represents the beginning of program memory.
Let's enter a simple program:
Keystroke Display Comment
================================================================
[P/R]
[Prgm] 000- Clear pgm
[Lbl] [ A ] 001- 43 22 A Start pgm
[Hex] 002- 23
3 003- 3
[ENTER] 004- 36
- 32 -
4 005- 4
[ + ] 006- 10
[RTN] 007- 43 21 Last pgm line
[P/R] Run mode
This program simply adds the numbers 3 and 4 then finishes. The
first keystroke, [P/R] puts XACT-16C in program mode. The [Prgm]
key clears any programs previously in memory. Skipping over the
[Lbl] instruction for the moment, the [Hex] key is the second
program line in the program. In the display, 002- indicates
program line 2 (there are a maximum of 203 program lines
available). Just to the right of the program line is a code
which represents which key was pressed. The first digit of the
number indicates the row and the second indicates the column of
where the key is positioned on the XACT-16C screen. If you think
of all the keystrokes on the calculator face as being in a table
with 4 rows and 10 columns, the [Hex] function key is located in
the 2nd row and 3rd column, thus the program line displays 002-
23. Back to the first line of the program, it contains the
keystrokes [Lbl] [ A ] to refer to that line as a label. Labels
are used in XACT-16C in much the same way as they are in assembly
language or Basic programming. Labels can be locations used to
identify the start of a program, the location of a goto
instruction, or the location to call in a subroutine call.
Programs must begin with a label to identify where the program
starts. The program line for our label reads 001- 43 22 A. In
this case, since the [Lbl] key requires a prefix, the position of
the prefix key is the first value shown to the right of the
program line number. The number 43 indicates row 4, column 3,
which is the position of the [ g ] (or right shift) prefix key.
The last value displayed on program line 2 is the value 'A'.
Notice that it is not referred to by a location in the "table"
of XACT-16C function keys, but rather by it's numeric value
itself. All the numbers 0 through 9 and A through F are shown
as their numeric values when in programming mode.
Notice the use of the [RTN] function key at the end of the
program. This key must always be the last entered, it is
required to end the program. In the very last line of the
program, you will notice the [P/R] key. It is used to exit from
program mode so that we can run the program.
Now we have our program contained in memory, we can run it by
typing:
Keystroke Display Comment
================================================================
[GSB] [ A ] 7 Hex Result
The [GSB] (goto subroutine) function key is used to begin program
execution at the first instruction in the program following the
- 33 -
label, in this case the label was A. The [GSB] instruction can
also be used within a program, to perform a call to a
subroutine.
9.3 Labels in Programs
There are 16 labels available in programming, 0-9 and A-F. The
previous example used a label to identify the beginning of a
program. In general, a label is always necessary to begin a
program. Labels are also used as targets of [GTO] (goto)
instructions and [GSB] (goto subroutine) instructions. Labels
can also be used to separate programs from one another in
XACT-16C's program memory; as a way of keeping multiple programs
in memory at one time (although this is generally not necessary
since programs can be loaded as disk files).
9.4 Using Subroutines
A program can call a subroutine from within the program when the
[GSB] instruction is used within the program. For instance, the
instruction [GSB] 5 will transfer control to the program
instruction immediately following the instruction [Lbl] 5
contained elsewhere within the program. Control will transfer to
the label that identifies the subroutine. Subroutines can "nest",
that is one subroutine may call another which may call another,
and so on. The maximum level of subroutine nesting is 4.
9.5 Returning from a Program or Subroutine
The last instruction in a program must always be a [RTN]. This
tells the program to reset it's program line number to 000 (go
back to the beginning) and stop executing. The [RTN] instruction
is also the last instruction in a subroutine. In this case,
after the execution of the [RTN] instruction, control is
transferred back to the instruction following the subroutine
call.
9.6 Entering Data and the Run/Stop Key
There are generally 2 ways to get data into a program. The
easiest is to use the [Sto] instruction to store data in
registers prior to running the program. Then the program can
contain [Rcl] instructions to fetch the data from the register.
The second method is required when there is more data to be input
than available storage registers. It involves using the [R/S]
(run/stop) function key. When this key is encountered during
program execution, the program stops. At this point, you can
enter new data and then press the [R/S] key. The program will
begin running again.
- 34 -
For example, let's write a program which will accept input
numbers, one at a time, and "exclusive or" each number with the
number 3A9 Hex. The program will display the exclusive or'd
result after each input.
Keystroke Display Comment
================================================================
[P/R]
[Prgm] Clear program memory
[Lbl] 1 001- 43 22 1
[Hex] 002- 23
1 003- 1
0 004- 0
[WSIZE] 005- 42 44
0 006- 0
[ENTER] 007- 36
[Lbl] 2 008- 43 22 2
[R/S] 009- 31
[ENTER] 010- 36
3 011- 3
A 012- A
9 013- 9
[x<>y] 014- 34
[XOR] 015- 42 10
[GTO] 2 016- 22 2
[RTN] 017- 43 21
[P/R] Return to RUN mode
To execute the program:
Keystroke Display Comment
================================================================
[Gsb] 1 0 Wait for input data
1 [R/S] 3A8 Hex Result of 3a9 xor 1
F [R/S] 3A6 Hex Result of 3a9 xor F Hex
20 [R/S] 389 Hex Result of 3a9 xor 20 Hex
9.7 Branching Using the Index Register
In the previous example, we used a [Gto] instruction to branch to
a label, in this case, label 2. As previously mentioned, there
are 16 available labels, 0-9 and A-F. You can also use the index
register [I] to indirectly branch to a label, or indirectly call
a subroutine. If the [I] register contains a number representing
a label, the instructions [GTO] [I] and [GSB] [I] will indirectly
branch to a label or indirectly call a subroutine.
9.8 Program Loops Using the Index Register
XACT-16C contains 2 instructions that first increment or
decrement the index register and skip the next program line if
- 35 -
the index register is zero. These instructions are [Isz]
(increment and skip if zero), and [Dsz] (decrement and skip if
zero). They can be used to control loops where the number of
times to execute the loop is contained in the index register.
For example, a program fragment may look similar to the
following:
5 [STO] [ I ]
[LBL] [ B ]
(instructions within loop)
[DSZ]
[GTO] [ B ]
[RTN]
In this case, the instruction within the loop between the [Lbl]
[B] program line and the [Gto] [B] program line will be executed
5 times. After the 5th time, the index register will contain 0
and the [Gto] [B] instruction will be skipped. Instead, the
[Rtn] instruction will be executed.
9.9 Program Loops and Branches Using the X and Y Registers
XACT-16C can also make "conditional tests" based upon values
contained in the X and Y registers. There are 8 different
possible conditions in all. These functions each execute the
next instruction in the program if the condition is true, and
skip over it if the condition is false. The instructions are
defined as
[x<=y] true if x less than or equal to y
[x<0] true if x less than 0
[x>y] true if x greater than y
[x>0] true if x greater than 0
[x<>y] true if x not equal to y
[x<>0] true if x not equal to 0
[x=y] true if y equal to y
[x=0] true if x equal to 0
9.10 Branching Using Flags
The [F?] (text flag) function can be used to branch based on the
status of the flags. There are a total of 6 flags in XACT-16C,
identified as flags 0-5. The first 3 flags (0-2) are
programmable general purpose flags. Flag 3 is used to display
leading zeros. Flag 4 is the Carry (C) flag, and Flag 5 is the
overflow (G) flag. Any of the flags may be used in branch
tests. The example below illustrates a program fragment
utilizing flags testing:
- 36 -
(Program instructions)
[Lbl] 3
[SF] 3
[Gto] [ B ]
(Program instructions)
[Lbl] 4
[CF] 0
[Gto] [ B ]
(Program instructions)
[Lbl] [ B ]
[F?] 0 (test to see if flag 0 is set)
[Gto] [ C ] (transfer control to label C if flag 0 set)
[Gto] [ D ] (transfer control to label D if flag 0 clear)
If the program executes at label 3, flag 0 is set and control is
transferred to label B. At this point, since flag 0 was set,
control will transfer to label C. Likewise, if the program
executes at label 4, flag 0 is cleared, and thus, when control
is transferred to label B, the flag test will fail. This will
cause the [Gto] [ D ] instruction to be executed.
9.11 Branching On Bit Set/Clear
Programs can branch on the status of a specific bit set or clear
using the [B?] function. This function operates similarly to the
[F?] function.
9.12 The Single-Step Instruction
The [SSt] (single-step) instruction can be used in either program
mode or run mode. In program mode, pressing [SSt] will display
the next program line number in a program. In run mode, the
[SSt] function can be used to execute a program one step at a
time. This is useful for program debugging. The [BSt] (back-
step) instruction works like the [SSt] instruction in program
mode except that it displays the previous program line number in
a program. The [Bst] instruction does not operate in run mode.
9.13 Moving to a Program Line Number
You can move to a specific line number in either program mode or
run mode. Press [Gto] [ . ] nnn where nnn is a 3 digit number
between 0 and 203. In run mode, pressing [R/S] will begin
execution at that line number.
- 37 -
10. Appendix
10.1 Error Conditions
When an error is encountered during operation, XACT-16C will
display the word "Error" in the calculator's display, followed
by a 1 digit error code. These error codes are defined below:
Error 0 - Invalid math operation. This error is encountered
when an operation attempted division by 0 or square root of a
negative number.
Error 1 - Invalid identifier. A flag, window, or program line
number was out of range.
Error 2 - Invalid Bit Number. This happens when operations
attempt to set bits, mask bits, or rotate multiple bits greater
than the current word size.
Error 3 - Invalid Register. An attempt was made to access a
label or line number that is out of range.
Error 4 - Invalid label or line number. An attempt was made to
access a label or line number that is out of range.
Error 5 - Invalid subroutine nesting. A subroutine was nested
more than 4 levels deep.
- 38 -