HP41 Ext Functions
HP41 Ext Functions
HP 82180A
)
A caciano
HP 82180A
Extended Functions/Memory Module
Owner’s Manual
November 1981
82180-90001
2
Contents 3
The HP 82180A Extended Functions/Memory Module adds a number of useful functions to those already
available on your HP-41 calculator and also provides you with extended memory. Extended memory can
be augmented by adding one or two HP 82181 A Extended Memory Modules, the use of which is also
described in this manual.
Extended Functions
The functions provided by the module can be grouped in the four categories described under the following
headings:
Programmable Functions
Some standard calculator functions, such as and that are not programmable, have
programmable equivalents in the module. Additional programmable functions that have no equivalent in
the basic calculator have been provided to make it easier to write efficient programs.
Extended Memory
By itself, the extended functions/memory module contains 127 extended memory registers.* In most
respects, these are like the calculator registers with which you are already familiar. The important
difference is that data stored in these registers is not immediately available to the calculator. Before such
data can be used it must first be moved into calculator main memory. This is discussed in sections 1 and 3
of this manual.
One or two HP 82181 A Extended Memory Modules may be used in conjunction with the HP 82180A
Extended Functions/Memory Module. Each will add 238 registers. Thus it is possible to add 603 registers
of extended memory to your HP-41C or HP-41CV.
* The memory registers provided by the HP 82180A Extended Functions/Memory Module and the HP 82181 A Extended Memory
Module are distinct from, and should not be confused with, registers R;(, through R3,4, in main memory—which are called extended
storage registers in the calculator owner’s handbook.
Section 1
Getting Started
The HP 82180A Extended Functions/Memory Module and the HP 82181 A Extended Memory Module can
be used with either the HP-41C or the HP-41CV calculator. The instructions in this manual apply to both
calculators.
CAUTION
Always turn your calculator OFF before inserting or removing any modules. If you don’t, the calculator
may be damaged or the system’s operation may be disrupted.
Configurations
The extended functions/memory module can be installed in any calculator port. If you have only a single
extended memory module in addition to the extended functions/memory module, it can be installed in
any other port.
If you later add a second extended memory module (or if you install two extended memory modules at the
same time), the extended memory modules must be arranged in one of the following configurations. Don’t
install them one above the other.
X MEMORY X MEMORY
X MEMORY X MEMORY
X MEMORY X MEMORY
X MEMORY X MEMORY
If you remove one or more of the modules, some or all of the data in extended memory may be lost. To
minimize this data loss there is an optimum sequence for removing modules. However, the sequence is
conditional on the order in which the original configuration was accomplished, as follows:
o If extended memory modules were installed at different times, remove the modules in the order
opposite to that in which they were installed.
e If extended memory modules were installed at the same time, remove the module in port 2 or 4 first,
then, if necessary, the module in port 1 or 3.
In this manual, the description of each function is preceded by a summary of information required by that
function. This provides a quick, visual summary of how to execute the function. For example:
This indicates that a keycode must be placed in the X-register and a function name placed in the ALPHA
register before you execute from the keyboard or in a program.
If at any time an error message is displayed by the calculator, refer to appendix B for an explanation of its
cause.
Section 2
Extended Functions
X sss.dddnnn i
Executing (register move) copies a block of nnn registers, beginning at register sss (source), to
a block of the same length, beginning at register ddd (destination). Any data that was already in the
destination block is lost.
X | sss.dddnnn o
Executing [REGSWAP| (register swap) exchanges the contents of a block of nnn registers beginning at
register sss with the contents of a block of the same length beginning at register ddd.
If nnn is zero for either REGMOVE |or [REGSWAP |, one register will be copied or exchanged.
Flag Operations
It is often helpful to be able to restore the calculator flags to a preexisting configuration—for instance, to
restore the display format after executing a program. The following two functions enable you to recall the
condition of flags 0 through 43 and later to use this data to restore some or all of these flags to their
previous condition.
RCLFLAG
Executing (recall flags) recalls the status of flags 0 through 43 to the X-register as ALPHA
data. You can then store the contents of the X-register for later use.
Note: When |RCLFLAG |is executed, the display will not be intelligible.
If the flag status from a previously executed function is placed in the X-register, executing
(restore flags) restores calculator flags 0 through 43.
11
12 Section 2: Extended Functions
If you want to restore only some of the flags, place the flag status in the Y-register and a number in the
form bb.ee (representing the beginning and ending flags of the block to be restored) in the X-register, and
execute STOFLAG .
Example. Suppose you want to write a program that gives answers in 0 format, without a decimal
point, but when program execution is finished you want the display format restored to whatever it was
before you ran the program. The program lines below show how you could do this.
01 LBLTABC
02 RCLFLAG These two steps recall the status of flags 0 to 43 to the X-register and save that status in
03 STO 20 register 20. This block of flags includes flag 29, the digit grouping flag, and flags 36
through 41, the number of digits and display format flags.
04 FIX O These two steps set the display format for your program.
05 CF 29
06
07
08 Your program.
20 RCL 20 These steps recall the original flag status to the X-register and restore the flags and
21 STOFLAG display status.
22 END
(X exchange flags) uses the number in the X-register to set flags 0 through 7. At the same time, it
transfers the previous status of those flags to the X-register.
In the X-register, the flag status takes the form of a number from 0 through 255. Each flag corresponds to
a number (actually a power of 2). The number in the X-register is the sum of the numbers of the flags that
are set. The flags and their equivalents are:
Flag 0 1 2 3 4 5 6 7
Numeric
Equivalent 1 2 4 8 16 32 64 128
Example. Suppose flags 0, 3, 5, and 7 are set, while flags 1, 2, 4, and 6 are clear. If <> F|is executed,
what numberis placed in the X-register? To find out, add up the numeric equivalents of the set flags:
Flag Numeric
Equivalent
0 1
3 8
5 32
7 128
169 isthe number in the X-register.
Section 2: Extended Functions 13
If you enter 0 in the X-register and execute >F]|, flags 0 through 7 are cleared, and their previous
status is placed in the X-register.
You can use to create extended general purpose flags by storing numbers representing the status
of flags 0 through 7 in storage registers. For example, to check the status of an extended flag, recall the
flag status code to the X-register using [RCL], execute , then execute as usual.
enables you to use large numbers of flags in programs. Flags are grouped by eights and
transferred into and out of the first eight flag positions by means of . The number representing the
status of a particular group of eight flags is placed in a storage register until it is needed. When it is
needed, it is recalled to the X-register and exchanged with the flags presently in the first eight positions.
The status of specific flags in that group can then be examined or altered.
Like [ASN], (programmable assign) enables you to assign functions or programs to a key location.
However, can be executed from within a program. requires you to enter the keycode for the
key to which you wish to assign the function or program. This is the same keycode that the calculator
itself displays when you use to assign a function or program to a key. Keycodes are described more
fully in the HP-41C/41CV QOwner’s Handbook and Programming Guide. Remember that keycodes for
shifted keys are negative numbers.
As is the case with [ASN], you cannot use to assign programs to any of the top four keys (keycodes
01 through 04) or to the shift key (keycode 31).
cancels an assignment for the designated key if it is executed with the ALPHA register cleared.
The extended functions/memory module enables you to shift data between the ALPHA and X-registers.
In the ALPHA register, the data exists as alphabetic or numeric characters, while in the X-register, an
alphabetic or numeric character is represented by a numeric character code.
Alphanumeric characters are represented within the calculator by character codes based on ASCII
(American Standard Code for Information Interchange). In addition to the numerals and letters of the
alphabet that correspond directly to ASCII, there are some nonstandard symbols represented by unique
HP-41 codes. The following table lists symbols that can be displayed in ALPHA mode together with their
character codes.
14 Section 2: Extended Functions
- 0 3 51 N 78
% 1 4 52 O 79
~ 4 5 53 P 80
N 5 6 54 Q 81
5 6 7 55 R 82
m 12 8 56 S 83
d 13 9 57 T 84
# 29 : 58 U 85
space 32 ; 59 Vv 86
| 33 < 60 W 87
" 34 = 61 X 88
# 35 > 62 Y 89
$ 36 ? 63 z 90
% 37 @ 64 [ 91
& 38 A 65 \ 92
39 B 66 ] 93
( 40 C 67 ’ 94
) 41 D 68 _ 95
¥ 42 E 69 T 96
+ 43 F 70 a 97
44 G 71 b 98
- 45 H 72 c 99
. 46 I 73 d 100
/ 47 J 74 e 101
0 48 K 75 ) 126
1 49 L 76 k- 127
2 50 M 77
Executing (ALPHA to X) shifts the leftmost character out of the ALPHA register and placesits
character code in the X-register. If the ALPHA register is empty, the number zero is placed in the
X-register.
X character code l
X [ ALPHA string |
Executing (Xto ALPHA) with a character code from the above table in the X-register appends the
character represented by the character code to the right hand end of the string in the ALPHA register.
may be executed with any number from 0 to 255 in the X-register, but numbers that are not listed
above as a character code are not valid codes, so the character appended in the ALPHA register will not
be intelligible. (All segments of the display at that character position will be turned on.) If you execute
with the number zero in the X-register, subsequent operations on the ALPHA register may not
Section 2: Extended Functions 15
work properly until the registeris cleared. (Refer to Appendix C for information on alpha operations with
the null (code 0) character.) Executing with an alpha data string in the X-register appends the
entire string to the ALPHA register.
The (ALPHA length) function returns the number of characters in the ALPHA register to the
X-register.
The (ALPHA number) function scans the ALPHA register for an ALPHA formatted number. If a
number is found, its value is recalled to the X-register and user flag 22 is set. If no number is found, the
X-register and flag 22 are unchanged.
The digits in the ALPHA register can represent values in any display format. Number separators and
radix marks are interpreted according to the status of calculator flags 28 and 29. For example, if the
ALPHA register contains the string PRICE: $1,234.5, executing returns the following results,
depending on the status of flags 28 and 29:
If the digits in the ALPHA register are preceded by a minus sign, a negative number will be placed in the
X-register when is executed.
X character code =
X [TALPHA string |
The (position in ALPHA) function scans the ALPHA register for the ALPHA character or string
specified in the X-register. There are two ways to specify the character or string. You can enter the
character code for a single character, or you can enter an actual character or string of characters by using
[ASTO]. If the specified character or string is found in the ALLPHA register, the character position of the
character (or the character position of the leftmost character in the string) is returned to the X-register.
(Refer to Appendix C for information on alpha operations with null characters.)
Character positions are counted from left to right, starting from position 0. If the specified string occurs
more than once in the ALPHA register, only the position of the first occurrence is returned. If the target
string is not found in the ALPHA register, the number -1 is returned.
16 Section 2: Extended Functions
X | number of characters|
Executing (ALPHA rotate) rotates the contents of the ALPHA register by the number of
characters given in the X-register. The ALPHA register is rotated to the left if the number in the X-register
is positive, or to the right if the number is negative. (Refer to Appendix C for the effects of on null
characters.)
can be used with and to extract a sequence of numbers from the ALPHA register.
Example. As the result of an operation by some peripheral device, the ALPHA register contains the
sequence 68.2 69.88 (two numbers, separated by a space). You want to extract each of these numbers in
turn and use them in a program.
Keystrokes Display
Miscellaneous Operations
When a program executes (get key), execution halts until a key is pressed or an interval of
approximately 10 seconds elapses. If a key is pressed, its keycode is placed in the X-register. If no key is
pressed, the number 0 is placed in the X-register at the end of the time interval.
Section 2: Extended Functions 17
responds to the first key pressed, so there can be no shifted responses to| GETKEY|. If you press the
gold shift key during a wait, its keycode (31) is placed in the X-register.
enables you to branch to a subroutine on the basis of an entry from the keyboard, even when the
key pressed is not a digit key.
SIZE-Related Functions
works like the function provided in the calculator except that it can be executed from within a
program. It makes it possible for a running program to reallocate the registers in main memory as
required.
Executing places the number of registers currently allocated to data storage into the X-register.
SIZE? can be used within a program to inhibit the execution of PSIZE when a memory reallocation is not
required.
The following program lines illustrate how and might be used in a program.
01
02 Your program.
07 SIZE? The number of data storage registers presently allocated is placed in the X-register.
08 nn Key in the number of registers this program needs. The result of the previous step is now in
the Y-register.
09 X>Y? Is the number of storage registers required by the program greater than the number
presently allocated?
10 PSIZE Reallocate memory only if the answer to the above question is yes.
Clearing Programs
Executing (programmable clear programs) clears one or more of the programs in main memory.
All programs beginning with the one named in the ALPHA register (or the current program if the
ALPHA register is clear) and continuing to the end of program memory are cleared. If a running program
names itself (or clears the ALPHA register) and executes PCLPS |, that program and all following it will be
cleared and program execution will terminate.
Section 3
Extended Memory
To use the extended functions/memory and extended memory modules effectively, you must understand
the distinction between your calculator’s main memory and the extended memory provided by these
modules.
Your calculator by itself has a certain amount of main memory. If you have an HP-41C, you can add
memory modules to increase the size of main memory up to that of the HP-41CV. Regardless of its size,
main memory contains programs and data that are always instantly available to the calculator. You
have only to press and enter a program name or and enter a register number in order to execute
a program or recall data.
Extended memory is somewhat different. In order for the calculator to use the programs and data in
extended memory, they must first be transferred to main memory; they are not directly accessible.
Extended memory gives you more storage space for programs and data, but the tradeoff you make for that
extra capacity is the necessity of taking extra steps to transfer those programs and data between main
and extended memory.
NOT
CALCULATOR PERMITTED
O
MAIN EXTENDED
MEMORY MEMORY
The registers in extended memory* are organized in structures called “files.” A program you create in
calculator main memory can be transferred to extended memory as one type of file.
There are three kinds of files that can be stored in, and recalled from, extended memory:
e DataFiles
e ASCII Files
e Program Files
19
20 Section 3: Extended Memory
Files consist of two registers (called the header) that contain information about the file, and one or more
registers that contain data. Following the last file there is also one register used as a partition between
used and unused extended memory.
Files are stored in extended memory in the order in which File 1 Extended
they are created. Sometimes a file may be partly in one Functions/Memory
module and partly in another. In the illustration on the right, Module
file 5 starts in extended memory module A, but some :
registers are in extended memory module B. This is why it is File 2
important to use the proper sequence in removing extended
memory modules. If you have to remove a module, you want
to lose as few files as possible. In the situation illustrated, if
you remove extended memory module B, you lose only files 5 File 2 Extended Memory
and 6. However, if you remove extended memory module A, Module “‘A"’
the only file you will leave in extended memory will be file 1!
File 3
Unused
Registers
As previously mentioned, the first two registers in a file are called the header. They store certain
information about the file that the calculator makes use of. The first register contains the file name. This
can be any combination of alphabetic and numeric characters, including spaces, up to seven characters
long. If you try to give a file a longer name, excess characters are truncated. If you create a file with a
name of fewer than seven letters, the calculator adds spaces to bring the character count up to seven.
The second register in the header contains information on the length and type of the file and one or two
“pointers” that are used to gain access to specific items in thefile.
Section 3: Extended Memory 21
Data Files
Data files enable you to retain important data while using all ) HEADER
. . . . Registers
the registers in main memory. Most of the functions that are HEADER
used with data files make use of the file’s “register pointer,” 000 [1.900 01
an integer thatis used to refer to a specific register within the 001 |2.700 O1
file. In the example data file on the right, the pointer is 002 |4.600 O1
regist Reaqi
R 003
egister __ (0a |6.300 O1
(1090 02
itioned to to the the fifth
positioned fifth register.
ointer 005 [1.720 02
006 |2.810 02
007 [4.530 02
008 |7.340 02
009 [1.187 03
A Data File
Many of the function descriptions in this section include examples. To duplicate their results, you can
create and save a data file like the one on this page by pressing the keys shown below. The and
functions used will be explained later in this section (pages 24 and 28).
Keystrokes Display
[ALPHA]SAMPL - D SAMPL-D _
[ALPHA]20 20_
[XEQ][ALPHA]CRFLD XEQ CRFLD _
20.0000
B (ASN](ALPHA] ASN _
SAVEX ASN SAVEX 11 Assigns to the key.
20.0000 X-register displayed.
20.0000 Switch to user mode.
19 19.0000
27 27.0000
46 46.0000
63 63.0000
109 109.0000
172 172.0000
281 281.0000
453 453.0000
734 734.0000
1187 [=+] 1,187.0000
B (ASN](ALPHA] ASN _
1,187.0000 Clears assignment from the key.
The above data is now stored in the first 10 registers of SAMPL-D; the remaining registers are set to zero.
ASCII Files
ASCII files enable you to create texts of alphanumeric characters and search and edit your texts. To avoid
the limitations that would be imposed by dealing with these files in terms of registers, ASCII files are
organized into ‘“records” and ‘“characters,” as shown in the following illustration. Each record in an
ASCII file may contain from 1 to 254 characters. As the illustration shows, an ASCII file has two
pointers—a record pointer and character pointer.
22 Section 3: Extended Memory
Records
HEADER
HEADER
000 H/A|R|V|E|Y| |K E|C|K|
001 5/5|5|—[1]2[3]4
002 [C/A|R|L| |L/A F|O|N|G|
Record 003 (1|56 |—[2/3[3]2
Pointer 004 B|R|U|C/E| WA Y|N E|
005 2|0|/5|— 44|23
006 W[I|L|L|I|AM| |[B/A|T|S O|N
007 6|0/ 2|—|9/9/9]1
O N T OMNOOOOO—ANM
CharactersOOOOOOOOOOv—‘—i—F
OO0 0000000000 OoOOo
A
Character
Pointer
In the illustration, the record pointer is set to the fifth record and the character pointer is set to the third
character. Taken together, the combination points to the U in BRUCE WAYNE. You can duplicate the
ASCII file in the illustration by pressing the keys shown below. The function used will be
explained later in this section (page 24).
Keystrokes Display
[ALPHA])SMPL-AS SMPL-AS_
[ALPHA] 20 20_
CRFLAS XEQ CRFLAS_
20.0000
W (ASN][ALPHA] ASN
APPREC ASN APPREC 11
20.0000
[ALPHA]HARVEY KECK HARVEY KECK_
20.0000
[ALPHA]555-1234 555-1234
20.0000
[ALPHA] CARL LAFONG CARL LAFONG _
20.0000
156-2332 156-2332_
20.0000
BRUCE WAYNE BRUCE WAYNE_
20.0000
[ALPHA]205-4423 205-4423
20.0000
[ALPHA]WILLIAM BATSON WILLIAM BATSON _
20.0000
[ALPHA]602-9991 602-9991
20.0000
B(ASN)(ALPHA] ASN _
20.0000
Section 3: Extended Memory 23
Program Files
A program file is a program that is stored in extended memory. You can give yourself more room in main
memory if you keep most of your programs in extended memory until you need one of them.
The following keystroke sequence creates a program that reads and displays the contents of ASCII file
SMPL-AS, then transfers the program to extended memory as a program file.
Keystrokes Display
(PRGM]E(GTO](-][] 00 REG nn
B (LBL)[ALPHA]
SAMPL - P [ALPHA] 01 LBL'SAMPL - P
[ALPHA]SMPL - AS 02"SMPL - AS
0 030_
[(XEQ][ALPHA]SEEKPTA 04 SEEKPTA
B(tsL]01 05 LBL 01
[XEQ][ALPHA]GETREC 06 GETREC
(ALPHA] [} [AVIEW][ALPHA] 07 AVIEW
B(G10]o1 08 GTO 01
20.0000
[ALPHA]SAMPL - P 20.0000
(XEQ][ALPHA]SAVEP XEQ SAVEP_
20.0000
Working Files
Some extended memory functions require you to enter a file name in the ALPHA register before execution.
After one of these functions has been executed, the calculator is set to the named file.* That is, the named
file has become your working file in the same way that executing with a program name makes the
named main memory program your ‘“working” program. Certain functions described on the following
pages operate only on working files.
File Management
Executing (extended memory directory) displays a list of the files in extended memory. The list
can also be printed out. For each file, the file name appears on the left and the file type (indicated by D, A,
or P) and the number of registers occupied appears on the right.T After all the files have been listed, the
number of extended memory registers still available for storing files is returned to the X-register.
Example. If you created the files described earlier in this section, executing EMDIR will produce the
following listing:
*ExceptPURFL| (purge file), which purges the named file from memory.
tPacking Memory and/or changes in current memory configuration may cause a slight change in the number of registers used by a
program file.
24 Section 3: Extended Memory
/ /—Number of Registers
SAMPL-D D020
SMPL-AS A020
SAMPL-P P0O0O5
549.0000 Number of registers available (assuming two extended memory modules installed).
If there are no files in extended memory, the message DIR EMPTY is displayed and the number of
registers available for storing files is returned to the X-register.
While the directory listing is being displayed (or printed), you can halt the listing by pressing any key
except or [ON]; listing continues when you release the key. You can terminate the listing by pressing
or [ON]. If you terminate the listing while a file name is displayed, thatfile becomes the working file
if it is a data or ASCIIfile.
The (create file-data) and (create file-ASCII) functions create, respectively, data files and
ASCII files. When you execute [CRFLD|, you will need to specify the same number of registers in the
X-register as you have data items to store. It isn’t necessary to add two registers for the header; the
calculator takes care of that automatically.
When you create an ASCII file, if you know exactly how many characters and records there will be, you
can calculate the number of registers that are required using the following steps:
Usually, you won’t know exactly how many records or characters will be in an ASCIIfile. If you can make
an estimate of the number of characters, a good rule of thumb is to add 20 percent to your estimate and
divide the result by 7 to obtain an approximation of the number of registersneeded.
When you create a file using or [CRFLAS], that file becomes your working file.
Executing (purge file) removes the named file from extended memory.
Executing (clear file) retains the named file, but clears all the data in it. (The named file may not be
a program file.) In data files, enters zeroes in all registers; in ASCII files, it sets the number of
Section 3: Extended Memory 25
Executing (file size) returns the number of registers in the named file to the X-register. The named
file becomes the working file. (If the ALPHA register is empty when is executed, the size of the
working file will be returned.)
Executing (save program) copies the named program from main memory into extended memory
under the specified file name. If only the program name is entered in the ALPHA register, the program is
saved under that name. If only a comma and a file name are given, the current program in main memory
is saved under the file name.
If a program file already exists with the specified file name, executing purges the old file and
creates a new program file with the specified file name.
Executing (get program) replaces the last program in main memory with the program stored in the
named file.* If is executed from the keyboard, the calculator is set to the first line of the new
program. If[ GETP]is executed from a running program, the results depend on whether or not the running
program is the last program in main memory. If the running program is not the last program, it continues
to run. If it is the last program, it is replaced by the program in the named file and execution continues
from the first statement in that program.
Executing (get subroutine) copies the program stored in the named file to main memory
following the last existing program. The calculator is not set to the transferred program.
Any key assignments recorded with the program named will become active if or [GETSUB] is
executed in User mode.
* If you press [} (-][] before executing [GETP], the calculator creates a blank program space at the end of program memory. If you
then execute GETP], the copied program will replace the last, blank program—Ileaving the stored programs intact.
26 Section 3: Extended Memory
Example. Clear SAMPL - P from main memory and then recall it from extended memory.
Keystrokes Display
Keystrokes Display
Executing (seek pointer by ALPHA) makes the named file the working file and repositions the
pointer or pointers on the basis of the value in the X-register. In a data file, the integer part of the number
in the X-register indicates the register that the pointer is positioned to. In an ASCII file, the integer
portion of the number in the X-register positions the record pointer; the first three digits in the fractional
portion position the character pointer.
Example. Make the ASCII file SMPL - AS the working file and reposition the record and character
pointers.
Keystrokes Display
X [rrr 2
X [ rrr.ccc l
Executing (seek pointers) has the same effect on the working file that executing has on
the named file. Executing with the ALPHA register empty is the same as executing i
Section 3: Extended Memory 27
Executing (recall pointer by ALPHA) makes the named file the working file and returns the
value or values of its pointer or pointers to the X-register. The value of the register pointer in a data file is
returned as an integer. The values of the record and character pointers in an ASCII file are returned in the
form rrr.ccc, where rrris the value of the record pointer and ccc is the value of the character pointer.
Executing (recall pointers) returns the value or values of the pointer or pointers in the working file
to the X-register. Executing with the ALPHA register empty is the same as executing [RCLPT].
Example. Recall the pointers from the ASCIIfile of the preceding example.
Keystrokes Display
0 0 Clears display.
[XEQ][ALPHAJRCLPT XEQ RCLPT_
6.0130 Recalls the pointer values set in the preceding
example from the working file.
If you name a program file and execute [RCLPTA ]|, the number of bytes in the program is placed in the
X-register.
Executing (save registers) copies all of the data storage registers in main memory to the named
data file (or to the working file, if the ALPHA register is empty). The first register in main memory is
copied to register 000 in the data file, the second is copied to register 001, and so forth. At the end of the
process, the register pointer in the data file indicates either the next available register or the end of the
file.
X | bbb.eee |
Executing (save registers by X) copies a block of main memory registers to the working datafile.
The block of main memory registers to be saved is designated by a value in the X-register in the form
bbb.eee, where bbb is the register number of the first register and eee is the number of the last register.
The registers are copied into the data file starting at the current pointer position. moves the
pointer to the register following the last register copied or to the end of the file. will not be
executed if there is not enough room in the working file for the block of registers to be copied.
28 Section 3: Extended Memory
Executing (save X-register) copies the contents of the X-register into the working file at the
register indicated by the pointer. After the data is copied, the pointer is moved to the next register.
The procedure on page 21 for creating file SAMPL - D and transferring data to it shows how is
used.
Executing (get registers) recalls the contents of the named file to main memory. The contents of
register 000 in the named file are placed in main storage register 000, the contents of register 001 in the
corresponding register in main memory, and so forth. Execution of stops at either the last data
register in main memory or at the end of the data file in extended memory. Executing with the
ALPHA register empty copies the working file to main memoryif the file is a datafile.
X bbb.ecee |
Executing (get registers by X) copies data from the working file to a block of registers in main
memory starting at register bbb and ending at register eee. Registers are copied from the working file
starting at the current pointer position. Execution stops when all specified registers have been filled or the
end of the working file is reached.
Executing (get to X-register) copies the contents of the register indicated by the pointer in the
working file to the X-register and moves the pointer to the next register.
Keystrokes Display
ALPHA | text [
Executing (append record) appends the contents of the ALPHA register to the working file as a
new record. This is illustrated by the procedure for transferring data to SMPL - AS on page 22.
Executing (delete record) deletes the record indicated by the record pointer in the working file.
sets the character pointer to zero, but it does not change the record pointer.
Keystrokes Display
2 2_ Pointer will be set to character 000 of record 002.
[ALPHA]SMPL - AS SMPL - AS _ File name.
2.0000
SEEKPTA XEQ SEEKPTA_ Makes SMPL - AS the working file and positions
the pointers.
2.0000
[XEQJ[ALPHA] DELREC XEQ DELREC
2.0000 “CARL LAFONG?” is deleted. The record that was
004 is now 003.
(XEQ][ALPHA]DELREC XEQ DELREC
2.0000 “156-2332” is deleted. Records move up.
ALPHA text |
Executing (insert record) inserts a record in front of the record indicated by the record pointer.
Example: Insert an entry ahead of “BRUCE WAYNE” in SMPL - AS. (It is assumed that the preceding
example has made SMPL - AS the working file and positioned the pointers to record 003 and character
000.)
Keystrokes Display
[ALPHA)BILL BAILEY BILL BAILEY_ Name.
2.0000
[XEQ][ALPHA]INSREC XEQINSREC Name is inserted in record 002; data in other
records moves down.
2.0000
1 1
30 Section 3: Extended Memory
Keystrokes Display
3.0000
(XEQ][ALPHA]SEEKPT XEQ SEEKPT_ Moves the pointer down one record.
3.0000
702-1133 702-1133_ Phone number.
3.0000
[XEQ][ALPHA]INSREC XEQINSREC_ Phone numberis inserted in record 003; data in
other records moves down.
3.0000
[XEQ][ALPHA]SAMPL - P XEQ SAMPL - P_ Runs the program to list the file.
HARVEY KECK
555-1234
BILL BAILEY
702-1133
BRUCE WAYNE
205-4423
WILLIAM BATSON
602-9991
END OF FL
ALPHA | text |
Executing (append characters) appends the contents of the ALPHA register at the end of the
record indicated by the record pointer in the working file.
Example: Modify a record in SMPL - AS by appending “JR.” to “HARVEY KECK”. Assume SMPL - AS
is still the working file.
Keystrokes Display
0 0_ Specifies record 000.
[XEQ][ALPHA]SEEKPT XEQ SEEKPT_ Move pointers.
0.0000
JR. JR. Text to be appended.
0.0000
[XEQ)[ALPHA)APPCHR XEQ APPCHR _
0.0000
0 0_ Character 000 of record 000.
[XEQ)[ALPHA]SEEKPT XEQ SEEKPT_
0.0000 Move pointers.
[(XEQ][ALPHA]GETREC XEQ GETREC_ Recalls record 000.
0.0000
HARVEY KECK JR.
0.0000
X |number of characters |
Executing (delete characters) deletes the number of characters specified in the X-register,
starting from the current pointer position in the working file.
Section 3: Extended Memory 31
Example. Modify a record in SMPL - AS by changing “HARVEY KECK JR.” to “H KECK JR.”
Keystrokes Display
Executing inserts the contents of the ALPHA register ahead of the current character in the
working file.
Example. Modify a record in SMPL-AS by placing a period after “H” in “H KECK JR.”
Keystrokes Display
(-]001 .001_ Character position 001 of record 000.
[XEQ][ALPHA]SEEKPT XEQ SEEKPT_
0.0010 Move pointers.
(ALPHA]E() Period.
0.0010
[XEQ][ALPHA]INSCHR XEQINSCHR _
0.0010
0 0_ Character 000 of record 000.
SEEKPT XEQ SEEKPT
0.0000 Move pointers.
(XEQ][ALPHA]GETREC XEQ GETREC_ Recalls the current record.
0.0000
H. KECK JR.
0.0000
The (position in file) function scans the working file, starting from the current pointer position, for
a string of text that matches the contents of the ALPHA register. If a match is found, the pointers are
32 Section 3: Extended Memory
repositioned to the first character of the matching text and the pointer value is returned to the X-register.
If no match is found, the pointer is not moved and the number —1 is placed in the X-register.
Keystrokes Display
0 0 Character 000 of record 000.
SEEKPT XEQ SEEKPT_ Moves pointers to start of file.
0.0000
BATSON BATSON _ Target text.
0.0000
[XEQJ[ALPHA] POSFL XEQ POSFL_
6.0080 The target string starts at character 008 of record
006.
Executing (get record) clears the ALPHA register and recalls up to 24 characters from the
working file into the ALPHA register. Characters are copied starting from the current pointer position.
After the transfer, the pointer is moved to the next character in the record. If there are fewer than 24
characters between the pointer and the end of the record, transfer stops at the end of the record. When
is executed, flag 17 is set if the end of the record is not reached. If the end of the record is reached,
flag 17 is cleared. This is useful if you have a printer connected to the calculator via HP-IL (the Hewlett-
Packard Interface Loop). If you follow each with the HP-IL command [OUTA], the contents of the
ALPHA register are output to the printer without a terminating carriage return and linefeed if flag 17 is
set. This lets you print the contents of a record on a single line.
Executing (alpha recall record) appends a record or part of a record to the ALPHA register until
the ALPHA register is full. When is executed, flag 17 is set if the end of the record is not reached.
If the end of the record is reached, flag 17 is cleared.
Example. Append a record from SMPL - AS to data already in the ALPHA register by placing a name
and phone number on one line.
Keystrokes Display
Keystrokes Display
[ALPHA] [} (APPEND](SPACE] H. KECKJR. _
0.0000
ARCLREC XEQ ARCLREC_ Appends the contents of the current record to
ALPHA.
0.0000
H. KECK JR.
555-1234
0.0000
Executing (save ASCII) copies the named ASCII file in extended memory to the specified
destination file in mass storage. If you omit the comma and the destination file name and simply enter
the source file name in the ALPHA register, the file in extended memory will be copied to a file with the
same name in mass storage, if one exists. does not create a file in mass storage; that must be
done using the function in the HP-IL module.
Executing (get ASCII) copies the named ASCII file in mass storage to the specified destination
file in extended memory. If you omit the comma and the destination file name and simply enter the source
file name in the ALPHA register, the file in mass storage will be copied to a file with the same name in
extended memory, if one exists. Before you can execute [GETAS], you must first have created the file in
extended memory using CRFLAS |.
Execution of either or stops when the end of either the source or destination file is
reached. If the destination file is too small, an error will be generated, but some data will be copied.
Section 4
All functions provided by the HP 82180A Extended Functions/Memory Module can be entered whenever
the module is plugged into the calculator. While the extended functions/memory module is connected,
program lines with extended functions are displayed and printed as standard functions.
If the module is disconnected later, these program lines are displayed and printed as XROM functions—
with two identification numbers. The first number, 25, indicates that the functions are provided in the
extended functions/memory module. The second number identifies the particular function. The XROM
numbers for the functions in the extended functions/memory module are listed below.
If program lines using extended functions are entered when the module is not connected, the function is
recorded and displayed as XEQ followed by the function name. Program execution will be slowed by lines
in this form because the calculator will first search for a program or program line with the specified label.
35
Appendix A
Module Care
CAUTION
Always turn off the calculator before connecting or disconnecting any module or peripheral. Failure to
do so could result in damage to the calculator or disruption of the system’s operation.
¢ Keep the contact area of the module free of obstructions. Should the contacts become dirty, carefully
brush or blow the dirt out of the contact area. Do not use any liquid to clean the contacts.
¢ Store the module in a clean, dry place.
¢ Always turn off the calculator before installing or removing any module or peripherals.
No other express warranty is given. The repair or replacement of a product is your exclusive remedy.
ANY OTHER IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS IS LIMITED
TO THE ONE-YEAR DURATION OF THIS WRITTEN WARRANTY. Some states, provinces, or
countries do not allow limitations on how long an implied warranty lasts, so the above limitation may not
apply to you. IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR
CONSEQUENTIAL DAMAGES. Some states, provinces, or countries do not allow the exclusion or
limitation of incidental or consequential damages, so the above limitation or exclusion may not apply to
you.
This warranty gives you specific legal rights, and you may also have other rights which vary from state
to state, province to province, or country to country.
37
38 Appendix A: Care, Warranty, and Service Information
Warranty Information
If you have any questions concerning this warranty or service, please contact an authorized Hewlett-
Packard dealer or a Hewlett-Packard sales and service office. Should you be unable to contact them,
please contact:
¢ In the United States:
Hewlett-Packard
Corvallis Division
1000 N.E. Circle Blvd.
Corvallis, OR 97330
Telephone: (503) 758-1010
Toll-Free Number: (800) 547-3400 (except in Oregon, Hawaii, and Alaska)
¢ In Europe:
Hewlett-Packard S.A.
7, rue du Bois-du-lan
P. O. Box
CH-1217 Meyrin 2
Geneva
Switzerland
Telephone: (022) 8381 11
Note: Do not send units to this address for repair.
¢ In other countries:
Hewlett-Packard Intercontinental
3495 Deer Creek Rd.
Palo Alto, California 94304
U.S.A.
Telephone: (415)857-1501
Note: Do not send units to this address for repair.
Service
Obtaining Repair Service in the United States
The Hewlett-Packard United States Service Center for handheld and portable calculator products is
located in Corvallis, Oregon:
Hewlett-Packard Company
Corvallis Division Service Department
P. 0. Box 999/1000 N.E. Circle Blvd.
Corvallis, Oregon 97330, U.S.A.
Telephone: (503) 757-2000
Appendix A: Care, Warranty, and Service Information 39
If you happen to be outside of the country where you bought your module, you can contact the local
Hewlett-Packard service center to see if service is available for it. If service is unavailable, please ship the
module to the address listed above under Obtaining Repair Service in the United States. A list of service
centers for other countries can be obtained by writing to that address.
All shipping, reimportation arrangements, and customs costs are your responsibility.
Should you need technical assistance concerning programming, applications, etc., call Hewlett-Packard
Customer Support at (503) 757-2000. This is not a toll-free number, and we regret that we cannot accept
collect calls. As an alternative, you may write to:
Hewlett-Packard
Corvallis Division Customer Support
1000 N.E. Circle Blvd.
Corvallis, OR 97330
40 Appendix A: Care, Warranty, and Service Information
A number of our users submit program applications or unique program key sequences to Hewlett-
Packard. However, we can consider using only ideas given freely to us. Since it is the policy of Hewlett-
Packard not to accept suggestions given in confidence, the following statement must be included with
your submittal:
Notes
Appendix B
Error Messages
This is a list of messages and errors relating to the functions provided by the extended functions/memory
module. When any of these errors are generated, the function attempted is not performed, except as noted.
|»
|m
C
5
|+
XTOA
x
A
Vv
-
registers in length.)
The data in the X-register (or the Y-register, if the X-register contains a
wnl
—|
Ol
c>3
T
—|
range of flags in the form bb.ee) is not data that was obtained by
executing RCLFLAG .
DUPFL A file of the same name already exists in extended memory. Thefile of
n
ol o
|3 |2
|m||m
=l (e
(O] >
the same name becomes the working file. ASCII, data and program
files cannot share a common name. Hint: Use suffixes to distinguish
ol
>|
<l
ml
|
END OF FL An attempt has been made to position the pointer, to read, write, or
>
)
o
o
T
o
APPREC delete past the end of the file. For and the named
ARCLREC file becomes the working file, but the file and pointers are not
changed.
ol o
[m| |m
|||
|=| [0
|m||x
o0 |=
ol
m|
—H|
|
m|
GETRX
GETX
NSCHR
|
N
o
-
8
=
SAVER
wn
>
<
m
o
X
SAVEX
un||n
m| im
m||m
Al |=
| |
> =
GETAS File transfer was not completed because the end of the destination file
was encountered before the end of the source file. Part of the file is
wn
>
<
m
>
»
transferred.
43
44 Appendix B: Error Messages
END OF REC SEEKPT An attempt has been made to position the character pointer past the
SEEKPTA end of the current record.
FL NOT FOUND CLFL The filename in the ALPHA register does not exist in extended
FLSIZE memory or, if the ALPHA register is empty, then there is no working
file in extended memory.
m
EEEEE
=
@
ETP
o
GETR
|®
c|m
[
@
|
|
RCLPTA
(»n
>
F 5R
<
0l
>
<|
SEEKPTA
ARCLREC
O
|m
X E oR 0]R|
=
|m|
|9]
]
|
[m|
F]
@]
|m|
A
O
m|
Sl
INSCHR
NSREC
|=
0| |0
—||»n
LR
| (O
SAVERX
w
>
BB
<
SEEKPT
FL TYPE ERR Either the working file or the file specified in the ALPHA register is of
>
o
o
2o
APPREC the wrong type for the function attempted. For example, you can’t use
ARCLREC CLFL| on a program file; you’ll get this message.
@)
—
-
DELCHR
DELREC
@
5
m
=
GETP
GETR
GETREC
zZ 5] 0] 0] 6
414
m| |m| |m
e
@
NSCHR
o BB ] 29| (6
(| |0 |0 || D] 15|
|33
B n5 AL
||
L]
<|I<|I<]
323
34
0wl
LL
=
Appendix B: Error Messages 45
n
o
D
n
r
>
CRFLD
o
-
n
m
>
GETP
|vl|lnllollo
[>|C||m
|+
[m||[m||m|]|»n
]|C
W
|3
o[>l
n
<]
(>
1<
|m|
> ||
m|
(>
wn
>
<l
m|
NO ROOM CRFLAS There is not enough space left in extended memory for a file of the size
specified by the number in the X-register.
o
|
|7
|—
(O
GETP There is not enough space in main memory to hold the program.
o
-
wn
m
c
w
One or more of the flags specified by the number in the X-register is out
ol
o
nl
=
-
T
REC TOO LONG APPCHR If the function were completed, the resulting record would be more
than 254 characters long.
|G
I
|z
[z
|
Null Characters
When you display the ALPHA register, any null characters to the right of the first non-null character will
be displayed.
o Ifyouexecute (refer to the label on the back of the calculator) when the last character in the
ALPHA register is a null, the ALPHA display appears blank. However, the contents of the ALPHA
register are not affected. Thus, the characters that are entered after executing are
appended properly to the existing ALPHA data string. To restore the ALPHA display, execute
or switch ALPHA mode off, then on.
e Ifyoustore an ALPHA string containing nulls in a data register, the nulls do not appear if you use
to display that register. If you print the contents of that register, only the characters to the left
of the first null are printed. The remaining characters are ignored by the printer. (All characters in
the string, including the nulls, remain properly stored in the data register and reappear in the
ALPHA register if the contents of the data register are recalled using [ARCL].)
o Ifastring containing one or more nulls is rotated so that a null becomes the leftmost character, that
null and all nulls that immediately follow it are lost.
e Ifthelast characterin the ALPHA register is a null, and if the calculator is in ALPHA append mode
(the prompt appears to the right of the null character), pressing clears the entire ALPHA
register.
e If an ALPHA string in the X-register contains a null when you execute [POSA|, the calculator
searches the ALPHA register only for that portion of the string that is to the left of the first null in
the string.
o Anynullin a file name that is entered in the ALPHA register is ignored.
* The null character and character code should not be confused with the NULL message that is displayed when a calculator function key
is held down for more than about one-half second.
47
Function Index
Function ALPHA
Description Register X-Register
X
O
® 1= N
>
®
Q
CRFLD Creates a data file in extended memory. File name. Number of registers.
page 24)
—
FLSIZE
page 25) file to X-register.
GETAS Copies named ASCII file from mass storage Mass storage file
(page 33) to extended memory. name, extended
memory file name.
Halts program execution until a key is
<
A
o
—
m
m
49
50 Function Index
ALPHA
Function Description X-Register
Register
elapses. Puts keycode in X-register if key is
pressed, puts 0 in X-register if no key is
pressed.
GETP Replaces last program in main memory Program file name.
(page 25) with contents of named program file.
Copies entire data file to main memory Data file name.
I
GETR
page 28) registers, beginning with register 00.
PCLPS
page 17) from main memory.
Scans the ALPHA register for the ALPHA substring or
I
POSA
page 15) character(s) in the X-register and returns character code.
the position of the first character to the
X-register (—1 if no match).
POSFL Searches the working ASCII file for a sub- Target string.
(page 31) string matching the string in the ALPHA
register. Returns the record and character
pointer locations to the X-register of the first
character of the substring if a match is
found. Returns a —1 if no match is found.
PSIZE Programmable function. Number of data
page 17) storage registers to be
—
allocated.
Purges (deletes) the named file from File name.
X0
o
-
C
m
RCLPT
page 27) positions in the working file to the X-register
(rrr for data files, rrr.ccc for ASCII files), or
Function Index 51
ALPHA
Function Description Register X-Register
memory.
SAVER Copies all main memory registers to the File name.
P named datafile.
N
e
o
®
Q
(page 26) the locations indicated by the number in the rrr.ccc (ASCII files).
X-register.
SEEKPTA Positions the pointers in the named file to File name. rrr (data files) or
(page 26) the locations indicated by the number in the rrr.ccc (ASCII files).
X-register.
SIZE? Returns the number of data storage
(page 17) registers in main memory to the X-register.
STOFLAG Restores the status of flags 0-43 (or a block flag status
(page 11) within that group). Uses the data obtained or
by executing RCLFLAG |. bb.ee (beginning and
ending flags in block
to be restored;
Y-register contains
flag status).
X<>F Exchanges the contents of the X-register Code number (0-255)
page 12) with the status of flags 0-7.
XTOA Converts the number in the X-register to its Character Number
I