Jump to content
IGNORED

fbForth—TI Forth with File-based Block I/O [Post #1 UPDATED: 06/09/2023]


Lee Stewart

Recommended Posts

@Willsy, you inspired me to modify the pattern for '0', as well as CPYBLK 's logging each source block copied and VLIST 's displaying the number of words listed. VLIST is not part of the kernel as is your WORDS . It needs to be loaded (block 21 of FBLOCKS).

 

 

 

Ah, cool. The slash through the zero transforms it, IMHO. Don't know why I didn't do it from day one. Come to think it, don't know why TI didn't do it!

Link to comment
Share on other sites

Thanks Lee! This is really great. I hope the updated manual will also be available so we can take full advantage of the changes.

 

I'm working on it. I just have to keep distractions at bay, e.g., thinking about how to hoist (shoehorn?) fbForth into cartridge space. My plan for the fbForth manual, at the moment, is to just modify the TI Forth manual to accommodate my changes. Admittedly, that's quite a rewrite; but, that's my current strategy. If you have ideas about how you would like to see it done—by all means—chime in! :)

 

...lee

Link to comment
Share on other sites

I'm debating on whether to include >ROA and ROA> (see an earlier post somewhere above) in the transcendental floating point words, such as SIN , COS , ..., to prevent them from corrupting the 80-column text screen. Or, just leave that up to the user. It will add almost 4 milliseconds to the execution of the word—at least, it does in Classic99 (36.8 seconds/10,000 iterations). I suppose I could also define a second set of words for 80-column text mode that are either explicitly loaded by the user or conditionally loaded based on the text mode at load time.

 

See what I mean about distractions? :-o

 

...lee

Link to comment
Share on other sites

OOPS!! :dunce: :-o I just realized that I forgot to include the FBLOCKS file in fbForth100.zip. It's there, now. @retroclouds and anyone else who may have already downloaded it from an earlier post, please take note.

 

The FBLOCKS file is, however, present in the disk images. I just forgot to package the loose file for FIAD use.

 

...lee

  • Like 1
Link to comment
Share on other sites

I can't seem to keep my hands off of tweaking FBLOCKS when I should be working on the manual! I had fixed VLIST to list words in 80-column mode using the full screen, but not the dump routines. They are now fixed, as well. In 40-column mode, DUMP lists 8 bytes per line and in 80-column mode, it now lists 16 bytes. I also changed the addresses in the leftmost column to be followed by a ':'—

*

was:

HEX C000 8 DUMP
 C000  1000  3031  3839  4132  ..0189A2

now:

HEX C000 8 dump
C000:  1000  3031  3839  4132  ..0189A2 

*

I will post the updated FBLOCKS file later today.

 

...lee

Link to comment
Share on other sites

Here's the latest FBLOCKS file with the 80-column-aware DUMP word:

 

attachicon.gifFBLOCKS18NOV2013.zip

 

I will post the detailed Forth code for DUMP and the words it depends on ( VM+ and DUMP8 ) in a few minutes.

 

...lee

 

OK I'm going to wait a few weeks to make sure you're absolutely done! :lol: I know you're procrastinating on the manual, and if I were you I would be doing exactly the same :-D

Link to comment
Share on other sites

OK, here's the commented Forth code for DUMP and its support routines, VM+ and DUMP8 :

 

 

 

( >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<)
( >>>>>>>>>>>>>>>>>>> DUMP ROUTINES 18NOV2013 <<<<<<<<<<<<<<<<<<<<)
( >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<)

( Support routine used by DUMP8 and DUMP <---les)
: VM+ ( n1 n2 --- n1|n1+n2 )     
    VDPMDE @ 0=         ( TEXT80 ?)
    IF                  ( yes )
        +               ( return sum, n1+n2)
    ELSE                ( no)
        DROP            ( return only n1)
    THEN
;

: DUMP8     ( addr n --- addr+n )
    -DUP    ( dup number of bytes if not 0)
    IF      ( we have at least 1 byte to dump)
        BASE->R HEX     ( save current number base and output in hex)
        0 OUT !         ( initialize OUT)
        ( SPACE)        ( remove output of leading space <---les)
        OVER 4 U.R      ( copy and output start address)
        3A EMIT         ( outpt ':' <---les)
        OVER OVER       ( copy addr and n)
        ( n) 0 DO                                    
            DUP @       ( dup addr and fetch contents)
            0           ( convert to double)
            ( format number with 2 leading blanks [6 chars])
            <# # # # # BL HOLD BL HOLD #>   
            TYPE        ( output number)
            2+          ( increment addr to next cell)
        2 +LOOP         ( increment loop index by 1 cell)
        DROP            ( drop incremented addr)
        1F              ( number of chars output so far if full line)
        18 VM+          ( if TEXT80, add 18h <---les)
        OUT @           ( number of chars actually output)
        - SPACES        ( subtract and emit that many spaces)
        ( n) 0 DO        
            DUP C@      ( dup addr and fetch byte)
            DUP 20 < OVER 7E > OR   ( check if a printable char)
            IF          ( it's not a printable char)
                DROP 2E ( replace with '.')
            ENDIF       
            EMIT 1+     ( emit char and increment addr to next byte)
        LOOP
        CR R->BASE      ( output CR and restore number base)
    ENDIF 
;                                             

: DUMP   ( addr n --- )
    CR 
    00                  ( make n double)
    8                   ( bytes/line)
    8 VM+               ( if TEXT80, add 8 <---les)
    U/                  ( unsigned divide by [bytes/line])
                        ( quot = full lines; rem = bytes on last line)
    >R SWAP R>          ( [stack: rem_bytes addr lines])
    -DUP                ( dup lines if not 0)
    IF                  ( we have at least 1 full line)
        ( lines) 0 DO
            8                   ( bytes/line)
            8 VM+               ( if TEXT80, add 8 <---les)
            DUMP8     ( dump a line)    
            PAUSE       ( check for pause)
            IF          ( break was hit so clean up and leave loop)
                SWAP DROP 0 SWAP    ( change rem_bytes to 0)
                LEAVE               ( leave loop)
            ENDIF 
        LOOP
    ENDIF               ( [stack: rem_bytes addr])
    SWAP DUMP8          ( [stack: addr rem_bytes] dump rem_bytes on last line)
    DROP                ( drop addr left on stack)
;                                

 

 

 

...lee

Edited by Lee Stewart
Link to comment
Share on other sites

I'm working on Appendix D, which is probably the most difficult section! :-o

 

I have a question for anybody who still cares about fbForth. @Willsy? @Vorticon? @jacquesg? @idflyfish? @mizapf? @InsaneMultitasker? @Tursi? @retroclouds? @atrax27407? @Opry99er?—

I have started out deleting all word definitions in Appendix D that were in TI Forth but are not part of fbForth—words such as SCOPY and SMOVE (replaced by CPYBLK ). I am wondering about the utility of leaving those entries in with explanations about their demise and references to their replacements, if any. What do you think? :ponder:

...lee

Link to comment
Share on other sites

I think that any words not present in fbForth but that were in TI Forth, should be listed with possible replacement words.

Perhaps you can add references to the "TI Forth Instruction Manual 2nd Edition 2013" where appropriate ?

Don't know if that would mean a lot of extra work for though ;)

 

EDIIT:

Just my 2 cents, which don't mean much as am not an active Forth guy. But thinking about the year to come, it might be good

to have the references in there. Have to say you'r doing great work. Very much like the quality of your documentation (looking at

your 2nd Edition TI Forth instruction manual) :thumbsup: :thumbsup: :thumbsup:

Edited by retroclouds
Link to comment
Share on other sites

I am wondering about the utility of leaving those entries in with explanations about their demise and references to their replacements, if any. What do you think? :ponder:

 

Definately. A user familiar with TI Forth will be expecting them to be there, so the document should state that those words are deprecated, removed, and, where appropriate, replaced.

 

It doesn't have to be in appendix D - it could be another appendix of "Deprecated Words" where you will have an opportunity to provide a short discussion, and quote the equivalent replacement words or equivalent procedure to reproduce the same functionality.

  • Like 1
Link to comment
Share on other sites

OK. I think, then, I will add an appendix following the Glossary that will detail fbForth changes from TI Forth. This will include words that have been added, removed, re-purposed and deprecated. All of those words, except those removed, will also be discussed elsewhere in the manual where appropriate, including the Glossary. Even some of the removed words will be discussed elsewhere as necessary.

 

...lee

Link to comment
Share on other sites

I'm debating on how I should present the "differences" appendix. I started out classifying the nature of the changes (added, removed, re-purposed and deprecated) into separate sections; but, perhaps, I should make one alphabetized list of words with comments after each to indicate the change(s). Thoughts?

 

Here's the list in case you're interested—it's 111 words:

 

 

 

!"
(!")
(UB)
.S
-64SUPPORT
-ASSEMBLER
-BSAVE
-CODE
-COPY
-CRU
-DUMP
-EDITOR
-FILE
-FLOAT
-GRAPH
-GRAPH1
-GRAPH2
-MULTI
-PRINT
-SPLIT
-SYNONYMS
-TEXT
-TRACE
-VDPMODES
;ASM
;CODE
<CLOAD>
>ROA
ASM:
B/BUF
B/BUF$
B/SCR
B/SCR$
BFLNAM
BLKRW
BLOCK
BOOT
BPB
BSAVE
CLEAR
CLOAD
CLR_BLKS
CLS
CODE
COLD
CPYBLK
DBF
DEFBF
DEPTH
DISK-HEAD
DISK_BUF
DISK_HI
DISK_LO
DISK_SIZE
DKB+
DOES>ASM:
DO_BRW
DR0
DR1
DR2
DRIVE
DSRLNK
DTEST
DUMP
FILES
FORMAT-DISK
FORTH-COPY
FORTH_LINK
GPLLNK
LCT
MENU
MESSAGE
MGT
MKBFL
MON
NEXT,
R/W
RANDOMIZE
RBLK
RDISK
RND
RNDW
ROA
ROA>
SCMP
SCOPY
SCREEN
SCRTCH
SEED
SGN
SLIT
SMOVE
TEXT80
TLC
USEBFL
VAND
VDPMDE
VFILL
VLIST
VMBR
VMBW
VMOVE
VOR
VSBR
VSBW
VWTR
VXOR
WBLK
WDISK
WLITERAL

XMLLNK

 

 

...lee

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...