diff --git a/doc/calculator.png b/doc/calculator.png index faa248b..0564f83 100644 Binary files a/doc/calculator.png and b/doc/calculator.png differ diff --git a/doc/calculator.xcf b/doc/calculator.xcf index 0dfc8f9..ef41d9f 100644 Binary files a/doc/calculator.xcf and b/doc/calculator.xcf differ diff --git a/doc/implementation.rst b/doc/implementation.rst index 00b0a13..df94ff2 100644 --- a/doc/implementation.rst +++ b/doc/implementation.rst @@ -95,9 +95,10 @@ keyboard, so that also makes some sense. The logical operations are held together in the usual order you say them, AND, OR, XOR, which also is the alphabetical order. -When you feel that you need to work with floating point numbers, you -probably want to use that PI constant, so the ``FLOAT`` operation to -switch to floating point mode is on the PI key. - Sign extension is on the ``EEX`` key, which is almost spelled the same. + +The shifted ``USER`` key performs the ``EXITAPP`` function which +exists the Ladybug shell and takes you back to the previous shell. +This key was chosen as it is always free and the ``USER`` key is +related to affecting the keyboard layout. diff --git a/doc/keyboard.rst b/doc/keyboard.rst index 416822b..81e6b1d 100644 --- a/doc/keyboard.rst +++ b/doc/keyboard.rst @@ -26,9 +26,9 @@ Deactivation ============ Once activated, the HP-41 stays in integer mode until you execute the -``FLOAT`` instruction. This can be done by pressing the shift key -followed by the PI (0 key). It is also possible to execute the -``FLOAT`` instruction using the ``XEQ`` key and spell it out as +``EXITAPP`` instruction. This can be done by pressing the shift key +followed by the USER key. It is also possible to execute the +``EXITAPP`` instruction using the ``XEQ`` key and spell it out as usual. Another way to disable Ladybug is to turn the calculator off and diff --git a/doc/reference.rst b/doc/reference.rst index fa9d288..e9a852e 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -28,13 +28,19 @@ well. .. index:: float mode, mode; float -.. object:: FLOAT +.. object:: EXITAPP - Switch to floating point mode, leaving integer mode. This restores - the keyboard and display to its normal floating point behavior. + Leave integer mode by exiting Ladybug and switching back to + floating point mode. This restores the keyboard and display to its + normal floating point behavior. - Integer instructions in floating point mode still works, but will - not display or use the dedicated keyboard. + Technically it leaves the current active application shell and goes + back to the shell that was active before it. The very last such + shell is the standard calculator behavior. + + Integer instructions still work when the Ladybug application is + inactive. What happens is that the Ladybug display and keyboard + overrides are no longer active. .. index:: binary base, base; binary diff --git a/src/ladybug.s b/src/ladybug.s index 37f70b5..25d4baa 100644 --- a/src/ladybug.s +++ b/src/ladybug.s @@ -85,7 +85,7 @@ XROMno: .equ 16 FatStart: .fat LadyHeader ; ROM header FAT Literal - FAT FLOAT ; mode change + FAT EXITAPP ; drop to previous App .fat Integer FAT Binary ; base related instructions FAT Octal @@ -1013,19 +1013,16 @@ exitNoUserSTR1: ;;; ********************************************************************** ;;; -;;; FLOAT - restore float mode operation +;;; EXITAPP - restore float mode operation ;;; -;;; Essentially we just disable our own shell (if it exists). +;;; In reality we exit the top application shell. ;;; ;;; ********************************************************************** .section Code, reorder - .name "FLOAT" -FLOAT: nop ; non-programmable - ; (allow mode switch in program mode) - ldi .low12 ladybugShell - gosub exitShell ; must be a gosub to provide page address - golong NFRPU ; must golong as exitShell uses +3 levels + .name "EXITAPP" +EXITAPP: gosub exitApp + golong NFRC .section Code, reorder noBuf: gosub errorMessage @@ -5298,7 +5295,7 @@ keyTable: .con BuiltinKey(0xa8) ; SF KeyEntry SB ; 4 KeyEntry AND ; 1 (FIX key) - KeyEntry FLOAT ; 0 + KeyEntry WSIZE? ; 0 ;; Logical column 2 .con 0x10c ; SQRT (C digit) @@ -5355,9 +5352,9 @@ keyTable: KeyEntry RRC ; TAN .con 0 ; BST KeyEntry CLXI ; BACKARROW - KeyEntry ALDI ; MODE ALPHA - KeyEntry MASKR ; MODE PRGM - KeyEntry MASKL ; MODE USER + KeyEntry MASKR ; MODE ALPHA + KeyEntry MASKL ; MODE PRGM + KeyEntry EXITAPP ; MODE USER .con 0 ; OFF key special ;;; ----------------------------------------------------------------------