Hubbry Logo
HP-42SHP-42SMain
Open search
HP-42S
Community hub
HP-42S
logo
8 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
HP-42S
HP-42S
from Wikipedia

HP-42S
HP-42S
TypeProgrammable scientific
ManufacturerHewlett-Packard
Introduced1988
Discontinued1995
Calculator
Entry modeRPN
Precision12 display digits (15 digits internally), exponent ±499
Display typeLCD dot-matrix
Display size2 lines, 22 characters, 131×16 pixels
CPU
ProcessorSaturn (Lewis)
Programming
Programming language(s)RPN key stroke (fully merged)
Firmware memory64 KB of ROM
Program steps7200
Interfaces
PortsIR (Infrared) printing
Other
Power supply3×1.5 V button cell batteries (Panasonic LR44, Duracell PX76A/675A or Energizer 357/303)
Weight6 oz (170 g)
Dimensions148×80×15 mm

The HP-42S RPN Scientific is a programmable RPN Scientific hand held calculator introduced by Hewlett-Packard in 1988. It is a popular calculator designed for science and engineering students.

Overview

[edit]

Perhaps the HP-42S was to be released as a replacement for the aging HP-41 series as it is designed to be compatible with all programs written for the HP-41. Since it lacked expandability, and lacked any real I/O ability, both key features of the HP-41 series, it was marketed as an HP-15C replacement.

The 42S, however, has a much smaller form factor than the 41, and features many more built-in functions, such as a matrix editor, complex number support, an equation solver, user-defined menus, and basic graphing capabilities (the 42S can draw graphs only by programs). Additionally, it features a two-line dot matrix display, which made stack manipulation easier to understand.

Production of the 42S ended in 1995.[1]

Specifications

[edit]
HP-42S battery compartment and the IR diode
HP-42S calculator internal teardown
  • Series: Pioneer
  • Code Name: Davinci
  • Introduction: 1988-10-31
  • 64 KB of ROM
  • 8 KB of RAM
  • Functions: Over 350
  • Expandability: Officially no other than IR printing (32 KB memory upgrade[2] and over-clocking hardware[3] hacks are possible)
  • Peripherals: HP 82240A infrared printer

Features

[edit]

Programming

[edit]

The HP-42S is keystroke-programmable, meaning that it can remember and later execute sequences of keystrokes to solve particular problems of interest to the user. The HP-42S uses a superset of the HP-41CX FOCAL language.

All programs are stored in one continuous program space, and may be created and edited by switching to programming mode, using the PRGM key. Subroutines are enclosed in LBL/Label (name of subroutine) and RTN/Return (halts execution unless it is in a subroutine in which case it returns to the caller). Keystrokes (of functions) are enclosed between LBL and RTN or .END.

In a running program, a GTO label causes program execution to branch to the specified label and continue running at that line. Executing a GTO instruction from the keyboard moves the program pointer to the corresponding label. No program lines are executed.

XEQ is used in much the same way with one important difference: after an XEQ instruction has transferred execution to the specified label, the next RTN (return) or END instruction causes the program to branch back to the instruction that immediately follows the XEQ instruction. Programs/Subroutines can also be executed with the help XEQ label (Execute) key. The important difference between the XEQ and GTO is that XEQ executes the label and returns to previous subroutine and continues execution from the line following XEQ,whereas GTO branches to the label specified and doesn't return.

GTO.. packs the current subroutines and moves to new program space.GTO.nnnn can be used to reach a particular line of program.

Programming examples

[edit]

A simple program to calculate area of circle

Step Instruction Comment
00 { 6-Byte Prgm }
01 LBLAREA Start of program "AREA"
02 INPUTR Prompts for Value of R and stores it in R
03 X↑2 Squares the value in X register
04 PI Puts π on the stack
05 × Multiplies values in X and Y register
END or RTN Returns control (and result in X) to either the user or to a calling program.

Program instructions like STOP, PROMPT, INPUT halt the program execution,which can be continued by pressing R/S.

VIEW is used to view contents of a register,For example R in the above example.

Using Integral and Equation Solver

[edit]

It is necessary to write a program or subroutine that evaluates f(x) for the function which needs to be solved or integrated. Variables used in program should be declared using MVAR

Here is a sample program to solve the equation °F = (9/5×°C) + 32

Step Instruction Comment
00 { 31-Byte Prgm }
01 LBLTEMP Start of program "TEMP"
02 MVARF Declares F as a variable for solver
03 MVARC Declares C as a variable for solver
04 RCLF Recall F
05 9
06 5
07 ÷
08 RCLC Recall C
09 ×
10 -
11 32
12 -
END or RTN Returns control (and result in X) to either the user or to a calling program.

After, accessing the solver using Shift 7 (SOLVER ), select program TEMP.

In a similar way, expressions can be integrated. After selecting the variable of integration, enter the lower limit and then press on LLIM, similarly input ULIM (upper limit) and ACC (accuracy).

Emulators

[edit]
Emu 42

HP 42s can be accessed through Android Emulators like Emu42 and Free42.

WP 34s

Reference Books

[edit]
Reference Books

Guides and Collections of Keystroke Programs

Documentation for the HP 42S calculator at hpcalc.org[4][5]

  • HP-42S Owner's Manual [6]
  • HP-42S Programming Examples & Techniques[7]
  • Step-by-Step Solutions: Electrical Engineering (42S)[8]
  • Step-by-Step Solutions: Mechanical Engineering (42S)[9]
  • Advanced Circuit Analysis with the HP-42S[10]
  • An Easy Course in Using the HP-42S[11]

Educational Texts on RPN calculators

  • Algorithms for RPN Calculators[12]
  • Scientific Analysis on the Pocket Calculator[13]
  • Engineering Statistics with a Programmable Calculator[14]
  • Applied Mathematical Physics with Programmable Pocket Calculators[15]
  • Mathematical Astronomy with a Pocket Calculator[16]
  • Handbook of Electronic Design and Analysis Procedures using Programmable Calculators[17]
  • Calculator Programs for Chemical Engineers(Vol 1 & 2)[18][19]

Collection of Algorithms/Keystroke Programs for HP 41/HP 42S

  • Software Library for HP 41 Programs(Compatible with HP 42S)[20]

See also

[edit]

References

[edit]

Further reading

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
The HP-42S is a handheld programmable developed by , utilizing (RPN) for data entry and computation, and released on October 31, 1988, as part of the company's Pioneer series. It succeeded models in the Voyager series, such as the and , while maintaining software compatibility with the earlier HP-41CX programmable calculator, though without hardware expandability. Discontinued in 1995, the device is powered by three LR44 alkaline button cell batteries and employs the Saturn microprocessor architecture, providing 7.2 KB of user-programmable memory for storing programs, variables, and data. Key features include a two-line dot-matrix LCD display capable of showing up to 27 characters per line, enabling menu-driven operation and simultaneous viewing of input and results. The calculator incorporates over 600 built-in functions covering scientific computations, statistical analysis, matrix operations, complex number handling in rectangular and polar forms, numerical integration, equation solving via a solver tool, and support for multiple number bases including binary, octal, decimal, and hexadecimal. Programming capabilities mirror those of the HP-41CX, with enhancements such as indirect addressing (e.g., STO IND), up to 100 direct-access registers (extendable indirectly), and an alphanumeric register supporting up to 44 characters for labeling and string manipulation. Notable for its compact design (approximately 148 mm × 80 mm × 15 mm and weighing approximately 142 g) and infrared (IR) printing interface for outputting results to compatible printers, the HP-42S was priced at around $120 upon release and remains popular among engineers, programmers, and calculator enthusiasts for its reliability and depth of functionality. Its operating system, derived from prior HP models, supports user-defined menus and subroutines, making it suitable for advanced applications in fields like electrical engineering and mathematics.

History and Development

Origins and Design Goals

The HP-42S emerged in the mid-1980s as part of Hewlett-Packard's effort to advance its lineup of handheld scientific calculators, building on the Voyager series introduced in 1981, which featured compact, programmable models like the HP-15C that emphasized Reverse Polish Notation (RPN) for efficient operation. The Voyager series marked a shift toward pocket-sized devices capable of complex computations, but by the mid-1980s, HP sought even greater integration of programmability and scientific tools in response to evolving user needs among professionals. This evolution led to the Pioneer series in 1987, powered by the new Saturn processor, which allowed for more sophisticated functions in a similarly compact form factor while maintaining the landscape orientation and RPN philosophy pioneered in earlier models like the HP-15C. The primary design goals for the HP-42S centered on creating a versatile, pocket-sized programmable that combined the software compatibility and programmability of the —HP's earlier alphanumeric model—with enhanced scientific capabilities tailored for engineers and scientists. Specifically, the team at HP's calculator division aimed to incorporate advanced features such as matrix operations, equation solvers, and into a device that could handle complex problem-solving without sacrificing portability or affordability, priced at around $120 upon release. This focus addressed the demand for a "professional-grade" tool that bridged the gap between basic scientific calculators and more cumbersome desktop systems, drawing directly from the RPN entry system established in the Voyager series to ensure intuitive use for technical users. The project, conceptualized in the mid-1980s, aligned with the Pioneer series development starting in 1987. Conceptualized during the mid-1980s amid intensifying competition from and , which were introducing graphing and programmable models like the and , the HP-42S was developed by HP's engineering teams to reaffirm the company's leadership in RPN-based scientific computing. The project emphasized from the to ease migration for existing users, while introducing innovations like a two-line for improved readability during programming and matrix handling. Released in October 1988, the calculator fulfilled these objectives by delivering over 600 built-in functions in a durable, shirt-pocket design tested to withstand drops, solidifying HP's commitment to robust, user-centric engineering tools.

Release and Market Impact

The HP-42S was introduced by in October 1988 as the top model in the company's Pioneer series of pocket calculators, with an initial suggested retail price of $120 USD. This pricing positioned it as an accessible yet powerful option for scientific and engineering users, emphasizing RPN programmability in a compact, battery-powered form factor. Critics noted its exclusive use of RPN entry as a limitation compared to algebraic modes in rivals, though this was seen as a strength for efficiency among RPN advocates. The HP-42S was a contemporary of the HP-28S, released earlier in 1988 with graphing and symbolic features at a higher price of about $235, and ' scientific models such as the (introduced in 1990). Production of the HP-42S continued from 1988 until 1996, reflecting steady demand and its enduring appeal among professionals in fields like and , where its reliability fostered long-term loyalty. As of 2025, its scarcity has elevated it to collector status, with well-preserved units often commanding prices of $200–$500 on secondary markets. The model's success reinforced Hewlett-Packard's leadership in programmable RPN calculators during the late and early 1990s, paving the way for advanced successors like the HP-48 series by demonstrating the viability of menu-driven interfaces and expandable programming in handheld devices. Discontinuation on March 1, 1996, aligned with industry shifts toward graphing-focused models and improved LCD technologies.

Physical Design and Specifications

Build and Ergonomics

The HP-42S is constructed with a compact, rugged case designed for portability and durability in professional settings, available in gray color. Its dimensions measure approximately 149 × 80 × 15 mm, with a weight of about 142 grams, making it lightweight enough for pocket carry while providing a solid build resistant to everyday wear. The keyboard features 37 physical keys with tactile feedback for reliable input, including dedicated shift and alpha keys that enable access to secondary functions and alphanumeric entry without compromising usability. This design supports extended professional use, as the keys are engineered for responsiveness and longevity. The display utilizes a two-line (LCD) supporting up to 22 characters per line, with numeric display up to 12 digits—one for the primary stack display and the other for menus, prompts, or alpha content—with adjustable contrast controlled by simultaneously pressing the ON key and +/- for optimal readability in different lighting. Power is provided by three 1.5-volt batteries (such as LR44, PX76A, or 357 equivalents) in a low-power configuration, enabling when powered off and delivering extended battery life of several months to years under normal use, enhancing its suitability for field applications. Ergonomically, the calculator's contoured form factor supports comfortable one-handed operation, fitting naturally in the hand for quick access during computations. Protective cover options, such as molded slipcases or rigid , were offered to shield the device from impacts and scratches during transport.

Hardware Specifications

The HP-42S utilizes a custom Lewis (1LR2) CMOS processor from the Saturn architecture family, clocked at 1 MHz, which enables efficient handling of its programmable operations and . The device incorporates 64 KB of ROM dedicated to and system code, paired with 8,192 bytes (approximately 8 KB) of RAM, of which about 7,200 bytes are available for user programs and after accounting for system overhead. This RAM configuration supports up to around 925 program steps in keystroke programming mode or matrix operations up to 10×10 matrices, depending on allocation priorities. Internally, the HP-42S employs 12-digit decimal mantissa precision with an exponent range spanning from -499 to +499, allowing representation of numbers from approximately 10^{-499} to 10^{499}. For output, the calculator includes an integrated infrared (IR) interface compatible with the optional HP-82240A printer module, enabling wireless printing of results and program listings. The operating temperature range is specified from 0°C to 45°C, ensuring reliable performance in typical environmental conditions of the era, with compliance to contemporary safety standards such as UL certification rather than later CE marking introduced post-1993.

Core Operation and User Interface

RPN Stack and Entry Methods

The HP-42S employs (RPN), a postfix notation system that eliminates the need for parentheses in expressions by processing operands before operators. Central to this is a four-level stack consisting of registers X (the primary display), Y, , and T, where arithmetic and other operations automatically pop values from the stack, perform the , and push the result back, typically lifting the stack to maintain flow. For instance, to add two numbers such as 5 and 3, the user enters 5 followed by ENTER (which duplicates the value from X to Y and lifts the stack), then 3, and finally the + key, which adds Y to X and places the result (8) in X while shifting the remaining stack upward. This stack architecture enables efficient handling of multi-step calculations without intermediate storage, though the fixed four levels can lead to data loss from T during repeated lifts. Data entry on the HP-42S supports direct numeric input via the , where digits are entered sequentially and confirmed with ENTER to push the value onto the stack. Alpha characters for labels, variables, or text are entered using the ALPHA key, which accesses a of letter groups (e.g., ABCDE), allowing up to 44 characters in the Alpha register before exiting with the EXIT key. The LASTx register automatically stores the value of X before any operation modifies it, enabling of the previous X for reuse in calculations, such as retrieving an after an unintended . Stack manipulation is facilitated by commands like RCL () and STO (store), which transfer data between the stack registers and the calculator's 100 storage registers (numbered 00 to 99), with support for indirect addressing, supporting operations such as STO A to store X in register A or RCL A to push the stored value into X. Additionally, stack controls like R↑ (roll up, cycling T to X), R↓ (roll down), and (swap X and Y) allow manual adjustment without altering data. The HP-42S offers configurable modes to adapt the stack and entry behavior to specific needs, including angle units selectable via the MODES menu: degrees (DEG, full circle 360°), radians (RAD, full circle 2π), or grads (GRAD, full circle 400g). Display formats are adjusted through the DISP menu, with options for fixed-point (FIX, specifying decimal places, e.g., FIX 02 for two decimals), scientific (SCI, mantissa with exponent, e.g., 1.23E3), or engineering (ENG, similar to SCI but exponents in multiples of 3). Complex number support is toggled via the COMPLEX mode in the MODES menu, allowing entry in rectangular form (real part ENTER imaginary part COMPLEX, yielding a + bi) or polar form (magnitude ENTER angle in current units COMPLEX), with operations automatically handling complex arithmetic on the stack. These modes persist across sessions unless changed, influencing how entered values are interpreted and displayed. Error handling in the HP-42S focuses on stack integrity and input validity, with the four-level limit preventing overflow by discarding T's contents on lift (no explicit warning, but visible via stack display if enabled) and underflow occurring if an operation requires more operands than available, resulting in an "Invalid Data" error. Invalid inputs, such as domain errors (e.g., of 90° in DEG mode), trigger range errors with messages like "Range Error," though the calculator may return large finite values instead of in some cases. Users can mitigate errors using flags: SF 24 (set flag 24) to ignore range errors and continue with maximum displayable values, or SF 25 for one-time error suppression on the next operation, enhancing reliability during complex stack-based entries.

Display and Keyboard Layout

The HP-42S features a two-line (LCD) utilizing a dot-matrix format with 131×16 pixels, capable of showing up to 22 alphanumeric characters per line. This setup allows simultaneous visibility of the X and Y registers in the RPN stack or the X register alongside labels, supporting both numerical results and text prompts. Annunciators appear as small indicators at the top of the display to denote active modes, such as RAD for radians, PRGM for programming mode, and others for battery status or shift keys. The keyboard consists of 37 keys arranged in a compact layout optimized for one-handed use, with primary functions labeled directly on the keys for basic arithmetic and . Yellow-shifted functions (accessed via the f key) provide secondary scientific operations, while blue-shifted functions (via the g key) enable alphanumeric entry for programming and variable labeling. Dedicated keys include ENTER for duplicating the X register in RPN operations, +/- for sign change, ON for powering on (doubling as EXIT), and access to the CATALOG function for browsing over 600 built-in operations. Below the display, five softkeys facilitate menu-driven navigation, with labels dynamically shown on the bottom line to redefine their roles—such as MATH for mathematical functions or MATRIX for matrix operations. Menus support arrow key scrolling (up/down) for accessing additional pages when more than five options are available, and the alpha register can be labeled using the blue shift for user-defined prompts. Display contrast is manually adjustable via the sequence ON followed by +/- or - to optimize visibility, while the calculator automatically powers off after approximately 10 minutes of inactivity to conserve battery life.

Mathematical and Scientific Features

Arithmetic and Function Capabilities

The HP-42S provides a comprehensive set of basic arithmetic operations, including addition (+), subtraction (−), multiplication (×), division (÷), reciprocal (1/x), square root (√x), square (x²), and exponentiation (y^x). These functions operate in Reverse Polish Notation (RPN), where operands are entered first followed by the operator, utilizing the calculator's four-level stack for efficient computation. Additionally, percentage (%) and percentage change (%CHG) functions are available for financial and statistical calculations. Logarithmic and exponential functions include (LOG, base-10), (LN), antilogarithm (10^x), and natural exponential (e^x), enabling precise handling of logarithmic scales and growth models. The calculator incorporates key mathematical constants such as π (accessible via dedicated key) and (derived via e^x with x=1). For probabilistic computations, it supports (n!), permutations (), and combinations (nCr), with n! computed up to n=69 for real numbers. Trigonometric functions encompass sine (SIN), cosine (COS), tangent (TAN), and their inverses (ASIN, ACOS, ATAN), operable in three angular modes: degrees (DEG), radians (RAD), and grads (GRAD). Hyperbolic functions, including sinh (SINH), cosh (COSH), tanh (TANH), and inverses (ASINH, ACOSH, ATANH), are accessible via the catalog menu for applications in advanced mathematics. Statistical capabilities include one- and two-variable statistics, with functions for entering data (Σ+), computing sums (Σx, Σx², etc.), mean (x̄), weighted mean (WMN), sample standard deviation (SDEV), and linear regression parameters such as slope (SLOPE), y-intercept (YINT), and correlation coefficient (CORR). Curve fitting options extend to logarithmic (LOG), exponential (EXPF), and power (PWRF) models via CFIT. When mode is enabled, the HP-42S supports rectangular (a+bi) and polar (r∠θ) representations, with basic arithmetic operations (+, −, ×, ÷), , square, and conversions between formats (→RECT, →POL), allowing seamless handling of complex-valued expressions.

Advanced Tools like Integration and Solving

The HP-42S provides robust numerical tools for tackling complex computational tasks, including integration, , and matrix manipulations, enabling users to handle advanced scientific and problems directly on the device. These features leverage the calculator's programmable capabilities, where user-defined functions or expressions are evaluated iteratively to achieve high precision within hardware constraints. Numerical integration on the HP-42S employs an adaptive algorithm to approximate the definite abf(x)dx\int_a^b f(x) \, dx over specified intervals. The user defines the integrand f(x)f(x) via a program labeled with the MVAR "X", sets the lower limit (LLIM), upper limit (ULIM), and desired accuracy (ACC, typically a relative tolerance like 1E-3 to 1E-12), then invokes the INTEG function. The algorithm adaptively subdivides the interval, doubling the number of evaluation points iteratively until the estimated falls below the ACC threshold, returning the value in the X-register and the in the Y-register. This method supports real-valued functions only and excels with smooth integrands but may require careful ACC tuning for oscillatory or singular functions to avoid prolonged computation or inaccuracies due to underflow. For instance, integrating sin(x)\sin(x) from 0 to π\pi with ACC=1E-6 yields approximately 2.000000 with negligible . Limitations include real numbers exclusively and potential inefficiency for very wide intervals, where memory allocation for intermediate results (detailed in the calculator's ) can constrain performance. The solver facilitates solving single nonlinear s using an iterative -finding method, with support for up to 10 variables through successive single- solves or programmed multi-variable extensions. For a single f(x)=0f(x) = 0, the user creates a global program defining ff with MVAR "X", provides an initial guess, and activates SOLVE, which iterates until convergence (default tolerance 1E-9) or a maximum of 100 steps, displaying status codes (0-4) in the T-register to indicate exact , , or failure (e.g., no sign change). For multi- systems, users can implement various iterative methods, such as Newton-Raphson with s via matrix operations within programs, iterating steps with convergence checked against a user-defined ; practical limits are 10 variables due to . An example solves x2+y2=1x^2 + y^2 = 1 and x+y=0x + y = 0 starting from guesses (0.5, -0.5), converging to (0.7071, -0.7071) in few iterations. Convergence criteria include residual norms below tolerance, with safeguards against divergence like failed . This tool handles real solutions only, excluding complexes, and requires well-behaved functions to avoid "Bad Guess" or "Complex Root" errors. Matrix operations in the HP-42S support real rectangular matrices with dimensions from 0 to 999 rows and columns, though actual sizes are constrained by available memory (typically up to 29×29 on the original hardware). Accessed via the MATRIX menu, users create matrices with NEW (e.g., 3 ENTER 4 NEW for a 3×4 matrix), edit entries using the Matrix Editor, and perform operations including /, , division (right-division by solving systems), inversion (INV), (DET), transposition (TRAN). Vector functions include dot products (.) and products (CROSS) for 3D vectors. For example, inverting a 2×2 matrix (1234)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} yields (211.50.5)\begin{pmatrix} -2 & 1 \\ 1.5 & -0.5 \end{pmatrix} with =-2. These operations use for inversion and determinants, with available programmatically for positive-definite cases. Memory allocation dynamically assigns space to matrix variables (e.g., MAT A), impacting overall as noted in the calculator's register management. No direct complex matrix support exists, but real operations suffice for most scientific applications. Additional utilities enhance versatility: base conversions via the BASE menu allow seamless switching between binary (BINM), (OCTR), (DECM), and (HEXM) for integers up to 36-bit precision, supporting logical operations like AND, OR, XOR on binary representations. Date functions include DDAYS for days between dates, DATE+ and DATE- for arithmetic, and DMY/MDY/YMD for format conversions, using numbers internally for accuracy from year 0 to 9999. Unit conversions are handled through the CONV menu, offering a limited set in categories like (IN MM), area (FT2 M2), volume (GAL L), time (HR MIN), energy (BTU J), power (HP W), pressure (PSI PA), and temperature (F C), performing direct numeric scaling without . These tools prioritize efficiency for on-the-fly calculations in contexts.

Programming System

Program Structure and Keystroke Programming

The HP-42S employs a keystroke-based , where users enter programs by recording sequences of keystrokes directly into via the PRGM mode, mimicking the calculator's RPN operation for immediate execution or later recall. Programs are structured as numbered lines of steps, with a total capacity of up to 7200 bytes shared across all programs and data, allowing for thousands of lines depending on instruction length (typically 1-7 bytes per step). Each program begins with a global label defined using the LBL command followed by an alphanumeric string (up to 7 characters) and terminates with an END instruction, enabling modular organization and subroutine calls. Flow control is facilitated by and loop instructions. Unconditional branching uses the GTO command to jump to a specified or label, while conditional branches employ one of 12 test functions (such as X<0?, X=Y?, or X≤Y?) followed by GTO or a skip instruction, allowing decisions based on stack values or flags. Loops are implemented via DSE (decrement and skip if equal or less) or ISG (increment and skip if greater), which modify an indirect register or variable and skip the next line if the condition is met, supporting indexed iteration with user-defined increments and endpoints. Local labels, numbered LBL 01 through 99, provide subroutine entry points within a program, distinct from global labels for inter-program referencing. The calculator supports over 600 programmable functions, encompassing arithmetic, trigonometric, statistical, matrix, and programming-specific operations, which can be integrated into programs for complex computations. Key programming commands include XEQ for calling subroutines (up to 8 nesting levels), PSE for inserting a programmable pause (default 1 second, adjustable), and PROMPT for displaying alpha messages and halting execution to solicit user input from the stack or registers. Program editing occurs in PRGM mode, where users navigate lines using the up/down arrow keys, insert new steps with INS, or delete with ; additional utilities allow merging programs from the catalog or copying lines between programs. Execution initiates via the R/S key for the current program, XEQ from the catalog or keyboard for labeled programs, or custom menu assignments; programs interact with the four-level RPN stack for manipulation during runtime. Debugging features include single-step tracing with SST (advances one line) and BST (back-steps one line), enabling precise inspection of stack states and program flow without full execution.

Registers, Flags, and Memory Management

The HP-42S utilizes a system of storage registers to hold during calculations and programming. Numbered registers, designated R.00 through R.99, primarily store real or complex numbers and are accessed via STO and RCL commands with numeric indices. By default, the calculator allocates 25 such registers (R.00 to R.24), but users can expand this to a maximum of 100 using the SIZE command, which adjusts the number of available registers while balancing overall usage. Alpha registers, labeled A through Z, function as named variables capable of storing strings, real numbers, complex numbers, or even matrices, offering flexible beyond simple numeric storage. In programming contexts, these registers operate globally across all programs, ensuring persistent access, though program-specific temporary storage can be managed via the return stack or flags to avoid conflicts. Flags in the HP-42S serve as binary indicators for conditional logic and control. The calculator features 100 flags, numbered 00 through 99, of which 00-35 and 81-99 (55 flags) are user flags that can be set with SF, cleared with CF, and tested using FS or FC commands to influence program flow, such as in branching statements like IF or conditional skips. Flags 36-80 are flags with predefined functions that can only be tested. These flags enable efficient decision-making without consuming register space, with their state preserved across program executions unless explicitly altered. Among these, several are designated as flags that govern operational modes; for instance, flag 11 enables automatic program execution on , flag 24 suppresses certain messages, and flags 68 through 71 select the base mode for operations. Flag usage in branching is detailed in the programming structure, where they facilitate tests like SF 01 x?0 LBL 01 for conditional jumps. Memory management on the HP-42S emphasizes efficient use of its fixed 8,192-byte RAM, of which approximately 7,200 bytes remain available after allocating space for the stack, alpha register, and flags. Memory is dynamically shared among programs, registers, matrices, and other objects, with automatic garbage collection reclaiming unused space to prevent fragmentation and maximize capacity. Users control allocation through the command, which sets the number of numbered registers (up to 100) or program steps (up to 950 in base configuration), trading off between storage types as needed. Reset commands include CLEAR for the display and stack, CLREG to zero all registers, CLVAR to delete variables, and CLALL for a full clear, each allowing targeted management without total reinitialization. Program integrity is verified via built-in calculations, displayed with the CHKS command to detect corruption in stored code. While the HP-42S lacks official expansion hardware, its printing capability with the HP-82240 printer enables program and backup to external media for effective capacity extension.

Applications and Examples

Built-in Program Examples

The HP-42S includes several built-in functions that enable users to perform common mathematical tasks through straightforward key sequences, without requiring extensive programming. These built-in capabilities leverage the calculator's solver, statistical , and matrix operations to handle tasks like , data fitting, and linear algebra computations efficiently. Examples below illustrate key sequences for typical applications, drawing from the device's native functions.

Quadratic Equation Solver Using SOLVE

The SOLVE function allows numerical solution of equations defined via simple programs or algebraic expressions, making it suitable for solving quadratic equations of the form ax2+bx+c=0ax^2 + bx + c = 0. To implement this, users first create a short function program to represent the equation, then invoke SOLVE with coefficient inputs and initial guesses. This approach prompts for a, b, and c, and computes roots while optionally displaying the discriminant b24acb^2 - 4ac for verification of real solutions. Key sequence example (assuming complex mode off for real roots):
  1. Press PRGM to enter program mode.
  2. LBL "Q" (label the function).
  3. MVAR "X" (select variable to solve for).
  4. RCL "A" (recall coefficient a).
  5. RCL "X" (variable).
  6. X² (square it).
  7. × (multiply by a).
  8. RCL "B" (recall b).
  9. RCL "X" (variable).
  10. × (multiply by b).
    • (add terms).
  11. RCL "C" (recall c).
    • (add c to complete f(x) = a x^2 + b x + c).
  12. RTN (end program).
  13. Exit program mode.
  14. STO "A" (enter value for a, e.g., 1 ENTER STO "A").
  15. STO "B" (e.g., -5 ENTER STO "B").
  16. STO "C" (e.g., 6 ENTER STO "C").
  17. SOLVE (access solver menu).
  18. Select "Q" as the function.
  19. Enter initial guess (e.g., 0 for one root).
  20. Press SOLVE or DO IT to compute root (e.g., X=3).
  21. Repeat with another guess (e.g., 2) for second root (X=2).
  22. To view discriminant: RCL "B" X² 4 RCL "A" × RCL "C" × - (result: 1, indicating two real roots).
This yields roots 2 and 3 for the example x25x+6=0x^2 - 5x + 6 = 0, with the confirming real solutions (positive value).

Statistical Regression Program

The HP-42S supports through built-in summation (Σ+) and curve-fitting (CFIT) functions, ideal for analyzing data pairs to compute fits like y=mx+by = mx + b and the r. Users enter x-y pairs sequentially, accumulate statistics, and retrieve regression parameters, providing quick insights into linear relationships without custom coding. Key sequence example (for data: (1,2), (3,4), (5,6); expected fit y ≈ x + 1, r=1):
  1. CLEAR Σ (clear statistical registers).
  2. 2 ENTER 1 Σ+ (enter first pair: y=2, x=1).
  3. 4 ENTER 3 Σ+ (second pair).
  4. 6 ENTER 5 Σ+ (third pair).
  5. STAT (access statistics menu).
  6. CFIT (curve fit submenu).
  7. LINF (select linear fit y=mx+).
  8. RCL (slope m ≈ 1).
  9. RCL (intercept b ≈ 1).
  10. RCL (correlation = 1, perfect fit).
This outputs m=1, b=1, and r=1, verifying the linear relationship in the sample . For larger datasets, data can be stored in a matrix and accumulated via Σ+ on the entire matrix.

Matrix Multiplication Demo

Matrix operations on the HP-42S use built-in functions like NEWMAT for creation and × for multiplication, supporting demos of basic linear algebra. For 2x2 matrices, users define A and B via the matrix editor, perform multiplication, and verify results element-wise. Key sequence example (A = [[1,2],[3,4]], B = [[5,6],[7,8]]; expected A×B = [[19,22],[43,50]]):
  1. MATRIX (access matrix menu).
  2. 2 ENTER 2 NEWMAT ALPHA A ALPHA (create 2x2 matrix A, name it).
  3. 1 ENTER MATRIX 1,1 (edit A[1,1]=1).
  4. 2 ENTER MATRIX 1,2 (A[1,2]=2).
  5. 3 ENTER MATRIX 2,1 (A[2,1]=3).
  6. 4 ENTER MATRIX 2,2 (A[2,2]=4).
  7. MATRIX 2 ENTER 2 NEWMAT ALPHA B ALPHA (create B similarly).
  8. 5 ENTER MATRIX 1,1; 6 ENTER MATRIX 1,2; 7 ENTER MATRIX 2,1; 8 ENTER MATRIX 2,2.
  9. RCL "A" ENTER RCL "B" × (multiply; result in X register).
  10. MATRIX 1,1 (view [1,1]=19).
  11. MATRIX 1,2 (=22); MATRIX 2,1 (=43); MATRIX 2,2 (=50).
Verification: Manual check confirms [[15+27, 16+28],[35+47, 36+48]] = [[19,22],[43,50]]. Matrices must have compatible dimensions (columns of A equal rows of B). These built-in examples highlight the HP-42S's efficiency for routine tasks, such as using Σ+ for statistical accumulation and INTEGRATE for numerical areas under curves, though full custom programs are needed for more advanced scenarios. Limitations include real-number restrictions in some matrix operations and the need for initial guesses in SOLVE to avoid convergence issues.

User-Programmed Applications

The HP-42S enables users to create custom programs for specialized numerical tasks, leveraging its keystroke-based programming system to implement iterative algorithms and data output routines. These user-developed applications demonstrate the calculator's extensibility, allowing engineers, scientists, and financial analysts to tailor solutions for non-standard problems. A practical example is a numerical root finder program that uses an iterative method to approximate roots of non-polynomial functions, incorporating loops for convergence and a tolerance parameter to control precision. For instance, the RTMIN program implements Newton's method with user-defined function evaluation, requiring an initial guess, maximum iterations (e.g., 55), and tolerance (e.g., 1E-7); it approximates derivatives numerically and iterates until the change in x falls below the tolerance, as demonstrated by finding the root of f(x)=ex3x2f(x) = e^x - 3x^2 at x ≈ 3.73308 in 9 iterations. This approach highlights the use of conditional tests and storage registers to manage iteration variables and error checks. Another user-programmed application is a generator for a table, which computes and outputs values for angles from 0° to 360° in 15° increments, storing results in the alpha register for display or . Such a program employs a loop structure with incrementing storage (e.g., using STO and RCL on a register), trigonometric function calls ( and COS), and alpha string manipulation (e.g., AVIEW for output), terminating after 25 iterations to produce a tabular summary suitable for quick reference in geometric or calculations. Programming techniques from the official manual illustrate similar loop implementations for repetitive computations, ensuring efficient execution within the 7.2 KB limit. In finance, a user program for internal rate of return (IRR) calculation handles cash flow arrays stored as matrices, iteratively solving for the discount rate that sets net present value to zero. The CFLO program from the Finance suite prompts for a cash flow matrix (e.g., via the built-in matrix editor), then uses the SOLVE function on a NPV subroutine to converge on IRR; for cash flows of -1000, 300, 400, 500, it yields an IRR of approximately 9.17%. This method supports uneven cash flows with optional frequencies, making it valuable for investment analysis. Best practices for these applications include employing subroutines via LBL/RTN pairs to modularize code, reducing redundancy—for example, a subroutine can handle repeated function evaluations, shortening programs by up to 13 lines as shown in statistical applications. Error trapping with flags (e.g., SF 25 to ignore runtime errors and to a recovery routine) ensures robustness, displaying custom messages like "Out of Range" and allowing retries without halting execution. These techniques, detailed in Hewlett-Packard's programming guide, promote efficient memory use and reliable operation in complex user programs.

Emulation and Modern Relevance

Software Emulators

Software emulators for the HP-42S provide accurate simulations of the calculator's functionality, allowing users to run original programs and replicate hardware behavior on modern devices without requiring physical ROM images in most cases. These tools preserve the RPN keystroke and support loading of .raw program files converted via utilities like raw2txt and txt2raw. Free42, developed by Thomas Okken since 2004, is a complete re-implementation of the and its companion HP-82240 printer, written from scratch without any original HP code to ensure legal availability. It offers binary precision ( double, approximately 16 digits) and decimal precision (Intel Decimal Floating Point, 34 digits) versions, with the latter recommended for closer fidelity to the 's 12-digit mantissa behavior. Available on Windows (Vista+), macOS (10.13+), (x86_64), Android (4.4+), and (12.0+), Free42 supports all original functions, including matrix operations, integration, and solving, plus enhancements like extended base conversions up to 64 bits, and handling, and device sensor access on mobile platforms. Printer emulation is included via the PRON function, displaying output in-app, and programs can be imported as .raw files or via copy-paste. The latest version is 3.3.10, with updates as of April 2025 including refinements to raw file conversion tools and minor bug fixes for matrix operations to improve . Plus42, an enhanced variant of Free42 also by Thomas Okken and released starting in 2019, builds on the base simulator with additional features while maintaining compatibility with HP-42S programs. It uses decimal precision exclusively for higher accuracy in financial and scientific calculations, featuring an 8x22 resizable display, algebraic equation solving in HP-17B style, unit conversions akin to the HP-48/50 series, directory-based program organization, functions, and programmable menus. Graphing capabilities include 2D function plotting with zoom, panning, root finding, and . Platforms mirror Free42's, including Windows, macOS, , Android, and . Printer emulation extends to plots and equation traces, and .raw file loading is supported through the same conversion tools. The latest version is 1.3.12, with updates through April 2025 incorporating bug fixes for enhanced matrix handling and graphing precision. Other notable emulators include Emu42, developed by Christoph Giesselink, which provides cycle-accurate emulation of the HP-42S using actual ROM dumps for exact replication of hardware timing and behavior. Targeted at Windows (9x/ME/2000/XP) and older Pocket PC devices (2002/2003), it supports full keystroke programming and printer output simulation but lacks modern platform ports. The latest versions are v1.32 for Windows and v1.19 for Pocket PC, with changes as of August 2025. For legacy Palm OS devices, an earlier version of Free42 (up to 1.4.71 in 2017) serves as a pocket-friendly simulator, compatible with MathLib for advanced functions and allowing .raw program imports. These tools collectively enable ongoing use of HP-42S software in 2025, with community-maintained accuracy to original ROM behaviors where applicable.

Community and Legacy Resources

The HP-42S maintains a dedicated enthusiast community through online forums and discussion groups, where users share programs, troubleshooting tips, and restoration projects. The Museum of HP Calculators (MoHPC), a comprehensive resource for vintage HP devices, hosts active forums with threads dedicated to the HP-42S, including user-shared programs and acquisition advice, with recent activity as of November 2025. On Reddit's r/calculators subreddit, discussions frequently cover repairs, such as addressing battery contact corrosion and keyboard foam degradation, as well as modern clones like the SwissMicros DM42 hardware emulator. The DM42, based on Free42, received firmware updates in September 2025 (v3.25) and a variant DM42n in November 2025 (v3.26). Reference materials for the HP-42S include the original 1988 owner's manual, a 320-page document covering operations, programming, and applications, available as scanned PDFs from archival sites. An alternative user manual, "An Alternative HP-42S/Free42 Manual" by José Lauro Strapasson (version 0.7, 2010), provides detailed guidance on features and is freely distributed as a PDF, complementing the official documentation with clearer explanations for both the physical calculator and its emulations. Hewlett-Packard's "Programming Examples and Techniques for the HP-42S" (1989) offers practical coding examples for scientific and engineering tasks, serving as a key resource for advanced users. As a legacy device, the HP-42S holds collectible value, with functional units typically selling on for $150 to $300 depending on condition and accessories, reflecting its status among enthusiasts. Its design has influenced open-source projects, notably Free42 and Plus42, accurate software simulators that replicate its RPN programming without proprietary code, fostering continued development in the emulation space. Despite its age, the HP-42S remains relevant in and , with users employing it for circuit , numerical computations, and custom programs in workflows. Additional resources include online libraries of RAW-format programs, such as the hpcalc.org archive and Thomas Okken's collection, which provide downloadable binaries for applications like and statistical analysis compatible with the HP-42S or emulators. Repair guides address common issues like battery leaks, which can corrode contacts; community advice recommends cleaning with , replacing LR44 batteries, and inspecting for foam deterioration in the keyboard assembly, often detailed in MoHPC forum threads and tutorials.

References

Add your contribution
Related Hubs
User Avatar
No comments yet.