From Newsgroup: comp.lang.forth
I run RSX-11M on a PiDP emulator and recently installed FIG-FORTH to experiment with programming Forth in a PDP-11 environment. I found an
issue that effects modern systems trying to interpret some of the text
output from FIG-FORTH.
FIG-FORTH's dictionary intentionally sets the high bit on each word's
last name-character as an "end of name" marker, assuming a 7-bit-only
terminal simply won't display that bit. The problem is modern terminal emulators will treat that last byte as an invalid character and render
it as a "?". You see this "?" only in odd-numbered words, not even.
It's really annoying if you're trying to decipher a 1-word character.
For example, if you do a VLIST, you see something like this:
NF? CF? LF? LATEST TRAVERSE -DUP SPAC? RO? ? ?
? ? ? ALLO? HERE 2+ 1+ PREV US? HL? R# CS?
This issue looks to boil down to ID, so I made a three-line patch to
FORTH.MAC which strips that high bit from it's own scratch copy of the
name in PAD right before printing, so now you see this with a VLIST:
NFA CFA LFA LATEST TRAVERSE -DUP SPACE ROT > <
= - , ALLOT HERE 2+ 1+ PREV USE HLD R# CSP
I didn't touch any of the real dictionary entries, and so far the patch
does not appear to have broken anything.
Stackosaurus seems to be the current maintainer of FIG-FORTH, but their website
http://www.stackosaurus.com/figforth.html doesn't look to have
any way to contact them, so I'm posting my fix here.
I hope this helps someone else and here is another before/after example
Before the Patch:
run forth
FIG-FORTH V 1.3
1 load
LOADING EDITOR... ? ISN'T UNIQUE ? ISN'T UNIQUE
LOADING ASSEMBLER... R0 ISN'T UNIQUE ? ISN'T UNIQUE
LOADING STRING PACKAGE...
LOADING STRING EXTENSIONS...
BY? ISN'T UNIQUE
OK
After the Patch:
run forth
FIG-FORTH V 1.4
1 load
LOADING EDITOR... R ISN'T UNIQUE I ISN'T UNIQUE
LOADING ASSEMBLER... R0 ISN'T UNIQUE # ISN'T UNIQUE
LOADING STRING PACKAGE...
LOADING STRING EXTENSIONS...
BYE ISN'T UNIQUE
OK
Eternal September won't let me post attachments (even text attachments),
so here is the patch diff for FORTH.MAC which you can download directly
from here:
http://www.stackosaurus.com/figforth.html
--- FORTH.MAC (v1.3, original)
+++ FORTH.MAC (v1.4, patched)
@@ -1406,7 +1406,14 @@
HEAD 203,ID.,256,IDDOT,DOCOL ; ***** ID.
.WORD PAD,LIT,40,LIT,137,FILL,DUP
.WORD PFA,LFA,OVER,SUB,PAD,SWAP,CMOVE
- .WORD PAD,COUNT,LIT,37,AND,TYPE,SPACE,SEMIS
+ .WORD PAD,COUNT,LIT,37,AND
+; MASK OFF THE HIGH BIT (END-OF-NAME MARKER) ON THE LAST CHARACTER OF
+; THE LOCAL PAD COPY ONLY, SO IT DISPLAYS CORRECTLY ON A 7-BIT TERMINAL.
+; THE REAL DICTIONARY ENTRY IS NEVER TOUCHED (FIND STILL NEEDS ITS
+; MARKER BIT INTACT), ONLY THIS SCRATCH COPY IN PAD.
+ .WORD DUP,TOR,OVER,PLUS,LIT,1,SUB
+ .WORD DUP,CAT,LIT,177,AND,SWAP,CSTOR
+ .WORD FROMR,TYPE,SPACE,SEMIS
;
HEAD 206,CREATE,240,CREAT,DOCOL ; ***** CREATE
.WORD DFIND,ZBRAN,XXD2-.,DROP,NFA,IDDOT
@@ -1482,7 +1489,7 @@
.WORD SPSTO,DEC,SPACE
.WORD CR,PDOTQ
.BYTE 21
- .ASCII /FIG-FORTH V 1.3 /
+ .ASCII /FIG-FORTH V 1.4 /
.EVEN
.WORD FORTH,DEFIN,QUIT
;
Enjoy,
ECNeilson
--- Synchronet 3.22a-Linux NewsLink 1.2