Jump to content
IGNORED

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


Lee Stewart

Recommended Posts

Anybody have a preference as to where I discuss the font editor in the manual? Chapter 3 is "How to Use the fbForth 2.0 Editors," which currently discusses the two text editors (40/80-column and 64-column). I could include the font editor in this chapter or give it its own chapter. What do you think?

 

...lee

Link to comment
Share on other sites

  • 2 weeks later...

OK—A new chapter it is.

 

I'm going to try to have the fbForth 2.0 Manual done by this Friday's lunch meeting with you, Jim. That may be too ambitious, but I will try. I should have my cartridge stickers by then, as well.

 

I think I will also officially release the fbForth 2.0 binary because I have finished with my coding and testing of added features and have not received any bug reports from users, which latter fact is surely due to the paucity of Forthers here. Perhaps the release will bring out more testers—not really the way to do it, but the bugs won't be discovered without use.

 

...lee

Link to comment
Share on other sites

Here's part of the fbForth 2.0 Manual’s “Introduction”:

 

New to fbForth 2.0 are

  • The facility for loading your own font in place of the default font in the cartridge (see Chapter 13 “User Fonts and the Font Editor”). Chapter 13 also provides instruction for using the author’s Font Editor. New words are SCRFNT , FNT , USEFFL and FONTED .

  • Several software packages, previously requiring loading from FBLOCKS, are now part of the resident dictionary:

    • 40/80 Column Editor, rewritten in TMS9900 Assembly Language (ALC) for efficiency, now including an on-screen menu

    • Floating Point Math Library, which no longer uses the console GPL/XML-based library, and contains several new words, including FFMT. (includes a formatted print option for 3-digit E-notation)

    • File I/O Library, including new words, >DEG , >RAD , CEIL , DEG/RAD , EXP10 , EULER_E , F>R , FABS , FCONSTANT , FMT. , FLOOR , FMINUS , FP1 , FP10 , FRAC , FROT , FVARIABLE , LN10INV , LOG10 , R>F , RAD/DEG and TRUNC

    • BSAVE—Binary Save Routine

    • All Graphics modes, including VMODE , an all-purpose mode-changing word

    • Graphics Primitives Library, much of it rewritten in ALC

  • .BASE—a new word for displaying the current radix (number base) in decimal

  • Many new words and many words removed (see Appendix E “Differences: fbForth 2.0, fbForth 1.0 and TI Forth”).

Let me know if I missed anything.

 

...lee

Link to comment
Share on other sites

I started printing the manual and realized that pages after the TOC are mis-registered. :mad: This only matters if you print the manual double-sided. If you do that, print through the TOC (an odd # of pages)—then, print the rest, starting with the next page. I will post a corrected manual in a few days that forces a blank page after the TOC.

 

...lee

Link to comment
Share on other sites

This is a little aside but I was reading Jerry Pournelle's User Column in the Byte issue of December 1980 and he was reviewing the available programming languages for microcomputers. He states:

 

"Which concludes my overview of languages. I haven't mentioned STOIC and FORTH, because they're really a kind of assembler language using the programmer as a parser; they make programming a bit easier, but you've got to be into assembler work before you can use them, and this is, after all, the User's Column. "

 

Come to think of it, he's not that far off...

Link to comment
Share on other sites

...but you've got to be into assembler work before you can use them...

 

I heartily disagree! :P You do not need to know assembler to use Forth. You can certainly use assembler (and more easily, at that) if you wish and it certainly doesn't hurt to "be into assembler", but you don't need it.

 

...lee

Link to comment
Share on other sites

I think he was more referring to the fact that one has to directly and consciously manipulate the stack in Forth, which is a concept more akin to assembly than a high level language. IMHO, the way assembly language programmers build a program is closer to Forth and any other high level language, and so may have an easier time adapting to Forth than someone with only say BASIC or Pascal programming experience.

I agree with you of course that Forth can certainly be learned from scratch by the complete programming newbie, who actually will likely have an easier learning curve with it than someone saddled with past programming experience in another language :)

Link to comment
Share on other sites

I started printing the manual and realized that pages after the TOC are mis-registered. :mad: This only matters if you print the manual double-sided. If you do that, print through the TOC (an odd # of pages)—then, print the rest, starting with the next page. I will post a corrected manual in a few days that forces a blank page after the TOC.

 

...lee

 

Just in case someone finds errata in the manual between now and the Faire, I think I will wait until just before I leave for that august assemblage to post the updated manual with the corrected page registration.

 

...lee

Link to comment
Share on other sites

I've ported @Willsy's TurboForth cataloging utility to fbForth 2.0. It runs the same way, e.g., DIR DSK1. will display the directory of DSK1:

 

 

 

DECIMAL
0 VARIABLE CatRec 36 ALLOT          ( CPU RAM Catalog record buffer)
PABS @ CatRec OVER 70 + FILE Cat    ( Create Catalog file reference)
0 VARIABLE Total  
0 VARIABLE FCount  
0 VARIABLE LC  
HEX 
0B11 VARIABLE Tabs 1700 ,    ( tabs at 11, 17, 23)
DECIMAL

: Tab ( n --- x ) 
    Tabs + C@ CURPOS @ SCRN_WIDTH @ / GOTOXY 
;                      
( Convert Radix-100 number in CatRec to 16-bit integer)
: @R100 ( i --- v ) 
    9 * CatRec DUP C@ + 2+ + 
    PAD 8 CMOVE             ( in case on odd boundary)
    PAD F@ F->S
;                                           
( Display disk information)
: DskInfo  
    RD DROP CR 
    CatRec COUNT ." Disk Name: " TYPE CR 
    ." Total: " 1 @R100 DUP U.  2 SPACES 
    ." Free: "  2 @R100 DUP U.  2 SPACES         
    ." Used: " - U. CR 
;
( Display file type and record size)
: Ftype ( ftype --- )  
    CASE                                       
        1 OF ." DF" ENDOF
        2 OF ." DV" ENDOF
        3 OF ." IF" ENDOF       
        4 OF ." IV" ENDOF
        5 OF ." PRG" ENDOF
        ." ???"
    ENDCASE        
    2 @R100 -DUP 
    IF 
        . 
    THEN 
;
: Head1 ( --- ) 
    ." ---------- ----- ----- -" CR 
;
: Head ( --- )  
    ." Name       Size  Type  P" CR
    Head1 
;
( Catalog each file in directory)
: DoDIR ( --- ) 
    0 LC !  0 Total !  0 FCount !  Head 
    BEGIN      
        LC @ 20 MOD 19 = 
        IF 
            KEY DROP CR Head 
        THEN 
        RD DROP
        CatRec COUNT DUP              
    WHILE 
        TYPE  
        1 @R100 1+ DUP  0 Tab 5 U.R  Total +!            
        0 @R100 1 Tab Ftype  CR
        1 LC +!  1 FCount +!
    REPEAT 
    DROP DROP  Head1  
    FCount @ . ." files" 0 Tab Total @ 5 U.R ."  sectors" CR 
;                                             
( Catalog the directory)
: DIR 
    Cat SET-PAB         ( Initialize PAB skeleton)
    INTRNL  FXD  RLTV  INPT  38 REC-LEN ( Initialize catalog parms)
    ( Get directory name from inout stream)
    PAB-ADDR @ 10 + 32 WORD HERE COUNT >R SWAP R VMBW R> N-LEN!
    ( Get the catalog and display it)
    OPN         ( open the catalog)
    DskInfo     ( display disk info)
    DoDIR       ( display file list)
    CLSE        ( close the catalog)
;

 

 

 

I will add this to the next version of FBLOCKS. In the meantime, you should be able to paste the above code into fbForth 2.0—at least, in Classic99.

 

...lee

Edited by Lee Stewart
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...