Post Reply 
Detecting presence of SD-card on HP-50g
07-17-2021, 06:40 PM
Post: #16
RE: Detecting presence of SD-card on HP-50g
(07-17-2021 05:07 PM)cahlucas Wrote:  The code you entered returns a string ("0") in both cases. Since it is a "0" in both cases, I wonder what the use of your program is. In any case, I can't detect if there is an SD card in my HP. Therefore, the original program discussed earlier in this thread is useful, and yours is not.

The second program is not intended to replace the original one, but rather to gather information in understanding why BINUBALL can't use the original one as posted. I'm asking BINUBALL to run this in an attempt to see why he has to use an altered version of the original program on his calculator. I never intended the program to be used for any other purpose.

If you attempt to run the second program on an emulator, the result will be meaningless (and likely "0" in all cases). I've tested it on a real 50g and 49g+ (both firmware v2.15), and it works as it should when running with and without a card present (it always gives non-zero results on my calculators).

All it does is to execute the same ACCESSSD command as the original program, and then converts the contents of the A register to a string (hex notation) and leaves it on the stack. The A register is where the ACCESSSD command leaves its results in this case, so the purpose here is simply to see what's there after the command completes.

According to the only information I've been able to find, executing the P=8 ACCESSSD sequence will leave one of two things in the lower 8 nibbles of the A register:
- the amount of free space remaining on the card, or
- an error code (as a negative number)

Claudio's program works by assuming that a negative result left in the lower 8 nibbles of A implies that a card is not present (and thus leaves FALSE on the stack). A positive number implies that a card is present (TRUE). I'd like to see BINUBALL's results to better understand why he seems to need the opposite logic with his calculator. I considered sending it as a private message instead of a post, but thought others might like to see what was going on as well.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Detecting presence of SD-card on HP-50g - DavidM - 07-17-2021 06:40 PM



User(s) browsing this thread: 1 Guest(s)