Skip to content

Commit 16f03d2

Browse files
committed
USER_GUIDE.md: add new 'WSIZ' argument prompt, with screenshots
1 parent 8e3aad2 commit 16f03d2

File tree

4 files changed

+49
-44
lines changed

4 files changed

+49
-44
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
function, so that they are consistent with the `>POL` function.
1111
- `Y` register holds the `y` value, which is entered first, then
1212
- `X` register holds the `x` value, which is entered second.
13+
- **Breaking**: Change `WSIZ` to prompt the user for the base word size
14+
using `WSIZ _ _` prompt, instead of using the value in the `X` register.
15+
- Solves a major usability problem where the user was forced to enter
16+
the word size using the currently selected base mode (e.g. `HEX` or
17+
`BIN`). For example, the word size `16` was required to be entered as
18+
`100000` in `BIN` mode, which was too confusing.
19+
- See [Base Word Size](USER_GUIDE.md#base-word-size) for more details.
1320
- **Bug Fix**: Tweak the stack-lift enable/disable logic so that certain
1421
operations (RollDown, RollUp, X<>Y) enable stack lift even if the previous
1522
command was a `CLEAR` or `CLX`.

USER_GUIDE.md

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ RPN calculator app for the TI-83 Plus and TI-84 Plus inspired by the HP-42S.
4646
- [Base Arithmetic](#base-arithmetic)
4747
- [Carry Flag](#carry-flag)
4848
- [Bit Operations](#bit-operations)
49-
- [Base Integer Size](#base-integer-size)
49+
- [Base Word Size](#base-word-size)
5050
- [Base Input Digit Limit](#base-input-digit-limit)
5151
- [Base Mode Retention](#base-mode-retention)
5252
- [STAT Functions](#stat-functions)
@@ -1531,15 +1531,15 @@ This menu row contains a couple of additional bit manipulation functions:
15311531

15321532
None of these bit operations affect the Carry Flag.
15331533

1534-
#### Base Integer Size
1534+
#### Base Word Size
15351535

15361536
The HP-42S uses a 36-bit *signed* integer for BASE rendering and operations. To
15371537
be honest, I have never been able to fully understand and become comfortable
15381538
with the HP-42S implementation of the BASE operations. First, 36 bits is a
1539-
strange number, it is not an integer size used by modern microprocessors (8, 16,
1540-
32, 64 bits). Second, the HP-42S does not display leading zeros in `HEX` `OCT`,
1541-
or `BIN` modes. While this is consistent with the decimal mode, it is confusing
1542-
to see the number of displayed bits change depending on its value.
1539+
strange number, it is not a multiple of 8 as used by most modern microprocessors
1540+
(8, 16, 32, 64 bits). Second, the HP-42S does not display leading zeros in `HEX`
1541+
`OCT`, or `BIN` modes. While this is consistent with the decimal mode, it is
1542+
confusing to see the number of displayed digits change depending on its value.
15431543

15441544
The RPN83P deviates from the HP-42S by using *unsigned* integers internally, and
15451545
rendering the various HEX, OCT, and BIN numbers using the same number of digits
@@ -1565,55 +1565,53 @@ it, then hit the `DEC` menu item to convert it to decimal. The displayed value
15651565
will be the decimal value of the original hex number, without the negative sign.
15661566

15671567
The word size, defaulting to 32 bits, can be changed using the `WSIZ` menu
1568-
function. To simplify the implementation code, only the following word sizes are
1569-
supported: 8, 16, 24, and 32, corresponding to 1, 2, 3, and 4 bytes
1570-
respectively. The RPN83P app represents all numbers internally using the TI-OS
1571-
floating point number format which supports 14 decimal digits. This corresponds
1572-
to 46.5 bits. Therefore, the largest word size that could be supported in the
1573-
current architecture is 40. Supporting a 64-bit word size would require a major
1574-
rearchitecture of the application
1568+
function. Pressing it displays `WSIZ _ _` and waits for the argument, just like
1569+
the `FIX` and `STO` commands. To simplify the implementation code, only the
1570+
following word sizes are supported: 8, 16, 24, and 32, corresponding to 1, 2, 3,
1571+
and 4 bytes respectively:
1572+
1573+
![WSIZ Prompt](docs/rpn83p-base-wsiz.png)
1574+
1575+
If an unsupported word size is entered, for example `9`, then the error code
1576+
`Err:Argument` will be displayed:
1577+
1578+
![WSIZ Error](docs/rpn83p-base-wsiz-err.png)
1579+
1580+
Note: The RPN83P app represents all numbers internally using the TI-OS floating
1581+
point number format which supports 14 decimal digits. This corresponds to 46.5
1582+
bits. Therefore, the largest word size that could be supported in the current
1583+
architecture is 40. Supporting a 64-bit word size would require a major
1584+
rearchitecture of the application.
15751585

15761586
Every `BASE` operation respects the current `WSIZ` value, truncating the `X` or
15771587
`Y` integers to the word size, before performing the `BASE` operation, then
15781588
truncating the result to the word size. For example, if the word size is 16,
15791589
then the `RR` (rotate right circular) operation rotates bit 0 to bit 15, instead
15801590
of bit 31 if the word size was 32.
15811591

1582-
The `WSIZ` command uses the value of the `X` register, but the value shown on
1583-
the display depends on the base mode. It is sometimes easier to temporarily
1584-
change to `DEC` mode, set the `WSIZ`, then change the base mode back. For
1585-
example, if we are in `BIN` mode, then we could use the following keystroke
1586-
sequence to change the `WSIZ` to 16:
1587-
1588-
```
1589-
10000 # 16 in base-2 BIN mode
1590-
WSIZ
1591-
```
1592-
1593-
But it may be easier to use the following instead:
1594-
1595-
```
1596-
BASE
1597-
DEC
1598-
16
1599-
WSIZ # use the UP arrow to go to this menu row quickly
1600-
BIN # use the DOWN arrow to go back to this menu row
1601-
```
1602-
16031592
The current `WSIZ` value can be retrieved using the `WSZ?` menu function.
16041593

16051594
**HP-42S Compatibility Note**: The original HP-42S does *not* support the `WSIZ`
16061595
command. Its word size is fixed at 36 bits. The Free42 app however does support
1607-
it as the `WSIZE` command. I suspect that Free42 borrowed the `WSIZE` command
1608-
from the HP-16C. Keen observers will note an unfortunate UI inconsistency: the
1609-
`WSIZE` command really ought to take the word size as an argument to the command
1610-
(similar to `FIX` and `STO`), instead of taking the word size from the `X`
1611-
register on the RPN stack. But that is how it is implemented on the HP-16C. For
1612-
consistency with Free42 and the HP-16C, the RPN83P app also implements the
1613-
`WSIZ` command in the same way, taking the word size from the RPN stack. This is
1614-
the fundamental source of the usability problem noted above, where the `BASE`
1615-
mode can be set to something other than `DEC`, causing the word size to be
1616-
displayed in a format which may be difficult for the user to read or enter.
1596+
it as the `WSIZE` command which I suspect was borrowed from `WSIZE` command on
1597+
the HP-16C. Keen observers will note a UI discrepancy: On the HP-16C and HP-42S,
1598+
the `WSIZE` command uses the value of `X` register to set the word size, but the
1599+
RPN83P *prompts* the user to enter the size using a `WSIZ _ _` prompt similar to
1600+
the `FIX` and `STO` commands. This decision was made to solve a major usability
1601+
problem on the RPN83P: The `X` register value in the `BASE` menu hierarchy is
1602+
shown using the currently selected base mode (e.g. `DEC`, `HEX`, etc). If the
1603+
mode was something other than `DEC`, for example `HEX`, then the user needs to
1604+
type `10 WSIZ` to set the `WSIZ` to 16 bits, because `10` is the base-16
1605+
representation of 16. Even worse, if the base mode was `BIN`, then the user must
1606+
type in `100000 WSIZ` to set the word size to `32` because `100000` is the
1607+
base-2 representation of `32`. I find this far too confusing. Instead, the
1608+
RPN83P uses the command argument prompt `WSIZ _ _` to obtain the word size from
1609+
the user in normal base-10 format. The prompt is not affected by the current
1610+
base mode so the user can type `8`, `16`, `24`, or `32` to select the new word
1611+
size without confusion. The `WSZ?` command returns the current word size in the
1612+
`X` register and will be displayed using the current base mode. I could not
1613+
think of any way around this, but I assume that this will not cause as much
1614+
usability problems as the `WSIZ` command.
16171615

16181616
### Base Input Digit Limit
16191617

docs/rpn83p-base-wsiz-err.png

1005 Bytes
Loading

docs/rpn83p-base-wsiz.png

913 Bytes
Loading

0 commit comments

Comments
 (0)