HP48 FAQ Section 4: Questions about the Operating System and Using the HP
Previous | Contents | Next |
Many documents (including this FAQ) make references to the "checksum" of an object. This is a 16-bit user binary resulting from a CRC calculation on the contents of an object. This binary is supposed to be relatively unique, with only 1 change in 65536 of accidental equal checksums on two different objects. This allows you to distinguish programs that look the same but may be quite different (even if the size of them is the same). It is also often used to verify correct transmission of files.
You can find the checksum of an object using the BYTES command. This will return you two things - the size of the object in bytes on level 1, and the checksum on level two. Note that while the checksum of a variable name is the same as running the checksum on the object itself, the sizes will be differ by 4.5 bytes + the size of the variable name itself.
In rare cases the checksum of two objects can be the same, even if the objects are different. This is due to the limited nature of the HP48's checksum function. You can use the SAME command in these cases.
From: Joe Horn
Many commercial programs (like Windows) have similar hidden screens that list the program's design team. Since they are always so cute and well hidden, they are often referred to as "Easter eggs". The RULES command on the G/GX is one such example.
Try using the RULES command. The names you see are as follows:
/----------------------\
| M G |
| P DIANA |
| CHARLIE X B D |
| BILL U N TED A |
| O A L N ALCUIN |
| B I JIM V |
| RON S E |
\----------------------/
ALCUIN was the HP-internal code name of the HP48 G during development, because Alcuin was Charlemagne's teacher, and Charlemagne, as you remember, was the code name of the HP48 SX.
The other names in the "Easter egg" above belong to:
The HP48 must occasionally do "garbage collection" to free up unused memory, and it is this garbage collection that is causing the momentary "freeze". "Garbage collection" is where the HP48 scans through memory, looking for objects that are no longer used.
Using less stack supposedly makes garbage collection go faster.
The easiest way to force a garbage collection is to run MEM DROP. Otherwise you can use #05F42h SYSEVAL or the SysRPL command GARBAGE.
The usual causes for this are RAM/ROM cards and libraries. When you turn the calculator on, it checks RAM (the more you have, the longer it takes), and checks to see if any libraries need initializing.
Also, having a lot of alarms can supposedly also cause this.
From: Dave Arnett
In most cases, this will move you to, or toward, the stack environment.
This is the manual Coldstart. It will break out of almost any hung program, and offer you the dreaded option... "Try to recover memory?" Note that this is your next-to-last resort in a lock-up, so don't give your machine this three-fingered salute unless you really want to possibly clear memory.
This is the Oops! key for ON codes. For many ON sequences, this cancels the operation, so long as you press the B before releasing the ON key. Try it sometime, if you must, just so you remember it. It can be a life-saver, in case of an accidental ON+A+F in process, or even accidentally hitting ON during a plotting routine.
This will initiate a Warmstart. You'll lose the stack and PICT, but it will often get you out of a locked up program with memory intact.
Enters interactive test mode. Back up your own machine and play around. Exit this test mode with Warmstart, ON+C. See the next question for all the various tests available here.
Starts a looping self-test mode. Kinda dull after the first five minutes, but it keeps a rather solid tempo. Exit with Warmstart, ON+C.
Cancels repeating alarms.
Screen dump utility.
Adjusts display contrast.
Initiates Coma Mode and clears Warm Start Log. In Coma mode, all the clocked activity is halted. The battery power drain is basically the few nano-amps [nA] necessary to sustain your RAM contents. The Warm Start Log is a nearly bullet-proof area of memory which keeps track of the last four hazardous events. View it using the command WSLOG. This log is one of the few things not cleared by a Coldstart. But it is cleared by ON+SPC. Enter Coma this way if you want to clear the Warm Start Log, if you are planning to study crystal healing in Tibet for a few years and want to keep your pirated version of Tetris alive, or you just have a low power fetish. Exit Coma mode with the ON key (tough to remember, huh?), and plan to find your stack cleared out.
Two additional notes on this Coma stuff. First, I'm not gonna try to list the log codes in WSLOG. Sorry! Second, if your machine is on, and you drop the batteries out, you will usually end up in a coma mode to preserve power. WSLOG will not be cleared. Instead, you will find a code 1 entry there. Some people are paranoid and want to be in Coma when they change batteries, just in case they have a sudden emergency call from the Prime Minister and don't get back to their battery change for a half hour. If you are one of these... shall I say, weenies? No, that would be unprofessional ...users, then I recommend you use the ON+SPC entry route, rather than the kamikaze method of dropping batteries with the machine running. Myself, I just turn the machine OFF, like the manual says.
Now, a Coma story... sort of. During the G/GX development, I maintained a small number of units on which I changed ROM chips as incremental code releases came out. This was so folks like Bill Wickes and Jim Donnelly could have fully-real hardware to test, instead of just the EPROM handsets some of you may have seen. We always backed up anything of importance in the machine before we did this. But I got into the habit of using ON+SPC before I opened up the calculator. Better than half of the time, I could remove the batteries, open the case, desolder the old surface-mounted ROM chip, solder down a new chip, and reassemble the machine... with all of RAM intact! When I pressed ON, I'd come right back up without a "Try to Recover Memory?" prompt. Pretty good, huh? The folks who put that mode into the machine certainly weren't in a coma.
Pressing ON-D enters the interactive self test function of the HP48. When you first press ON-D, your HP will beep and you will see 3 vertical lines, one on each side of the screen and one in the middle. You can exit this mode with a Warmstart, ON-C. The tests are:
Displays CPU speed
LCD test. Press Enter to cycle through the tests
Internal ROM test
Internal RAM test
Keyboard test. Starting with [A], press all the keys in order, left to right, top to bottom. If all goes well, the HP will show "KBD1 OK".
Partial keyboard test
ESD test monitor. Battery status is shown by bars.
UART loop-back test
Wired UART echo
Shows what cards are plugged in. Press any key a few times.
Test RAM cards in ports
Blanks display
Sends system time from IR port
Receives system time from IR port (have another HP send it)
IR loop-back test
IR UART echo
Shows test start time
Shows test fail time
Looping test
Initialize test times
Test summary
Enters memory scanner (SX only)
When the HP48 is in test mode (ON-D or ON-E), the test results that are displayed on the screen are also sent to the serial port at 9600 baud, 8 bits, no parity, 1 stop bit. This seems to be unaffected by any settings in IOPAR, PRTPAR, or the system flags. I can only guess that this feature was included for factory testing purposes. This does explain, however, why the I/O annunciator lights up so much during the self test.
From: Detlef Mueller
If your HP48 batteries are low, try this test with fresh alkaline AAAs. This test first records the CRC of a RAM segment, then starts a loop where it creates power peaks and recalculates the CRC again until you press a key or the CRCs differ. In the latter case one or more cells of your RAM were "Electro-Statically Discharged" and the test exits with the last CRC done. If there's a hardwaer problem, this number should differ in consecutive executed ESD tests - with fresh AAA alkalines! Old ones or non alkaline batteries may cause trouble under this test condition.
If the test runs continuously, the bars on the screen reflect the battery status (low bat if bar is there) of port 2 (below the 2), port 1 (below the 1), and the main AAAs (below 0). If the AAAs are very low, the V bar comes up.
The HP48 S/SX/G have 32K base memory, and the GX has 128K. However not all this memory is available to the user. The operating systems uses memory for system variables, flags, fonts, last stacks, last arguments, last menus, and such. It also can be any one of a number of things:
To install a Library:
Sometimes you have to purge the variable containing the library before storing it in a port, if you are low on memory. See the next question for more information.
If you have FXRECV installed: Just type a port number, hit FXRECV and the library will automatically go into the specified port. All you have to do then in turn the calc off and then on to complete the installation.
To delete a Library:
Say you have library 1234 in port 0 that you want to delete.
If this doesn't work, there may be a reference to the library still in temporary memory. Try warmstarting with ON-C, then try again.
Libraries with very low library numbers may require the addition of a constant in order to delete them. For example, to delete a library 4 in port 0 you can add 2048 to the library number, as follows:
Therefore, here is a fairly general program for detaching and purging most auto-attaching libraries; the only required argument being the real library number (e.g. 218 in the above case):
\<< PATH SWAP HOME DUP 2048 + DETACH DTAG "&" \->TAG PURGE EVAL \>>
If have just successfully transferred a library to your HP, and try to store it in a port you may get an "Insufficient Memory" error. This is because your HP is trying to make a duplicate copy to store in your port, but it doesn't have any memory to do so. This is especially true on the HP48 S/SX/G since they only have 32K of memory built in.
The solution is to push the library onto the stack, then purge the original variable containing the library. At this point, the only copy of the library that exists is on the stack. Now you can store the library in a port as usual. This method avoids temporarily trying to have two identical copies in memory at the same time.
For example, say you have a library in 'LIB' and you wish to store it in port 0. You would enter the following:
For the opposite problem - sending large libraries you can follow the reverse procedure. That is, recall the object from the port to the stack, purge the original in the port, store it in a variable and then send it.
Alternatively if the library is in a non-covered port (0/1/2 on SX or 0/1 on GX) you can use the following simple program suggested by Dan Kirkland:
\<< -> lib \<< 'lib' SEND \>> \>>
This does not require a second copy of the library and avoids all the complications of trying to purge a library and then re-installing it.
The little numbers are "user flags". When you or a program sets any of the user flags 1 through 5, little numbers corresponding to the set flags are displayed at the top of the screen.
The HP uses negative flags for setting various modes and functions, while positive flags were reserved for the use of the user. To set a user flag type the number, then SF. To clear a user flag type the number, then CF.
Some programs will use the user flags without you being aware of it. So, if you have a "1" at the top of the screen you can type 1 CF to get rid of it.
There are numerous programs available for using your HP48's IR port as a remote control. However, the level of support depends on the particular unit you wish to control. The HP48 is capable of reproducing many of the IR controls of many popular brands of appliances.
However, some remotes run at speeds that the HP48 is unable to reproduce. Due to their faster processor speed, the G/GX calculators are able to support more remote controls but are still limited in some cases.
With typical remote programs you have to "teach" your HP48 by sending it the various IR sequences with the original remote control. There are some advantages to using your HP48 however:
The best remote program by far is Remote by Bjorn Gahm. It has a large database of existing remotes, meaning you may not have to "teach" your HP48 your specific remote if it is already supported. However it also have the ability to learn new codes. See the best programs list (later in the FAQ) for the specific URL.
To make phone dialing tones, you need to produce two simultaneous tones. The tones used to dial phones are known as DTMF (dual tone multi frequency) tones, which consist of two tones at the same time.
The speaker in the HP48 is not capable of supporting the DTMF tones because it can only make a single tone at a time. The best the HP48 can do is switch very quickly between one frequency and another. Some attempts have been made in machine language to support DTMF, however they have been unsuccessful. Therefore, you cannot use the HP48 as a phone dialer.
You can use some of the utilities available on the Goodies Disks (see Appendix E.5 on where to obtain these):
Some stack libraries come with support for AUTOEXEC or an equivalent built in (for example, the Java library supports AUTOEXEC). If one of the libraries you have installed supports such a feature, you may not need any of the utilities above.
You can't, really. Unlike the HP-28S, the clock speed in the HP48 SX is hardwired to 2 MHz, and to 4MHz in the HP48 GX.
Digitalis http://www.Digitalis.de/ has a "speed-up" module available. They sell 48G's with this module added (it looks like it adds about 50DM/$30 or so to the cost). I'm not sure what it does, but I think it boosts the clock speed. Apparently it can be turned on and off as needed, at the sacrifice of shorter battery life.
However, in some cases, you can speed up the HP48 by turning off the display refresh, which supposedly takes up about 11% of the CPU time. Detlef Mueller submitted a program called SPEED to comp.sources.hp48 that turns off the display refresh. Of course, since it turns the display off, it is only suitable for long non-interactive runs like calculating large integrals, compiling, etc... Look in the various HP48 archives for a copy.
The "hidden directory" is a subdirectory of the HOME directory. It is created on startup, and it contains variables with your alarms and user key configurations. You can use the hidden directory to store whatever you want, however you CAN NOT ORDER the contents of this directory, as this causes memory loss.
The name of the hidden directory is a null character, ''. The only way to get a null character is to use a syseval. You can use the following program to access the hidden directory:
<< HOME (changes to home dir)
#15777h (syseval to get null character)
SYSEVAL (returns '' to stack)
EVAL >> (changes to hidden dir)
To exit the hidden directory, use HOME or UPDIR. This will return you to the HOME directory.
Also, by putting the null character as a part of your HOME custom directory, you can switch right into the directory by pressing the softkey.
Note: The SysRPL command NULLID returns a null character to the stack; it is the same as doing #15777h SYSEVAL.
From: Joe Horn
There is a little-known method of recalling objects from within archives. Just make a list representing the PATH to the object, and tag the list with the port number. Then hit RCL or EVAL.
For example, if your archive in port 1 is called BKUP, and it contains a directory called GAMES which contains a program called REVERSI, you can run the game directly (without having a separate copy of REVERSI stored anywhere!) by:
:1: { BKUP GAMES REVERSI } EVAL
Or, you can RCL instead of EVAL, and it will be pushed onto the stack.
From: John Meyers
Yes, on the G/GX there are a few keys that aren't mentionned. They are:
[Right-shift] [View] is hidden in Appendix G (Operation Index) of the User's Guide [Edition 4] (which comes with the calc), among the several entries for the word VIEW.
AUR [Edition 1] (in chapter 3, Command Reference, under SERVER) gives the alternate keys [right-shift] [cursor right] (but of course AUR doesn't come with the calc). This alternative was left out of Appendix G of the User's Guide. Donnelly's HP48 Handbook [2nd Ed.] even lists it first!
From: John Meyers
Besides purchasing the Advanced User's Reference Manual (AUR), you can look in Appendix G of the G/GX User's Guide, which briefly summarizes every command available in the G/GX, including all the commands not mentioned anywhere else in the User's Guide. Often even the brief description given in this Appendix is sufficient for you to use the command (and to know it exists!).
Some notes on omissions, however:
Note that with CLVAR, if the current directory contains a non-empty subdirectory, an error occurs at that point, and no subsequent variables are purged.
From: John Meyers
Some of the following (but not all) is in the User's Guide, under "Binary Arithmetic and Number Bases" (Chapter 15 of G/GX).
The system flags contain a segment which specifies a "binary word size". This word size limits how many low-order bits of a binary value are displayed on the stack, and equally determines how many low-order bits of the arguments and results of binary arithmetic/logical/shift operations are used.
Curiously, the binary word size has no effect on entering values into the command line - what you originally enter is displayed in truncated form on the stack, but when you view it again in the command line (which temporarily reverts back to STD numeric display and 64-bit wordsize) you will find the complete value as entered is still intact.
As soon as you begin using functions on that value, however, the arguments to binary functions get truncated to the current wordsize before the functions are executed, and then the final result of the function gets truncated again.
You can recall the current wordsize using RCWS and set the wordsize using STWS. STWS accepts a real number argument in the range 1-64 (out of range values get adjusted to either 1 or 64), and it also accepts a binary argument, in which case the absolute value of the low-order 20 bits is used (just in case you wondered why #1048576d STWS RCWS gives an answer of 1).
Don't try adjusting the binary wordsize in the hope of saving memory by using shorter values; every "user binary integer" (type 10) produced by User RPL occupies 13 bytes, no matter what the current wordsize; the HP48 just sets the leading bits to zero when displaying on the stack or performing calculations.
No, the Equation Library is in ROM, and can't be written to. There are several programs which allow you to create your own equation library such as EQBrowser, EQ Lib, Equation Manager, and xMGR.LIB. All of these programs can be found at http://www.hpcalc.org/hp48/utils/misc/.
Previous | Contents | Next |