Post Reply 
48g TEACH command and "Examples" directory
03-24-2024, 04:35 PM
Post: #1
48g TEACH command and "Examples" directory
Hi everyone,
does anyone know where you can find the contents of the "Examples" directory that is generated in 48g with the TEACH command?
I searched online and on HPmuseum without success. Or how can I extract it from the Droid48 simulator on my smartphone?

Thank you in advance.

Hardware: Hp48S - Hp50g (5x black + 1 blue) - HP39gII - Hp27s - Casio fx-CG50
Find all posts by this user
Quote this message in a reply
03-24-2024, 05:00 PM
Post: #2
RE: 48g TEACH command and "Examples" directory
(03-24-2024 04:35 PM)franz.b Wrote:  how can I extract it from the Droid48 simulator on my smartphone?

Does Droid48 allow you to export a string from the stack of the emulated calculator? If so, try the following:

  1. Activate the Examples directory by executing "TEACH"
  2. Place the entire directory on the stack by pressing <right shift> then the function key on the top row that corresponds to the EXAMPLES directory
  3. Execute →STR
  4. Copy/export/save or whatever function Droid48 supports to obtain the text version of the entire directory


One thing to be aware of: there will still be special characters in the code that are specific to the 48 (→ Σ √ π, among others). Using a program such as INOUT can be useful to substitute trigraphs for those special characters if moving the code between systems.
Find all posts by this user
Quote this message in a reply
03-24-2024, 05:35 PM
Post: #3
RE: 48g TEACH command and "Examples" directory
Thank you for the reply. Unfortunately the problem is actually extracting any content from Droid48. As far as I know, it is only possible to push an object onto the stack but not vice versa.

Thanks

Hardware: Hp48S - Hp50g (5x black + 1 blue) - HP39gII - Hp27s - Casio fx-CG50
Find all posts by this user
Quote this message in a reply
03-24-2024, 06:10 PM
Post: #4
RE: 48g TEACH command and "Examples" directory
If you have EMU48 you can use it with the 48G ROM to extract the directory. There is also this from hpcalc.org which may be of use.
Find all posts by this user
Quote this message in a reply
03-24-2024, 06:34 PM (This post was last modified: 03-24-2024 07:04 PM by Steve Simpkin.)
Post: #5
RE: 48g TEACH command and "Examples" directory
For reference, here is a copy of the 'EXAMPLES' DIR object created by the TEACH command as a simple text file. It is a bit easier to read in a good text editor like Notepad++.

Edit: Added white space to original text file for readability.
New file name:HP-48G TEACH DIR Contents - Rev 1.txt


Attached File(s)
.txt  HP-48G TEACH DIR Contents - Rev 1.txt (Size: 3.35 KB / Downloads: 26)
Visit this user's website Find all posts by this user
Quote this message in a reply
03-24-2024, 07:14 PM (This post was last modified: 03-24-2024 07:28 PM by franz.b.)
Post: #6
RE: 48g TEACH command and "Examples" directory
(03-24-2024 06:34 PM)Steve Simpkin Wrote:  For reference, here is a copy of the 'EXAMPLES' DIR object created by the TEACH command as a simple text file. It is a bit easier to read in a good text editor like Notepad++.

Edit: Added white space to original text file for readability.
New file name:HP-48G TEACH DIR Contents - Rev 1.txt

great! thank you very much! Is it possible to put it as is in a 50g? (this was the ultimate goal)

EDIT: yes, it is possible and it works!

Hardware: Hp48S - Hp50g (5x black + 1 blue) - HP39gII - Hp27s - Casio fx-CG50
Find all posts by this user
Quote this message in a reply
03-24-2024, 08:26 PM
Post: #7
RE: 48g TEACH command and "Examples" directory
(03-24-2024 07:14 PM)franz.b Wrote:  
(03-24-2024 06:34 PM)Steve Simpkin Wrote:  For reference, here is a copy of the 'EXAMPLES' DIR object created by the TEACH command as a simple text file. It is a bit easier to read in a good text editor like Notepad++.

Edit: Added white space to original text file for readability.
New file name:HP-48G TEACH DIR Contents - Rev 1.txt

great! thank you very much! Is it possible to put it as is in a 50g? (this was the ultimate goal)

EDIT: yes, it is possible and it works!

Excellent! I am glad this helped.

I also found the 'INOUT' program from grsbanks (based on programs by John H. Meyers) to be very useful to help export HP-48SX utility programs I have written over the decades into the HP-48 emulators I use on my smartphones. Thanks DavidM for pointing to that post.
Visit this user's website Find all posts by this user
Quote this message in a reply
03-25-2024, 05:10 PM
Post: #8
RE: 48g TEACH command and "Examples" directory
(03-24-2024 08:26 PM)Steve Simpkin Wrote:  I also found the 'INOUT' program from grsbanks (based on programs by John H. Meyers) to be very useful to help export HP-48SX utility programs I have written over the decades into the HP-48 emulators I use on my smartphones. Thanks DavidM for pointing to that post.

Indeed, the right-arrow characters in your text file come out as strange Unicode characters on my computer (Chrome on Debian Linux). Perhaps you could use INOUT on the file to create the proper trigraphs (e.g. \-> ).
Find all posts by this user
Quote this message in a reply
03-25-2024, 06:34 PM
Post: #9
RE: 48g TEACH command and "Examples" directory
(03-25-2024 05:10 PM)John Keith Wrote:  
(03-24-2024 08:26 PM)Steve Simpkin Wrote:  I also found the 'INOUT' program from grsbanks (based on programs by John H. Meyers) to be very useful to help export HP-48SX utility programs I have written over the decades into the HP-48 emulators I use on my smartphones. Thanks DavidM for pointing to that post.

Indeed, the right-arrow characters in your text file come out as strange Unicode characters on my computer (Chrome on Debian Linux). Perhaps you could use INOUT on the file to create the proper trigraphs (e.g. \-> ).

I should have thought of that. Here is a file with the contents of the HP-48G TEACH directory using the INOUT Program mentioned above.


Attached File(s)
.txt  HP-48G TEACH DIR contents using INOUT Program.txt (Size: 3.54 KB / Downloads: 19)
Visit this user's website Find all posts by this user
Quote this message in a reply
03-26-2024, 12:07 AM
Post: #10
RE: 48g TEACH command and "Examples" directory
INOUT is convenient, but taking text with HP fonts and copying it in PRG mode is also not dramatic.
But to use INOUT I had to write it by hand starting from scratch because the link version would have to be converted using INOUT itself... it's an unsolvable loop!

Hardware: Hp48S - Hp50g (5x black + 1 blue) - HP39gII - Hp27s - Casio fx-CG50
Find all posts by this user
Quote this message in a reply
03-26-2024, 01:32 AM
Post: #11
RE: 48g TEACH command and "Examples" directory
(03-26-2024 12:07 AM)franz.b Wrote:  ...
But to use INOUT I had to write it by hand starting from scratch because the link version would have to be converted using INOUT itself... it's an unsolvable loop!

I was able to take a copy of the INOUT program (see below) and paste it into the stack of the emulator. This resulted in a String object on level 1 that I manually edited to delete the \<<, \>> and \-> sequences and replace them appropriate program delimiters and right arrow characters. It didn't take too long as there were not that many of them. I also had to delete the string delimiters. This left the correct program on the stack.



\<< RCWS RCLF \-> ws f
\<< 3 TRANSIO DUP TYPE 2 IF == THEN
\->STR f SIZE 3 > #2F34Dh #3016Bh IFTE SYSEVAL + STR\->
ELSE
STD 64 STWS \->STR f SIZE 3 > #2F34Fh #2FEC9h IFTE SYSEVAL
END
ws STWS f STOF
\>>
\>>
Visit this user's website Find all posts by this user
Quote this message in a reply
03-26-2024, 05:58 PM
Post: #12
RE: 48g TEACH command and "Examples" directory
(03-26-2024 01:32 AM)Steve Simpkin Wrote:  
(03-26-2024 12:07 AM)franz.b Wrote:  ...
But to use INOUT I had to write it by hand starting from scratch because the link version would have to be converted using INOUT itself... it's an unsolvable loop!

I was able to take a copy of the INOUT program (see below) and paste it into the stack of the emulator. This resulted in a String object on level 1 that I manually edited to delete the \<<, \>> and \-> sequences and replace them appropriate program delimiters and right arrow characters. It didn't take too long as there were not that many of them. I also had to delete the string delimiters. This left the correct program on the stack.



\<< RCWS RCLF \-> ws f
\<< 3 TRANSIO DUP TYPE 2 IF == THEN
\->STR f SIZE 3 > #2F34Dh #3016Bh IFTE SYSEVAL + STR\->
ELSE
STD 64 STWS \->STR f SIZE 3 > #2F34Fh #2FEC9h IFTE SYSEVAL
END
ws STWS f STOF
\>>
\>>

I don't use emulators, I have too many physical calculators...?‍♂️ I copy the texts and generate .txt files which I import via memory card, then I correct them with the calculator editor. In the case of INOUT it was really quick to write it from scratch, it's just a few commands, basically.

Hardware: Hp48S - Hp50g (5x black + 1 blue) - HP39gII - Hp27s - Casio fx-CG50
Find all posts by this user
Quote this message in a reply
03-29-2024, 06:19 PM (This post was last modified: 03-29-2024 06:22 PM by Massimo Gnerucci.)
Post: #13
RE: 48g TEACH command and "Examples" directory
(03-26-2024 05:58 PM)franz.b Wrote:  I don't use emulators, I have too many physical calculators...?‍♂️

If your signature is up to date I don't think you have too many, quite the contrary. ;)

Greetings,
    Massimo

-+×÷ ↔ left is right and right is wrong
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: