HP 42S: Difference between revisions

From CALCVERSE
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 11: Line 11:
There are three major revisions of HP 42s: A, B and C respectively. Revision A and B have a plastic pane in front of the LCD whereas revision C has a recessed LCD display. Revision C is the most commonly seen variant today.  
There are three major revisions of HP 42s: A, B and C respectively. Revision A and B have a plastic pane in front of the LCD whereas revision C has a recessed LCD display. Revision C is the most commonly seen variant today.  


HP 42s used a silicon-on-sapphire [[HP Saturn|Saturn]] architecture chip code-named "Lewis" with 64K of integral ROM and a RAM controller capable of addressing up to 64KB of memory, driving a 131x16 dot matrix display. 8KB of SRAM is soldered on board and roughly 7000 Bytes are available to the user as program steps or registers.  
HP 42s used a silicon-on-sapphire [[HP Saturn|Saturn]] architecture chip code-named "Lewis" with 64KB of integral ROM and a RAM controller capable of addressing up to 32KB of memory, driving a 131x16 dot matrix display. 8KB of SRAM is soldered on board and roughly 7000 Bytes are available to the user as program steps or registers.  


Internally, the HP 42s is extremely similar to both the [[HP 17B|HP 17B & BII]], and [[HP 27S]], with the exception of the lack of an extended ROM chip which on the 17 series contained international language & error message and on the HP 27S contained additional instructions. On the HP 42s, this position remains unsoldered. However, the instruction to jump to this memory location is still retained.
Internally, the HP 42s is extremely similar to both the [[HP 17B|HP 17B & BII]], and [[HP 27S]], with the exception of the lack of an extended ROM chip which on the 17 series contained international language & error message and on the HP 27S contained additional instructions. On the HP 42s, this position remains unsoldered. However, the instruction to jump to this memory location is still retained.
Line 41: Line 41:


== Memory Layout ==
== Memory Layout ==
Due to having its ROM dumped and emulators developed (and many exploration prior) the memory layout of the HP-42s is generally well know:
In the process of having its [https://www.finseth.com/hpdata/hp42s.php ROM dumped] and [https://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=266 emulators developed] (and many exploration prior) the memory layout of the HP-42s is generally well know:
{| class="wikitable"
{| class="wikitable"
|+Memory Layout of HP-42s  
|+Memory Layout of HP-42s  
(left inclusive right exclusive)
(both side inclusive)
!Address Start (hex)
!Address Start (hex)
!Address End (hex)
!Address End (hex)
Line 51: Line 51:
|-
|-
|00000
|00000
|20000
|1FFFF
|ROM
|ROM
|Executing from 00000 is the only way to exit the debugger without using a reset.
|Executing from 00000 is the only way to exit the debugger without using a reset.
Line 57: Line 57:
|-
|-
|40000
|40000
|4020C
|4020B
|Display
|Display
|Column 0, 66, 1, 67 ........ 64, 130, 65 with 4 nybbles per column for 16 pixels per column, 131 columns in total.  
|Column 0, 66, 1, 67 ........ 64, 130, 65 with 4 nybbles per column for 16 pixels per column, 131 columns in total.  
|-
|-
|40210
|40210
|4024D
|4024C
|Annunciators
|Annunciators
|Each word contains five nybbles that is either 00000 (off) or FFFFF (on).
|Each word contains five nybbles that is either 00000 (off) or FFFFF (on).
Line 68: Line 68:


from 40218 to 4024D each word controls multirow, shift, printing, busy, battery low, G and RAD (together forming GRAD) annunciators respectively.  
from 40218 to 4024D each word controls multirow, shift, printing, busy, battery low, G and RAD (together forming GRAD) annunciators respectively.  
|-
|40300
|4030F
|I/O registers
|Analogous to HP-28C, function unclear as there is no external I/O for HP-42s. Hardware CRC at 40304.
|-
|403F8
|403FF
|Clock
|8 nibbles, counts down at 8192 ticks per second
|-
|50000
|5FFFF
|RAM
|by default 8K repeated 4 times, however a single 32KB 28-pin 300mil SOIC SRAM chip could be soldered and correctly recognized.
|-
|50082
|50083
|Last key
|One-byte code, see below
|-
|50084
|50085
|Keyboard pointers
|Head and tail respectively.
|-
|50086
|500A5
|Keyboard buffer
|Circular 16 bytes buffer, using one-byte code, order from left to right & top to bottom, same as GETKEY, ENTER counts as one key.
Shifted keys are represented by adding 37 to its keycode.
|-
|500B8
|500DF
|Pointers
|Three five nybbles pointers to top of stack, to program END, to REGS variables and then rest of variables list respectively.
|-
|503F6
|503F7
|Alpha length
|Length of the string stored in ALPHA register
|-
|502F8/
503F8
|5044F/
5044B
|Alpha register
|May be version dependent
|}
|}

Revision as of 12:29, 3 February 2022

HP 42s
TypeScientific calculator
Introduced1988
Discontinued1995
PredecessorHP 41C
SuccessorHP 32S, HP 48SX
Calculator
Display typeDot-Matrix LCD
Programming
Other

The HP42s is a high-end RPN calculator in the HP Pioneer line. Launched in 1988, It was originally meant as a HP 41C replacement and thus had FOCAL compatibility, capable of running most HP 41C programs with little modification. However it was hampered in this role due to its lack of extensions and limited I/O capabilities, and was discontinued early (as compared to HP 17B) in favour of HP 48SX in 1995.

Overview

There are three major revisions of HP 42s: A, B and C respectively. Revision A and B have a plastic pane in front of the LCD whereas revision C has a recessed LCD display. Revision C is the most commonly seen variant today.

HP 42s used a silicon-on-sapphire Saturn architecture chip code-named "Lewis" with 64KB of integral ROM and a RAM controller capable of addressing up to 32KB of memory, driving a 131x16 dot matrix display. 8KB of SRAM is soldered on board and roughly 7000 Bytes are available to the user as program steps or registers.

Internally, the HP 42s is extremely similar to both the HP 17B & BII, and HP 27S, with the exception of the lack of an extended ROM chip which on the 17 series contained international language & error message and on the HP 27S contained additional instructions. On the HP 42s, this position remains unsoldered. However, the instruction to jump to this memory location is still retained.

One notable feature that it shares with HP 17B and HP 27S is its capability to print to a thermal printer using infrared. The corresponding thermal printer is the HP 82240. It is the only calculator in the Pioneer line capable of utilizing the graphics printing capability of the 82240, while other calculators in the line are limited to printing characters.

The HP-42s runs on SysRPL with many low level assembly language tweaks, and thus it supports many advanced features like the HP 28C series. For example, it treats complex values as an object taking up one stack level (instead of consuming two stacks on the HP 41C or having a separate imaginary stack as on the HP 15C). It also supports plotting to LCD with each pixel being individually addressable, and thus capable of drawing or plotting under program command. However unlike the HP 28C, it supports only 4 stack levels and does not have built-in plotting utilities, requiring the user to program their own.

Like other Pioneers, HP 42s ships with a debugger and self-test routine.

Known Bugs

There are only two known bugs on the HP 42s.

The first HP-42s bug relates to the COMB (combination) and PERM (permutation) instructions. Nominally these two instructions calculates C(y,x) = y!/(x!*(y-x)!) and P(y,x) = y!/(y-x)!. Since factorial is strictly positive, an input of x<y correctly raises "Invalid Data" error. However this error flag is not correctly cleared, for example when using x<>y and executing the respective command again, and will require an arbitrary arithmetic operation to correctly clear (for example 0 +). This bug has been reported in all revisions except some mid-serial-range revision A machines, and is believed to be a software-hardware interfacing issue. A simple workaround is to always to prepend the command with x<y? x<>y (check if x<y and swap if true).

The second HP-42s bug is far more interesting: All register values are stored in a matrix called "REGS" on HP-42s. If one were to delete this matrix and then execute a statistic input (i.e. CLV "REGS" then Sigma+), forcing an "Invalid Type" error, RCL and STO in this state will, instead of recalling and storing to registers, directly read from and write to memory. The memory location RCL will read from is calculated as (RegisterNbr + 184) x 16 converted to hexadecimal, and the location STO will write to is (RegisterNbr x 2 + 184) x 16. Sometimes the offset is also reported as +183 which is due to how resgister on HP-42s is numbered from 00 to 99 and up to the value in SIZE. In that case R00 would count as the first register.

Hardware Mods

Some users have reported success replacing the RAM chip of their HP 42s with up to 32KB of RAM and modifying the LC circuit to force the chip to run at twice the clock speed. However it must be noted due to the construction of Pioneers calculators, opening a HP 42s involves drilling heat-stakes and thus will irreversibly reduce its structural integrity.

Tricks

*note: the top row of keys are customarily labeled A-F from left to right.

HP 42s has two resets: Master reset which puts the calculator back to "factory condition", clearing all memory with On+A+F and Machine reset with On+C which interrupts any program and sets the calculator into a set state ready to receive user input again, but does not cause any memory loss.

As with the HP 27S and HP 17B, the self test is triggered with On+D.

On the first screen of the self test routine hitting backspace (<-) will put the calculator in debugger. In this state the Up/Down keys, Divide/Multiply keys, Add/Substraction keys can be used to increment or decrement the current memory address by 1000,100 and 1 nybble(s) respectively. Number keys, and A-F keys will key in (replace) the current memory address with the hexadecimal value 0-9 and A-F and move by 1 nybble forward. Backspace key will refresh the debugger and . (decimal point) key executes from this memory location. the COS key will move the memory address by 10 nybbles and print the memory at that location to IR, which can be then received by a HP-48 using INPRT to dump the ROM.

Memory Layout

In the process of having its ROM dumped and emulators developed (and many exploration prior) the memory layout of the HP-42s is generally well know:

Memory Layout of HP-42s (both side inclusive)
Address Start (hex) Address End (hex) Content Note
00000 1FFFF ROM Executing from 00000 is the only way to exit the debugger without using a reset.

Executing from 023F1 (default entry point for debugger) displays the software revision and a one byte warm-start log. (often erroneously reported along with revision, e.g. A7, C5.....)

40000 4020B Display Column 0, 66, 1, 67 ........ 64, 130, 65 with 4 nybbles per column for 16 pixels per column, 131 columns in total.
40210 4024C Annunciators Each word contains five nybbles that is either 00000 (off) or FFFFF (on).

40210-40215 is a word that lights up all announciator.

from 40218 to 4024D each word controls multirow, shift, printing, busy, battery low, G and RAD (together forming GRAD) annunciators respectively.

40300 4030F I/O registers Analogous to HP-28C, function unclear as there is no external I/O for HP-42s. Hardware CRC at 40304.
403F8 403FF Clock 8 nibbles, counts down at 8192 ticks per second
50000 5FFFF RAM by default 8K repeated 4 times, however a single 32KB 28-pin 300mil SOIC SRAM chip could be soldered and correctly recognized.
50082 50083 Last key One-byte code, see below
50084 50085 Keyboard pointers Head and tail respectively.
50086 500A5 Keyboard buffer Circular 16 bytes buffer, using one-byte code, order from left to right & top to bottom, same as GETKEY, ENTER counts as one key.

Shifted keys are represented by adding 37 to its keycode.

500B8 500DF Pointers Three five nybbles pointers to top of stack, to program END, to REGS variables and then rest of variables list respectively.
503F6 503F7 Alpha length Length of the string stored in ALPHA register
502F8/

503F8

5044F/

5044B

Alpha register May be version dependent