(71B) FORTH questions
|
06-16-2023, 02:20 PM
Post: #21
|
|||
|
|||
RE: (71B) FORTH questions
The IDS V1 is the right source of information. See section 15.1.2:
"The current time may be computed by subtracting the current timer from the target time". However, doing it by yourself in FORTH is not trivial. You need to read 2 quantities at 2 different locations still making sure of the consistency, moreover the hardware timer runs asynchronously vs the CPU, its content may change during the read, so a double read and check is required. There are system routines which do it for you. A solution could be to build a FORTH word in assembly language to call the right system routine, for instance CMPT (see IDS V2 section 25.1). Then you will *just* have to convert the time in 1/512ths since midnight 1 Jan 0000 to usual date and time of the day. Don't ask me how, I never did such a thing... but it would be a good exercice. J-F |
|||
06-16-2023, 03:18 PM
(This post was last modified: 06-16-2023 03:19 PM by Valentin Albillo.)
Post: #22
|
|||
|
|||
RE: (71B) FORTH questions
(06-16-2023 01:53 PM)floppy Wrote: I am searching the memory area where the time counter is placed. Be also aware of this bug: "1084-3: Small probability exists for bad timer readings, causing random clock errors." I vaguely remember that the only solution required reading the clock three consecutive times and checking them, in order to assure a good reading. V. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
06-16-2023, 04:01 PM
Post: #23
|
|||
|
|||
RE: (71B) FORTH questions
(06-16-2023 03:18 PM)Valentin Albillo Wrote: "1084-3: Small probability exists for bad timer readings, causing random clock errors." Thanks Valentin, I didn't remember that bug. Actually, the code is already doing up to 3 reads with this algorithm (GETTIM routine): Read timer -> B Read timer -> A If A#B then Read timer -> A The bug is classified as minor in this document, with these extra details: "Risk of this bug occurring increases if user runs 2 or 3 ON TIMERs with short intervals." It may come from an inconsistency between the timer and the target time (the 2 quantities I mentioned above), in case a timer event occurs between the reading of these 2 quantities. Without ON TIMER statements, hardware timer events occur every 4.55 hours, so the risk is very low. I don't know how to easily reproduce the bug, and I can't check if it was fixed in the latest version 2CDCC. J-F |
|||
06-16-2023, 05:27 PM
Post: #24
|
|||
|
|||
RE: (71B) FORTH questions
Thanks. Is anywhere an assembler list of the "CLOCK" word of the translator module? Could be a point where to start.
HP71B 4TH/ASM/Multimod, HP41CV/X/Y & Nov64d, PILBOX, HP-IL 821.62A & 64A & 66A, Deb11 64b-PC & PI2 3 4 w/ ILPER, VIDEO80, V41 & EMU71, DM41X |
|||
06-16-2023, 05:39 PM
Post: #25
|
|||
|
|||
RE: (71B) FORTH questions
Although I am not a regular HP-71B user, I have studied its clock system in great detail so as to be well prepared for the reverse engineering of the clock systems on the RPL machines (Paladin, Orlando, Charlemagne, Alcuin/Hammer, Elsie) which all use the same basic concepts inherited from Titan, albeit not necessarily the same code.
I can, therefore, confirm that the bug was indeed fixed in ROM revision 2CDCC. Here is my own disassembly of GETTIM for both the 1BBBB and the 2CDCC revisions. 1BBBB Code:
2CDCC Code:
|
|||
06-16-2023, 08:12 PM
Post: #26
|
|||
|
|||
RE: (71B) FORTH questions
(06-16-2023 05:39 PM)Giuseppe Donnini Wrote: Although I am not a regular HP-71B user, I have studied its clock system in great detail ... Good catch! Indeed, the P= 5 instruction was at the wrong place ! This means the double read check was ineffective most of the time, mostly forcing a third read that was potentially wrong. This was very likely the cause of the bug. (06-16-2023 05:27 PM)floppy Wrote: Thanks. Is anywhere an assembler list of the "CLOCK" word of the translator module? Could be a point where to start. I've very little knowledge of the translator module (I can't know everything about the 71B ...) so didn't know about the CLOCK word. Indeed, a disassembly may give you useful information. J-F |
|||
06-17-2023, 01:52 AM
Post: #27
|
|||
|
|||
RE: (71B) FORTH questions
(06-16-2023 01:53 PM)floppy Wrote:(06-16-2023 03:22 AM)rprosperi Wrote: I'm not sure what you mean by "BASIC functions? prohibited", but you can try this:And with no BASIC? I am searching the memory area where the time counter is placed. Why not use the BASIC commands, that's why they were put there, so you don't have to create all the system access components by hand in Forth? You may as well, since reading various memory locations will all be 71B-specific, and not portable. --Bob Prosperi |
|||
06-19-2023, 08:09 PM
(This post was last modified: 06-19-2023 08:22 PM by floppy.)
Post: #28
|
|||
|
|||
RE: (71B) FORTH questions
(06-16-2023 08:12 PM)J-F Garnier Wrote: I've very little knowledge of the translator module (I can't know everything about the 71B ...) so didn't know about the CLOCK word. Manual Translator 7141tr.pdf page 192 (FORTH Words by Category) show CLOCK in the system WORDS. Description of the word CLOCK in page 129. Any disassembly of it is a plan A so far (I am still searching). Plan B is I order a translator module on ebay and disassemble on my own (the project is becoming bigger and bigger since assembler on HP71B is a new field for me. apart from all following new tools in my project: emacs gforth Forth71B awk). HP71B 4TH/ASM/Multimod, HP41CV/X/Y & Nov64d, PILBOX, HP-IL 821.62A & 64A & 66A, Deb11 64b-PC & PI2 3 4 w/ ILPER, VIDEO80, V41 & EMU71, DM41X |
|||
06-19-2023, 09:08 PM
Post: #29
|
|||
|
|||
RE: (71B) FORTH questions
The .BIN file for the 41 Translator is available in various places. Load it into Emu71 and examine it there. The Forth library on which it is based is also available. You could even load the Translator into your MultiMod
Remember kids, "In a democracy, you get the government you deserve." |
|||
06-19-2023, 09:16 PM
(This post was last modified: 06-19-2023 09:18 PM by Sylvain Cote.)
Post: #30
|
|||
|
|||
RE: (71B) FORTH questions
(06-19-2023 08:09 PM)floppy Wrote: Manual Translator 7141tr.pdf page 192 (FORTH Words by Category) show CLOCK in the system WORDS. Description of the word CLOCK in page 129.Why not using a HP-71B emulator with the Translator module ?
|
|||
06-20-2023, 02:15 AM
Post: #31
|
|||
|
|||
RE: (71B) FORTH questions
If you plan to get deeep into 71B Forth and start decompiling, disassembling, and other gory stuff, I strongly recommend you closley examine the "HP-71B Software Developer's Handbook", available here:
https://literature.hpcalc.org/items/1067 A LIF image of the included disk is attached below (remove trailing ".txt", used to allow attachment in the forum). There is a small, but very good Forth section with some very useful Forth words which are BY FAR the best examples I've ever found on how the 71B Forth System works. The software that came with the book includes full Forth source code for all the words in the package; studying them teaches one a lot about 71B Forth. While there is no Clock Word, there are words for using the clock to time program execution, walking the dictionary chain, de-compiling a Forth word that's in the dictionary, etc. This will save you some trouble: The pkg was for the Forth/Assembler and not for the 41 Translator, as the internal dictionaries for the two Forth-based products are not the same. 37 years ago I modified the Forth sources to work with the 41 Translator ROM, but don't believe I still have that version. --Bob Prosperi |
|||
06-20-2023, 10:31 AM
Post: #32
|
|||
|
|||
RE: (71B) FORTH questions
(06-19-2023 09:08 PM)mfleming Wrote: The .BIN file for the 41 Translator is available in various places. Load it into Emu71 and examine it there. The Forth library on which it is based is also available. You could even load the Translator into your MultiModI will in EMU71. I had the impression this was hardware linked for a use in HP71B: fine if Multimod works. HP71B 4TH/ASM/Multimod, HP41CV/X/Y & Nov64d, PILBOX, HP-IL 821.62A & 64A & 66A, Deb11 64b-PC & PI2 3 4 w/ ILPER, VIDEO80, V41 & EMU71, DM41X |
|||
06-20-2023, 07:41 PM
Post: #33
|
|||
|
|||
RE: (71B) FORTH questions
Thanks a lot for that DAT file Bob
It puzzles me how things are right under my nose and then “someone” triggers me to actually “look and learn” - had been looking for good Forth examples on Titan - and there it was. As a bonus an example of how to assemble with the forth assembler. Now I am waiting for a rainy day - again… KimH (06-20-2023 02:15 AM)rprosperi Wrote: If you plan to get deeep into 71B Forth and start decompiling, disassembling, and other gory stuff, I strongly recommend you closley examine the "HP-71B Software Developer's Handbook", available here: |
|||
06-20-2023, 09:30 PM
Post: #34
|
|||
|
|||
RE: (71B) FORTH questions
(06-20-2023 07:41 PM)KimH Wrote: Thanks a lot for that DAT file Bob Happy to help. The source for the Forth tools that came in this product are the only way I was able to teach myself 71B Forth back in the day. I had the Brodie book of course, but sooo many things are different due to wonky 20-bit addresses, etc. that very little I was trying was working, and then after playing around with the info. in this toolkit, much (!) became clear. And they're not only useful for teaching, but also pretty useful as premade tools to use in your programs. Most interesting tool in the kit: UN: (that's un-colon) which decompiles a word in the dictionary, so you can recover source from binaries. The results are frustratingly only displayed, and redirection isn't possible, but at least it's a start, and hey, you got the code, so you can change it... Have fun and please report back after it rains.... --Bob Prosperi |
|||
06-21-2023, 12:03 AM
(This post was last modified: 06-22-2023 07:43 PM by Sylvain Cote.)
Post: #35
|
|||
|
|||
RE: (71B) FORTH questions
From the Software Developer Handbook, assembly code for the FORTH word → TIME
Code:
Usage: (in FORTH environment) Code: TIME F. [endline] edit 1: add Jean-François correction edit 2: add missing TRUN routines |
|||
06-21-2023, 07:00 AM
(This post was last modified: 06-21-2023 07:14 AM by J-F Garnier.)
Post: #36
|
|||
|
|||
RE: (71B) FORTH questions
(06-21-2023 12:03 AM)Sylvain Cote Wrote: From the Software Developer Handbook, assembly code for the FORTH word → TIME Great! For 1BBBB users, you can avoid the bug reported above by adding a P= 5 instruction just before the call to CMPT: Code:
J-F |
|||
06-22-2023, 05:13 PM
Post: #37
|
|||
|
|||
RE: (71B) FORTH questions
(06-21-2023 07:00 AM)J-F Garnier Wrote:(06-21-2023 12:03 AM)Sylvain Cote Wrote: From the Software Developer Handbook, assembly code for the FORTH word → TIME Ah. Sylvain: "Software Developer Handbook" page 41 says, upload FTHUTILA and FTHUTILF: where are they (as LIF file)? JF: how to upload such codes in FORTH? HP71B 4TH/ASM/Multimod, HP41CV/X/Y & Nov64d, PILBOX, HP-IL 821.62A & 64A & 66A, Deb11 64b-PC & PI2 3 4 w/ ILPER, VIDEO80, V41 & EMU71, DM41X |
|||
06-22-2023, 06:51 PM
(This post was last modified: 06-22-2023 09:38 PM by rprosperi.)
Post: #38
|
|||
|
|||
RE: (71B) FORTH questions
I am not them, but hopefully these answers will help:
FTHUTILA is a TEXT file, with source code for the assembler portion FTHUTILF is a TEXT file with source code for the FORTH portion FTHUTILC is a (compiled) FORTH file, which can be used as-is (this is the result of assembling FTHUTILA and compiling FTHUTILF into an empty FORTHRAM file) by renaming to FORTHRAM and copying to the 71B's main RAM. All 3 of these files are in the LIF volume I uploaded. If you prefer to build it yourself, copy the FTHUTILA and FTHUTILF text files to the 71B and follow the short steps in section 21.1 of the manual. Note that if you have already added FORTH words to your dictionary, these words will be added AFTER your existing words, and if they happen to have the same name, your words will not be available, the new word with the same name will be used. Creating this (or using the provided FTHUTILC file (renamed to FORTHRAM)) will let you use the TIME word Sylvain mentioned above. Note: Forth itself, and especially the assembler, are fairly slow, but the more RAM you configure your 71B with, the faster assembling and compiling will be. Good luck --Bob Prosperi |
|||
06-22-2023, 07:53 PM
(This post was last modified: 06-22-2023 08:06 PM by Sylvain Cote.)
Post: #39
|
|||
|
|||
RE: (71B) FORTH questions
(06-22-2023 05:13 PM)floppy Wrote: Sylvain: "Software Developer Handbook" page 41 says, upload FTHUTILA and FTHUTILF: where are they (as LIF file)? Using files from SDH LIF volume as is (with the 1BBBB bug in it) in a Emu71 + Virtual-IL setup ...
Alternatively ... my setup
Using the custom TIME patched file with in a Emu71 + Virtual-IL setup ...
edit 1: typo edir 2: added environment info |
|||
07-25-2023, 02:36 PM
Post: #40
|
|||
|
|||
RE: (71B) FORTH questions
What would be the word CELLS implementation (see gforth https://gforth.org/manual/Address-arithm...02d0_002e2 ) in HP71B Forth ?
Any advice is welcome. HP71B 4TH/ASM/Multimod, HP41CV/X/Y & Nov64d, PILBOX, HP-IL 821.62A & 64A & 66A, Deb11 64b-PC & PI2 3 4 w/ ILPER, VIDEO80, V41 & EMU71, DM41X |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)