Post Reply 
FORTH & HP: where to start?
05-17-2023, 12:12 PM
Post: #21
RE: FORTH & HP: where to start?
(05-17-2023 11:10 AM)floppy Wrote:  b)
RAMED.fth:7: Undefined word
PAD 2+ DUP DUP >>>EXPECT96<<< CR

Can you submit this EXPECT96 word?

EXPECT96 is a native word in the 71B FORTH dictionary. It may not be listed in the index page at the end, which is also true for a few other words as well.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
05-17-2023, 12:16 PM (This post was last modified: 05-17-2023 12:36 PM by floppy.)
Post: #22
RE: FORTH & HP: where to start?
(05-17-2023 11:37 AM)ThomasF Wrote:  
(05-17-2023 11:10 AM)floppy Wrote:  Can you submit this EXPECT96 word?
EXPECT96 is a built-in word in the Forth-module (both Assembler and Translator module).
Cheers,
Thomas
ok. I got it.
Has somebody the word of expect96 in another forth? It seems HP71B specific.

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
Find all posts by this user
Quote this message in a reply
05-17-2023, 02:27 PM (This post was last modified: 05-17-2023 02:29 PM by KeithB.)
Post: #23
RE: FORTH & HP: where to start?
"ACCEPT" seems to be the standard Forth word:
https://www.forth.com/starting-forth/10-...operators/

ETA: The changed it to set the expected characters to the line length of the HP71.
Find all posts by this user
Quote this message in a reply
05-17-2023, 08:43 PM
Post: #24
RE: FORTH & HP: where to start?
(05-17-2023 08:15 PM)floppy Wrote:  However, I am struggling with understanding how following line could work in an HP71B
Code:
16 STRING PR$ " FFFFF: F F F (F) F F F" PR$ S!
16 is a hex value (22 decimal) and the string length is 22 characters (decimal) so it fit and works, I just tried it.
Look at the beginning of the listing, the system is set to hexadecimal: BASE @ HEX
Code:
HEX     16 STRING PH$ " FFFFF: F F F (F) F F F" PH$ S!
DECIMAL 22 STRING PD$ " FFFFF: F F F (F) F F F" PD$ S!
Sylvain
Find all posts by this user
Quote this message in a reply
05-17-2023, 10:23 PM
Post: #25
RE: FORTH & HP: where to start?
(05-17-2023 11:22 AM)ThomasF Wrote:  Don't have the module anymore, but it does also contain Forth.
I.e. you could either use the Forth/Assembler module or the Forth/Translator module for Forth programming.
AFAIK the two Forth implementations are basically identical apart from the assembler part in the first module and built-in words for RPN/HP41 in the other.

So my guess is that the reference indicates that you could use either of the modules to run the program.

EDIT: Sorry, but no, that was not fully correct. I noticed that the word "CLOCK" is used, and that is only available in the Translator module!
So the stopwatch functions must be rewritten if the Assembler module is used ...


Cheers,
Thomas

This highlighted section is not correct. Though outwardly quite similar, the internals of these two products are very different and most words are at different addresses, which is probably a big issue for a development tool.

Bill Wickes created the 41Trans product himself, derived from the earlier FORTH/Assm product after the dev group said it (making a 41 emulator from the F/A product) could not be done. The reasons so many things changed is exactly why they said it couldn't be done, but Bill just rolled-up his sleeves and reorganized most of the 'guts' to get it done, with the resulting side-effect that they are fairly different on the inside.

There are FAR more F/A modules out there than 41Trans, so I would suggest to target the F/A flavor and ignore supporting the 41Trans flavor.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
05-18-2023, 08:04 AM
Post: #26
RE: FORTH & HP: where to start?
(05-17-2023 10:23 PM)rprosperi Wrote:  
(05-17-2023 11:22 AM)ThomasF Wrote:  AFAIK the two Forth implementations are basically identical apart from the assembler part in the first module and built-in words for RPN/HP41 in the other.
This highlighted section is not correct. Though outwardly quite similar, the internals of these two products are very different and most words are at different addresses, which is probably a big issue for a development tool.

Thanks for the insights to the development of that module!

I've just been using the two modules to do some simple Forth-programming back in the days and for that purpose I don't recall any difference (apart from the Assembler/RPN parts).

But yes, if you look closer there is probably big differences just as you mentioned, making it hard to develop tools like a debugger or de-compiler tools for it.

Cheers,
Thomas

[35/45/55/65/67/97/80 21/25/29C 31E/32E/33E|C/34C/38E 41C|CV|CX 71B 10C/11C/12C/15C|CE/16C 32S|SII/42S 28C|S 48GX/49G/50G 35S 41X]
Find all posts by this user
Quote this message in a reply
05-18-2023, 08:31 AM
Post: #27
RE: FORTH & HP: where to start?
From THE HP-41 TRANSLATOR PAC FOR THE HP-71 by Bill Wickes:

Quote: RELATION TO THE FORTH/ASSEMBLER ROM

The Translator Pac FORTH system is very similar to that contained in the HP 82441A Forth/Assembler ROM. At first approximation, the Translator Pac just is the FORTH/Assembler ROM, with the HP-41 vocabulary substituted for the Assembler (the KEYBOARD IS lex file is also not present in the Translator Pac). This has the drawback noted previously that both modules can not be plugged into the HP-71 simultaneously. But further, the two FORTH systems cannot share the same RAM files. This is due to the differing organizations of the system portions of the RAM files, and to the fact that the ROM-based FORTH dictionaries are different, so that the compilation addresses of the ROM words are not the same for the two systems. The FORTH/Assembler ROM’s RAM file is named FORTHRAM; the Translator Pac’s is named FTH41RAM. The different names should help programmers keep the two types of files sorted out.

Here is a brief summary of the primary differences between the two
FORTH systems:
  • The Translator Pac does not contain the Assembler, the associated words ASSEMBLE, PAGESIZE, LISTING, and VARID, and the Assembler user variables.
  • With the exception of the Assembler words, the Translator Pac Rom dictionary is a superset of that of the FORTH/Assembler ROM. The Translator dictionary is organized into two vocabularies: FORTH and HP41V. The former is the parent vocabulary of the latter, so that FORTH words are available when the context vocabulary is HP41V, but not vice-versa.
  • The Translator Pac FORTH vocabulary is augmented by numerous HP-41 floating-point words that are not included in the FORTH/Assembler ROM.
  • Translator Pac floating-point words follow the HP-41 convention that errors leave the floating-point stack intact. The FORTH/Assembler words drop the stack, update LASTX, etc., before error-checking.
  • The Translator Pac HP41V vocabulary contains HP-41 words that depend on HP-41 data structures or use post-fix notation.
  • The user variable area in the FTH41RAM file contains the HP-41 flags, program pointer, return stack, alpha register, size and sigma register variables, and other HP41 system variables.
  • The FTH41RAM user dictionary begins with the FORTH word, but also contains the HP41V vocabulary word, and a null word used to link the various RAM and ROM dictionaries together.
  • The outer interpreter loop in the Translator Pac checks an emulator-active flag following interpretation of the input buffer. If the flag is clear, the OK { n } message is displayed. If set, a vectored HP-41 display word is executed (typically, to display the X-register).
  • HP-41 error messages (Alpha Data, Data Error, etc.) are added to the system error table in the Translator Pac.
  • The [ATTN] key and poll check carried out during execution of semicolon and branching has been rewritten for the Translator Pac, resulting in somewhat faster FORTH execution.
.
Find all posts by this user
Quote this message in a reply
05-18-2023, 10:53 AM
Post: #28
RE: FORTH & HP: where to start?
Does anyone have the details behind the C71 ROM? It is a third party 64KB ROM with (I believe) Forth embedded in the code rather than as a separate 32KB hard ROM. C71 emulates all the Voyager models- I'd love to have the two keyboard overlays that went with it.

Remember kids, "In a democracy, you get the government you deserve."
Find all posts by this user
Quote this message in a reply
05-18-2023, 12:28 PM
Post: #29
RE: FORTH & HP: where to start?
(05-18-2023 10:53 AM)mfleming Wrote:  Does anyone have the details behind the C71 ROM? It is a third party 64KB ROM with (I believe) Forth embedded in the code rather than as a separate 32KB hard ROM. C71 emulates all the Voyager models- I'd love to have the two keyboard overlays that went with it.

C71 was built using Soft Forth from CMT - the best resources about Soft Forth are on JFG's site here:

http://www.jeffcalc.hp41.eu/emu71/index.html#sforth

The full manual is available. After years of searching, it was finally found in a predictable place, Richard Nelson's collection, rescued when he dissolved that. Here's the PDF:

https://literature.hpcalc.org/items/1248

Fairly high quality images of the 2 overlays can be found in the Emu71/Win overlay pkg here:

https://hp.giesselink.com/Emu71/Kmlpc/EMU71_Overlays.7z

I have only seen 2 original sets of C71 overlays in all the years I've looked for them, and they're not for sale...

A well-known eBay seller for HP stuff has mentioned possibly making some to sell, but he wasn't sure how much interest there would be, so maybe he should find out? But someone please start a new thread for that, no need to further Hijack this one more than we already have...

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
05-18-2023, 09:54 PM
Post: #30
RE: FORTH & HP: where to start?
(05-18-2023 12:28 PM)rprosperi Wrote:  no need to further Hijack this one more than we already have...
Agreed Smile

(05-18-2023 12:28 PM)rprosperi Wrote:  A well-known eBay seller for HP stuff has mentioned possibly making some to sell, but he wasn't sure how much interest there would be, so maybe he should find out? But someone please start a new thread for that
Although there weren't many custom keyboard overlays, it would be interesting to gauge interest in reproductions via a separate thread.

Remember kids, "In a democracy, you get the government you deserve."
Find all posts by this user
Quote this message in a reply
05-20-2023, 02:00 PM
Post: #31
RE: FORTH & HP: where to start?
(05-18-2023 12:28 PM)rprosperi Wrote:  https://hp.giesselink.com/Emu71/Kmlpc/EMU71_Overlays.7z

I was opening the first overlay REAL71BL_AMP4.bmp just as guess and could see the letter "c". Then I was thinking if we should move this forum to another XXX site ;-)

I had a good laugh. Direct to the point. Thats my day..

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
Find all posts by this user
Quote this message in a reply
05-28-2023, 08:38 PM
Post: #32
RE: FORTH & HP: where to start?
(05-17-2023 12:40 AM)dmh Wrote:  Check out NQueens in FORTH for the 71b here.

(05-16-2023 07:31 PM)floppy Wrote:  Has anybody few FORTH programs, in text form in the internet, which were running/tested on HP71B ?

Question: what width of the text file has to be used before a transfer with lifutils is started? 80 characters maximum? does have the blank characters an effect on the memory used later by the forth programm in the hp71B? Or one command by line in the text file must be edited later on the HP71B? (I could not find any information of editor use in the hp71B what character per line is acceptable)

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
Find all posts by this user
Quote this message in a reply
05-28-2023, 11:39 PM (This post was last modified: 05-29-2023 02:15 AM by rprosperi.)
Post: #33
RE: FORTH & HP: where to start?
(05-28-2023 08:38 PM)floppy Wrote:  
(05-17-2023 12:40 AM)dmh Wrote:  Check out NQueens in FORTH for the 71b here.

Question: what width of the text file has to be used before a transfer with lifutils is started? 80 characters maximum? does have the blank characters an effect on the memory used later by the forth programm in the hp71B? Or one command by line in the text file must be edited later on the HP71B? (I could not find any information of editor use in the hp71B what character per line is acceptable)

Not sure I understand all the questions here, but I'll try.

Forth syntax is free you can have as many words on an input line as you like, separated be one or more spaces, or only one per line, etc.

I would not make lines longer than 96 chars as I think that's the absolute limit, but anything over 80 is annoying, even on full size screens, and more than 22 will not fit on a 71b screen, so why use longer?

I've no idea at all what line length has to do with lifutils transfers being started, so I assume this is a translation issue??

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
05-29-2023, 12:30 AM
Post: #34
RE: FORTH & HP: where to start?
Historically, Forth source code was saved in a "screen", a 1K long buffer consisting of 16 lines, 64 chars each.

The 71B text editor relax this constraint, but I generally follow the original 16x64 standard when I am writing Forth, which is not often these days.

Also, screen filename are generally names screen or scr with a number following it.

Example: HP-75C Forth file listing ...
Code:
Name      Type  Len   Contents
FORTH10   L     12K   Kernel only (2112 free)
F10D12    L     12K   Kernel + Util + Debug (1012 free)
F10K16    L     16K   Kernel only (7034 free)
SCR00040  T     768   Fix FILL
F10L16    L     16K   Kernel + Util + Debug + Asm + LCD Ed (2377 free)
F10V16    L     16K   Kernel + Util + Debug + Asm + Video Ed (2313 free)
SCR00010  T     1024  Utilities
SCR00011  T     768   Utilities
SCR00020  T     768   Debug
SCR00021  T     1024  Debug
SCR00022  T     1024  Debug
SCR00030  T     1024  Assembler
SCR00031  T     1024  Assembler
SCR00032  T     1024  Assembler
SCR00033  T     512   Assembler
SCR00041  T     512   Printer Driver
SCR00050  T     768   LCD Editor
SCR00051  T     768   LCD Editor
SCR00052  T     768   LCD Editor
SCR00053  T     1024  LCD Editor
SCR00054  T     512   LCD Editor
SCR00060  T     512   Video Editor
SCR00061  T     1024  Video Editor
SCR00062  T     1024  Video Editor
SCR00063  T     1024  Video Editor
SCR00064  T     512   Video Editor
SCR00070  T     768   Disassembler
SCR00071  T     512   Disassembler
SCR00072  T     1280  Disassembler
SCR00073  T     256   Disassembler
SCR00080  T     768   Size Change
Find all posts by this user
Quote this message in a reply
05-29-2023, 02:42 AM
Post: #35
RE: FORTH & HP: where to start?
For what it's worth, a great way of exploring Forth is via an excellent BBC Micro emulator called BeebEm. Much as there are versions for other operating systems, I'd only recommend the Windows version, purely because you can end up with gnarly keyboard mapping issues on other platforms. The emulator itself is faultless and simple to use (as ever, scan the help docs, which are thankfully brief).

Best of all, AcornSoft released Forth for the BBC and both the BBC Micro documentation and the Forth for the BBC Micro documentation have been "remastered" - which involved the following:

- The look and layout of the original guides is preserved.
- All errata corrections have been applied to the text.
- Corrected all OCR errors, incorrect page number references and any factual errors found.
- All diagrams redrawn in vectors.
- Extensive use of hyperlinks - click on any 'see page', 'see chapter' or BASIC keyword text to jump straight to the relevant page.

[Image: o7PEFU]

As you can see, I've got other related docs (some of which are dog-eared scans) but I've bundled some essential stuff in a single zip below.

And this video shows the specifics of setting up Forth itself on the BBC Micro emulator.




Here's the bundle of docs, if you want any others shown in the screenshot, let me know.

http://www.mkw.me.uk/beebem/index.html
Forth 1-03 ROM
Find all posts by this user
Quote this message in a reply
06-05-2023, 11:29 AM
Post: #36
RE: FORTH & HP: where to start?
(05-16-2023 09:55 PM)rprosperi Wrote:  Here's a 71B RAM Editor.

The original was published in a PPC Journal article back in the day (I can find a reference if needed). In the original article, a BASIC call was used for the INADDR function, but that seemed morally wrong, so I rewrote it using FORTH (though fairly ugly, inelegant and likely not efficient, but it works, and hey, it was some of the very first FORTH I ever wrote...).

Code:
BASE @ HEX
: INADDR  ( str -- n )
( Prompts for and returns a number )
( Start number with "T" for decimal, )
( else HEX is assumed )
  TYPE BASE @ HEX
  PAD 2+ DUP DUP EXPECT96 CR
  SPAN @ SWAP 2- C!
  DUP C@ 54 =
  IF
    DECIMAL DUP DUP 2-
    C@ 1- SWAP C!
  ELSE
    2-
  THEN
  NUMBER DROP SWAP
  BASE ! ;

16 STRING PR$ " FFFFF: F F F (F) F F F" PR$ S!
: NORL 30 + DUP 39 > IF 7 + THEN ;
: SADDR SP@ DUP 5+ SWAP DO I N@ NORL LOOP PR$ DROP DUP
  A + SWAP DO I C! 2 +LOOP ;
: ST + DUP ROT ROT C! ;
: LPR$ DUP DUP 3 - SWAP 3 + DO I N@ NORL -1 +LOOP PR$
  DROP E ST 4 ST 4 ST 6 ST 6 ST 4 ST 4 ST DROP ;
: R? KEY D = IF OVER N! 1+ ELSE DROP THEN ;
: KEY? CASE
  8 OF 1- ENDOF
  9 OF 1+ ENDOF
  7 OF 2- ENDOF
  0 OF 2+ ENDOF
  5 OF 5- ENDOF
  6 OF 5+ ENDOF
  47 OF CR DROP " Addr: " INADDR ENDOF
  52 OF CR " Addr: " INADDR + ENDOF
  30 OF 0 R? ENDOF
  31 OF 1 R? ENDOF
  32 OF 2 R? ENDOF
  33 OF 3 R? ENDOF
  34 OF 4 R? ENDOF
  35 OF 5 R? ENDOF
  36 OF 6 R? ENDOF
  37 OF 7 R? ENDOF
  38 OF 8 R? ENDOF
  39 OF 9 R? ENDOF
  41 OF A R? ENDOF
  42 OF B R? ENDOF
  43 OF C R? ENDOF
  44 OF D R? ENDOF
  45 OF E R? ENDOF
  46 OF F R? ENDOF
  ENDCASE ;
: RAMED BEGIN CR LPR$ SADDR PR$ TYPE KEY KEY? 0 UNTIL ;
BASE !
Thanks. Could you describe what it does or could you inform where is the description of it? I would like now to rework this in a modern Forth but if address are HW specific (what I guess), I have to understand first what it does and what address its reading. Perhaps something like Dump?

And: any similar Forth (2012, 2022..) program to EXPECT96 is welcome, too (I have to create this word in a modern 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
Find all posts by this user
Quote this message in a reply
06-05-2023, 12:16 PM
Post: #37
RE: FORTH & HP: where to start?
(06-05-2023 11:29 AM)floppy Wrote:  [snip]
Thanks. Could you describe what it does or could you inform where is the description of it? I would like now to rework this in a modern Forth but if address are HW specific (what I guess), I have to understand first what it does and what address its reading. Perhaps something like Dump?

And: any similar Forth (2012, 2022..) program to EXPECT96 is welcome, too (I have to create this word in a modern forth).

The original RAMEDIT was published in PPC Journal V12N4P45. As noted above, INADDR was originally a BASIC program called via BASICX from within RAMED's Forth code, but I re-wrote that in Forth.

This program is a RAM editor (for HEX editing bytes in memory) and is highly 71B-specific, assuming the 71B's RAM structure, limited 22-char display, etc. so unlikely to easily port to another platform.

EXPECT96 is a 71B Forth-unique word, based on the 71B's internal buffers, etc. however I believe EXPECT is a standard word found in most Forth implementations.

hth

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
06-05-2023, 07:52 PM
Post: #38
RE: FORTH & HP: where to start?
How to get a copy of "PPC Journal V12N4P45" ?

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
Find all posts by this user
Quote this message in a reply
06-05-2023, 08:22 PM
Post: #39
RE: FORTH & HP: where to start?
(06-05-2023 07:52 PM)floppy Wrote:  How to get a copy of "PPC Journal V12N4P45" ?

Order the PPC Archive collection from Jake Schwartz here:

http://www.pahhc.org/ppccdrom.htm

It is an enormous collection of essentially all of PPC's published works, plus CHHU, and HPX, and HPCC and all the HHC conventions, and all of EduCALC's catalogs and other material, and a rapidly growing collection of other HP calculator materials such as catalogs, brochures, white papers, etc. In short, you want this for hundreds of reasons.

Once you order it, let me know, I'll scan that Journal article and send it to you, so you can continue working while waiting for this to arrive.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
Post Reply 




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