Download Print this page

HP 35s User Manual page 3

Scientific calculator - indirect register data packing program
Hide thumbs Also See for 35s:

Advertisement

hp calculators
HP 35s Indirect register data packing program
storage registers starting with 100 and working down. This can cause quite a shock when you're not expecting it in a
program or calculation.
Each indirect register, like each direct register and each stack register, can hold a variety of objects, such as a real
number, a complex number, or a 2-D or 3-D vector. Since these take varying amounts of memory to hold them, the HP
35s allocates 37 bytes per register for each location, whether the register needs that many bytes or not (see page 14-24
of the HP 35s user's guide). This means that a group of indirect registers that are only going to hold a real number are
only using 1/3 of the possible storage space per register.
To reclaim some of this space that might otherwise be unused, it is possible to pack three real numbers into a 3-D vector
and store the group into a single indirect register. This can save a tremendous amount of calculator memory. Storing 100
real numbers using indirect registers normally would use 3700 bytes. Packing them using the program in this learning
module will only use 1/3 of that memory, which will then be available for other uses.
This program originally appeared in Datafile, a publication of HPCC. HPCC is a voluntary, independent body run by and
for users of handheld and portable computers and calculators. The club has been helping members for more than 20
years to get the most from their Hewlett Packard equipment and to further the exchange of information and ideas. You
can find out more about HPCC at their website
The program listing. Program length is 338 bytes. Checksum C4F6. RDN is < (Roll Down). All flag-related instructions
(SF, CF, and FS?) are accessed through ¹·. The conditional tests (x=0?, x<0?) are accessed through
º. In several areas of this program, stack manipulations occur that look rather odd but manage to preserve the
pre-existing stack contents. RPN mode is assumed in the program and throughout these instructions. The program uses
one global label, variable register I, and flags 0, 1, 2, and 3.
Y001
LBL Y
Y002
CF 0
Y003
CF 1
Y004
CF 2
Y005
CF 3
Y006
x=0?
Y007
GTO Y062
Y008
x < 0?
Y009
SF 0
Y010
ABS
Y011
RDN
Y012
IDIV(REGT-1,3)
Y013
STO I
Y014
RDN
Y015
LASTx
Y016
ABS
Y017
RDN
Y018
RMDR(REGT-1,3)
Y019
x=0?
Y020
SF 1
Y021
FS? 1
Y022
GTO Y030
Y023
RDN
Y024
REGT-1
Y025
x=0?
Y026
SF 2
Y027
FS? 2
Y028
GTO Y030
Y029
SF 3
hp calculators
http://www.hpcc.org/
.
Y030
RDN
Y031
FS? 1
Y032
[ 1, 0, 0 ]
Y033
FS? 2
Y034
[ 0, 1, 0 ]
Y035
FS? 3
Y036
[ 0, 0, 1 ]
Y037
RCLx (I)
Y038
FS? 0
Y039
GTO Y058
Y040
+/-
Y041
RDN
Y042
XEQ Y063
Y043
RCL+ (I)
Y044
RDN
Y045
ABS
Y046
CLx
Y047
LASTx
Y048
RDN
Y049
XEQ Y063
Y050
RDN
Y051
REGZ+REGT
Y052
STO(I)
Y053
RDN
Y054
LASTx
Y055
LASTx
Y056
CLX
Y057
+
Y058
CF 0
- 3 -
Y059
CF 1
Y060
CF 2
Y061
CF 3
Y062
RTN
Y063
FS? 1
Y064
REGTx[ 1, 0, 0 ]
Y065
FS? 2
Y066
REGTx[ 0, 1, 0 ]
Y067
FS? 3
Y068
REGTx[ 0, 0, 1 ]
Y069
RTN
Y070
STO I
Y071
[ 0, 0, 0 ]
Y072
STO(I)
Y073
DSE I
Y074
GTO Y072
Y075
STO(I)
Y076
CLSTK
Y077
RTN
HP 35s Indirect register data packing program - Version 1.0

Advertisement

loading