Shop OBEX P1 Docs P2 Docs Learn Events
Building Blocks for a Tiny Forth Text Editor — Parallax Forums

Building Blocks for a Tiny Forth Text Editor

Ron SutcliffeRon Sutcliffe Posts: 420
edited 2012-03-14 08:41 in Propeller 1
The Editor is written for PropForth Rev 4.00

This is work in progress.

Ron

1

Comments

  • caskazcaskaz Posts: 957
    edited 2010-12-27 05:04
    Hi Ron.

    Editor_blocks_rev 00.1.txt can't load.
    UNDEFINED WORD AT

    Not define WORD"AT" and WORD"cls".
    No elements inside WORD"save_xmem".
    : save_xmem ;
    This is defined by user?

    This need C3 hardware? I don't know well C3.
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-12-27 05:17
    caskaz wrote: »
    UNDEFINED WORD AT
    This need C3 hardware? I don't know well C3.

    These words are defined in a separate file. Needs ANSI.f for the ANSI ESC (escape sequence control) codes to control VT100- type screen operation on teraterm ANSI terminal emulation programs. This is an extension to the kernel. Folks that don't use a terminal program in the final application do not want it occupying dictionary space, so it is not included by default.

    http://code.google.com/p/propforth/downloads/detail?name=ANSI%20Escape%20Sequences.f&can=2&q=

    This does NOT need C3 hardware. Infact, C3 will probably NOT use these codes, as the Hi Res VGA includes ANSI ESC codes, but in a different form. It in the Hi Res.f comments, we can discuss that separately when the C3 hardware is available.
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2010-12-27 05:26
    Hi caskaz

    The AT word and cls are part of the ANSI_Escape_Sequence file so these words must be added to the dictionary before you load the editor.


    IMPORTANT There is a bug in Prof's ANSI_Escape_Squences which you have to fix before anything else.

    Just have another read through my Editor_readme file . I am sure that I have covered all these points in there. The modified code for the word .digits is shown there.

    Please let me know if you have further problems.


    BTW

    May I suggest you start new thread for you work on the SD driver, its a great Project.

    Ron
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2010-12-27 05:30
    @Prof


    Cross Post

    Computers are banned in this house over Christmas, I read your mail and will comment.

    Cheers

    Ron
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-12-27 08:59
    IMPORTANT There is a bug in Prof's ANSI_Escape_Squences which you have to fix before anything else.

    Opened Issue 21 for this, I'll fix it and repost this afternoon
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2010-12-27 09:18
    caskaz and all

    @prof. good man :)

    save_mem is at the end of a list of other words which handles line split and word wrap etc, but I think you know that.

    C3 is the target box, however I do want to make it portable to other configurations with VGA and xmem. C3 is a Parallax product so there will be plenty around

    I have updated the files switching row_max to col_max on top post
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-12-27 14:18
    Opened Issue 21 for this, I'll fix it and repost this afternoon

    Issue 21 fix posted, I had to put a new filename, so I depracated the old version and tacked a date-time stamp

    ANSI Escape Sequences20101227-1535.f

    http://propforth.googlecode.com/files/ANSI%20Escape%20Sequences20101227-1535.f

    Please check that it works
  • Brian RileyBrian Riley Posts: 626
    edited 2010-12-27 21:59
    There's an "st?" near the end, so you need to load "propforth.f"
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2010-12-28 00:44
    Would you kindly point out where st? is in the file that I posted.

    Ron
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-12-28 04:56
    Would you kindly point out where st? is in the file that I posted.

    "st? is used in ANSI.f, if you want to load that, propforth.f needs to be loaded, or the st? needs to be taken out. I always load propforth.f for development, so there may be other things needed as well.
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2010-12-28 06:04
    Prof
    That would explain Brian's Query. I will add a note to the new Editor_Readme file when I update to the top the post in the next day or so. (many more words to added )

    Ron
  • prof_brainoprof_braino Posts: 4,313
    edited 2010-12-28 09:16
    Editor for PropForth. work in progress.

    Here is some more work in progress, the beginning of a command line history editor. This has been on hold since attention has shifted to the propforth kernel versions. It's based on the full screen text editor from Frank Sargent's Pygmy Forth version 17. (Mr. Sargent does a lot of cool things, and pygmy is my favorite port for PC). The idea was to have the same or similar code running on the PC implementation as on the Prop implementation. As you can see both the PC and Prop implementation behave nearly identically, which, unfortunately, is not at all.

    It needs the low level prop specific part. This is as far as I got with the higher level forth, I thought it was pretty close at the time. Please use any of it.

    CommandHistoryEdit.txt

    Note to onlookers: The assembly looking stuff is from the PC implementation, it is not prop assembler. Also the forth is not propforth (yet). Thanks in advance for noticing.
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2010-12-28 12:44
    The Code snippets in the Top post assumes PropForth Rev 3.5 c and not Rev 4.00. You may have difficulty loading the file under Rev 4.00
    I will edit the top Post

    @Prof

    I find that hacking others code is more often a short cut to the long way round . Anyway I am a ways down the track now.

    Ron
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2011-01-10 14:30
    Back to WORDS for a Tiny Forth Editor after being downed by dose of the flue.

    Those who wish to use Tiny Forth Editor on RamBlade will have to make some modifications to SAL's Proforth.spin

    In addition to changing the clock, two minor changes to the PASM code are required. The reason being that,
    once a Spin file is loaded to eeprom pins 31 and 30 are no longer available on the Ramblade board. Only pins 23 and 22 are available for I/O.

    On reboot Propforth defaults back to the standard I/O pins 30 and 31, locking out the RamBlade I/O. These pins are hard coded in the PASM routine onbootPFA There maybe other ways without making changes to ProForth.spin REV 4.0 but I want to run the Editor on minimal Propforth.

    If anyone can suggest a work around, It would be appreciated.

    I decided to continue with Ramblade and to support for VT100 because there are still a number of good xmem boards out there including the new C3 and I also happen to like the old Green on Black VT100 Display.

    Ron

    See Top post for latest Forth file
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-01-10 17:14
    PASM routine onbootPFA ....If anyone can suggest a work around, It would be appreciated.

    The examples often redefine onboot. I think it is set up so that the newest definition for onboot is called at boot time, but I have not tried changing the I/O pins.
    See line 371 of the readme.txt in propforth4.0.zip
  • prof_brainoprof_braino Posts: 4,313
    edited 2011-06-17 08:16
    A built-in editor is one of the items needed to make Propforth complete.

    However, the 4.5 development kernel has gotten very large, there is only about 4k left after the development kernel is loaded.

    Please use the boot kernel (temporarily) for work on the editor, if you run out of space.

    Sal is already started on version 5.0, which targets optimization for size and speed. Which means the larger and/or slower functions will be rewritten in assembler.
    ALSO, the kernel will be designed to run functions as "scripts" so "files" of forth code will execute via the interpreter, and not occupy main dictionary space. The priority is to leave the maximum cog and hub memory available for user aplications/development.

    The intent is that any code that runs on 4.5 will also run on the optimize 5.0.

    I will be futzing with the editor code during 5.0 development, but I would rather leave the "official" version to the experts.

    If any new users would like to collaborate on an editor version with me, please post or PM, as this is a very good way to learn about the language and environment.
    Afterwards, we can compare our result to that of the more experienced developer(s), sometimes we find something interesting.
  • prof_brainoprof_braino Posts: 4,313
    edited 2012-03-14 08:41
    Sal was asking if anyone was using the C3 configuration for propforth. We are putting automated testing in v5.1(?) and want to know if there's anything special required.

    Bringing VGA & Jupiter ACE (and all the other extensions) forward to v5.x is also on the list.

    Now might be a convenient time to bring the C3 and the propforth editor into the Sal's test bed configuration?

    If I could make a request your project, I would ask the editor start with a line editor extension, followed by a block editor extension, followed by a (file system) editor. I'm also trying to get weibel42 on the other thread to work on this. Would that be OK?
Sign In or Register to comment.