Shop Learn
TAQOZ - Tachyon Forth for the P2 BOOT ROM - Page 35 — Parallax Forums

TAQOZ - Tachyon Forth for the P2 BOOT ROM

13132333537

Comments

  • AJLAJL Posts: 374

    The French tried to introduce decimal time (10 hours per day, 100 minutes per hour, 100 seconds per minute; 100,000 seconds per day) at the time of the French Revolution, but ironically it didn't even last a decade.

  • Here's a version of the binary that you can upload into Flash using flexprop. Default baud is 921600.

  • Peter JakackiPeter Jakacki Posts: 10,160
    edited 2021-02-22 00:58

    I downloaded the 8x8 font with Parallax symbols from the forum and added that to TAQOZ as I was just using a compact 5x7 font. I intend to make it easier to switch fonts as need be, perhaps by loading a resource from Flash/SD although even with the font table, the extra code only takes 2k bytes. At present I have to have an optimized routine for each depth of the bit plane that I intend to use, although that has mainly been 1 or 8-bit.
    (I haven't added the bit that wraps properly to prevent clipping)

  • Peter JakackiPeter Jakacki Posts: 10,160
    edited 2021-02-23 02:46

    Here are a few screenshots of some of the dumb video modes that you can change on-the-fly interactively and even change the P2 clock frequency as needed as the video driver automatically readjusts. By dumb, I mean who would ever ever need a 32x18x1 pixel display? But you can set it to almost anything that will display and from 1 to 8-bit depth.
    The text driver handles all the controls but I'm thinking about adding the little bit extra so it can take dumb ANSI escape sequences to make it more compatible with ANSI terminals. I'm also experimenting with having fonts on file in Flash/SD so I can mix low-res terminal text with large hires fonts.
    This is part of the code that sets some of the modes. These ones all use the common V74 routine that uses a 74.25MHz clock.

    pub 720p        1280 720 1 : V74 VRES 74,250,000 VCLK
                    72 80 216 HSYN 3 5 22 VSYN  ;
    pub 360p        640 360 2 V74 ; ( 8bpp scrsz = 230400 )
    pub 180p        320 180 4 V74 ;
    pub 144p        256 144 5 V74 ;
    pub 90p         160 90 8 V74 ;
    pub 45p         80 45 16 V74 ;
    pub 18p         32 18 40 V74 ;
    
    3648 x 2736 - 2M
    3648 x 2736 - 2M
    3648 x 2736 - 2M
    3648 x 2736 - 2M
    3648 x 2736 - 3M
    3648 x 2736 - 3M
    3648 x 2736 - 2M
    3648 x 2736 - 3M
  • TAQOZ Bytes?

    A Byte of TAQOZ? (is it supposed to rhyme with tacos?)

  • Yes, TAQOZ is a twist on Tachyon OS and I pronounce it like TAR-COes as in this boot screen.

  • ErNaErNa Posts: 1,556

    To bring it back to page one and trying to keep it there...

  • @ErNa said:
    To bring it back to page one and trying to keep it there...

    and it's also a good time to say that although TAQOZ was mighty fast reading FAT32 files, it is even faster now at over 5MB/s read speeds. I can do the same for write once I do some more testing.

                     *** SPEEDS *** 
        LATENCY......................... 228us,319us,306us,306us,303us,307us,335us,310us,
        SECTOR.......................... 308us,410us,397us,396us,394us,398us,428us,401us,
        BLOCKS.......................... 5,273kB/s @300MHz ok
    
  • ErNaErNa Posts: 1,556
    edited 2021-03-10 21:28

    I do not remember if there is an TAQOZ EXTENDED thread, so I ask here:
    1.: !SP clears the data stack. .S prints an empty stack. ^S according to TAQOZ ROM glossary is a shortcut. But instead it places "DEADBEEF" on the stack. .S shows an stack level of 1.s
    2.: After booting "reloaded" the stack pointer level is 2, content: 0 , 0 - While it is a good idea to clear the stack at a program start, this for sure is not intensional?

    And another question: what exactly is the meaning of "pre" when defining new words? SED is such a word, does it mean, SED can be interrupted to do background tasks? So other tasks can run in parallel?

  • @ErNa - I keep thinking that maybe TAQOZ RELOADED needs its own thread but I know that won't really work as some will ask questions in the wrong thread anyway. The ROM is mainly for testing hardware anyway.

    ^S has been assigned to a console shortcut to clear the stack and leave a check value on it. The reason for the check value is so that if it is no longer there or when you test some code, then there may have been a stack bug. DEADBEEF is a well known hexadecimal marker.

    1. I could !SP but then I wouldn't see that something needs to be tidied up. However, I sometimes use !SP within a forever BEGIN AGAIN loop just to prevent stack bugs from killing the code when left running continuously. Of course I check it when I test it but things happen.

    Regarding the pre pub pri thing, a little diversion into traditional Forth first.
    Forth uses : to create a new definition and sometimes you may be creating extensions for the compilation process itself, the same way an IF ELSE THEN works in that these words shouldn't be compiled, they should be executed to assist the compile process. Take this simple definition for example:
    : YES? WKEY 'Y' = IF ." Yes it is! " ELSE ." :(" THEN ;
    The IF needs to know where to branch to if the condition hasn't been met (true), much like a JNE (JUMP-IF-NOT-EQUALS) will execute the code following it else executes somewhere else. To make that possible IF is marked with an flag in the dictionary header as an IMMEDIATE word so that the compiler, having found IF in its dictionary, now knows that it should execute this word rather than compile it. The IF then marks and pushes its code pointer and compiles the equivalent of the JNE but with a dummy branch since it hasn't resolved that yet. (Hint: SEE YES?)

    Remember, the compile is single-pass as you type. When ELSE or THEN are encountered, they too will execute as IMMEDIATE words where ELSE will check the stack for a marked code pointer and resolved the IF while also marking and pushing its code pointer to be resolved by THEN etc.

    Back to TAQOZ:
    While I can use the : to create a new definition, I prefer to use more readable words than single character symbols, so I borrow from Spin etc and use pub instead. This is instantly recognisable but also easier to spot in the source and now when I want a word to immediately execute, even when I am defining a new word, I use pre instead of pub to indicate its preemptive nature and therefore I also have no need to attach the ugly IMMEDIATE word after it either.

    Remember too that unlike Forth which interprets interactive text commands when it is not compiling a definition, TAQOZ on the other hand always compiles, even interactive text such as 0 $100 DUMP and then executes it when you press enter. There are lots and lots of advantages to compile then execute vs text interpreting but it also presents a problem when we say "SED MYFILE" in that SED needs to open MYFILE but the compiler would normally compile SED and then throw an error as it can't find MYFILE in its dictionary since it is a file name, not a definition.

    But because SED is marked as a preemptive or immediate word, it executes immediately it is encountered and asks for a text word, in this case MYFILE, before trying to open it or test it.

    Okay, that takes care of pub and pre, but what's pri?
    PC Forths have gigs of memory and the dictionary can be as large as it needs to be, but embedded systems have limited memory and while the definition's name may be necessary during compilation, it is much like all those symbol names that a compiler keeps track of. They are not necessary for actually running the code. If you are familiar with Forth you know that the name headers are in code memory followed by the code itself and so there is no easy way to strip these "symbols" out, and it could be nigh well impossible. But TAQOZ keeps code and dictionary, as well as data separate. The dictionary is a separate array of "symbols" and their values.

    TAQOZ# @WORDS $20 DUMP --- 
    1BC25: 04 59 45 53  3F B4 AB 83  53 45 44 64  AB 44 53 45     '.YES?...SEDd.DSE'
    1BC35: 44 3A 42 AB  46 53 45 44  4B 45 59 68  AA 46 3F 42     'D:B.FSEDKEYh.F?B' ok
    

    Suffice to say that if we define a word with pri instead of pub or pre then the dictionary entry has a pri attribute set for it. The compiler does nothing with this unlike the pre, however a RECLAIM utility can identify these headers and easily strip them out while compacting the dictionary thus reclaiming memory. The other benefit of this is that when we don't want a word to be public and accessible, then we can make it truly private after a RECLAIM.

    Have a look at the Tachyon Source Forge wiki pages for more background and even this one.

  • ErNaErNa Posts: 1,556

    Peter, thanks for this little essay. It brings the issue to the point. I now have to digest it, but I already see that immediate just means a virtual end of line so the now executed command can jump in to interpret the following word. Its very much like an interrupt, with the immediate word being the interrupt routine which decides when to return and give control back to the interpreter. With the immediate execution it's like a new instance of Tachyon is invoked. While in a stack machine all the informations needed are placed in advance in the stack, now the immediate word looks to the future. So to me it's a hybrid. Let me see if this understanding brings me a step forward...

  • ErNaErNa Posts: 1,556

    Just another simple question: in searching BLK! I found a lot, event DECOMP and the WIKI, but not BLK! to see, what it actually does. Looks like it blanks an array, but which one?

  • ErNaErNa Posts: 1,556

    I want to point at the WIKI pages in SF : https://sourceforge.net/p/tachyon-forth/wiki/browse_pages/
    While the last modify was 2020-06 it worth browsing. Peter outed to many informations in so many ways, that's a pity this information is not eaten. Again I see: it needs a desktop application were you P2 running TAQOZ will be badly missed it not at hand. I don't know, what this application is, ...
    TAQOZ in some respect is different from other systems: you can blink a led in such a simple way, that you can not use it to demonstrate your skills. But writing a editor is such a complex task, a newbee will not manage. So while with arduino you feel as the master of the universe, the moment a led blinks (not to talk about a peep), with TAQOZ you feel a loser if you can not improve SED ;-)

  • Peter JakackiPeter Jakacki Posts: 10,160
    edited 2021-03-12 10:28

    @ErNa - there is some truth in this as it really is too easy to make things happen and just like pressing a button, there is no glory in it, but if you tap and tap away at the keyboard and manage to make the compiler happy, and the downloader, and then the micro, then you are indeed a "genius".

    I could never figure out what is so hard about Tachyon/TAQOZ because anything that anybody has given as an excuse has never made any sense when they are able to navigate the complex setups and syntax of conventional tools.

    If P1 compiler tools had generated Tachyon wordcode, the instruction set of the Tachyon "CPU", I wouldn't have been at all surprised if they no longer ran out of memory or all of a sudden could run at high-speed instead of sluggish XMM. The same too with the P2 although it doesn't have the memory limitations of the P1 (yet).

    I am not concerned about a desktop P2 as that is what I have always had to the degree that suits me anyway, but I am setting my sights on a P2 based test instrument. It's something I need, and something everybody needs, and unlike a "PC", is a realtime instrument.

  • Let me be frank, I'm not grasping all this.
    To me, whether I use TAQOZ or anything else, it's a matter of personal preference, the way I think and do (or don't do) things. I can't see how it would be possible to achieve something without actually being involved and putting some, maybe much, effort to learn what you need to learn to achieve it.

    Blinking a led in TAQOZ is very simple - yes, but I use it not to demonstrate my miserable skills but as a useful debugging feature and really appreciate the fact Peter has made it that simple for me. Actually there are many, many routines that were made to be effective and simple in use.

    You say we miss a killer application for TAQOZ....and I say we do not. It all depends on how you define a killer app. To me such application is the one I actually need at a given point of my project and do not have time or skills to develop it myself. And that need changes over time.

    I set out on the TAQOZ because it gives me the ability to quickly test my idea without the need for external tools and is platform independent.

  • MaciekMaciek Posts: 306
    edited 2021-03-12 11:13

    @"Peter Jakacki" said:
    @ErNa - there is some truth in this as it really is too easy to make things happen ...
    ....
    .... but I am setting my sights on a P2 based test instrument. It's something I need, and something everybody needs, and unlike a "PC", is a realtime instrument.

    Please do, I could easily be your tester/customer at any time :). That actually IS a killer app/device for me right now !
    I could actually delay that DSO purchase I am considering in another thread for a few months....or even better, cancel it.

  • msrobotsmsrobots Posts: 3,340
    edited 2021-03-12 11:59

    I would buy on too,

    Enjoy!

    Mike

  • Maybe we should not plaque this TAQOZ for the P2 ROM thread but create a dedicated one for the "P2 based, realtime test instrument" instead (when the idea is ripe) ?
    If that instrument could also incorporate a P2D2 module (or two) in its guts that would be really cool :) .

  • ErNaErNa Posts: 1,556

    I agree. We could start writing pseudo code and as a lineOfCode LOC is agreed on, that line could go to the flash card and to Peter‘s wiki. So we get acquainted with the P2, (I currently run a Evalboard) SED, debugging and most Important, with collaboration

  • I will create a new thread but since I haven't finalized my P2LAB board, then maybe I might add my instrumentation layer to this, or at least allow for instrumentation modules.

  • ErNaErNa Posts: 1,556
    edited 2021-03-13 20:40

    Befor I search around I ask this question directly: can I reload or how can I reload respectively a module from the flash card. If I can edit SED.FTH using SED SED.FTH and save it to flash, how can I invoke the new version?
    And I just add another one: If SED is defined, _sed is "orged". _sed itself is defined later, so currently present. *SED* seems to be just a printout version message when SED.FTH is loaded. If *SED* is not defined, _sed seems to become org automatically, as it is the first statement in the code.
    Is it just a convention that *SED* represents SED or are the stars like tags, that have inherited meaning?

  • Peter JakackiPeter Jakacki Posts: 10,160
    edited 2021-03-14 00:42

    You can FLOAD any module but not FILE or EXTEND. I will have to revisit this to make sure nothing is broken though.

    I need a cleaner way to reload a module and that is what I always intended to do by adding a "module" word instead of pub MODULENAME etc. At present it needs to detect if the module is loaded and so I use a standard method for all module titles as the first definition and so it can simply FORGET MODULENAME before reloading. However, this does not release the assigned data memory and so I use a kludge method with the IFDEF and a known variable that can then reset the data org pointer back to the value of that variable.

    Doing this before the TAQOZ fast load means we get a correct report when it encounters END.

    Later on I will get rid of this mechanism when I introduce the module keyword.
    btw. When I list the modules at startup, it simply searches the dictionary and lists and executes any word that is enclosed in a *

  • ErNaErNa Posts: 1,556

    Thanks Peter, answers some questions.. I couldn't find the AT word like in "BLK! AT tblk 2+ ! AT tw C! ;"

  • There are many Forth words which are only a single tiny symbol like . and , and ' etc. While they are handy in interactive mode, I do find that they get lost in the jumble of symbols when reading source. So I have aliases for many of these such as PRINT for the dot and AT for the tick. I read it as "AT ".

    Look at line 57 in EXTEND, it has ALIAS ' AT

  • ErNaErNa Posts: 1,556
    edited 2021-03-14 13:21

    I feel it to be a good idea to at the first appearence of a symbols name write the full name as a comment. Like in SED "pri tw 64 ; --- editor width (default 64 )" tw most likely is the "terminal width" and "tblk" is a "terminal block", not BLANK or BLACK. A first wronly interpreted mnemonic is flashed and hard to overwrite.

  • @ErNa - if I posting my code as an example, I would clean it up and change some names etc, but SED is a Q&D WIP and it gets the job done in the meantime. I still have a lot to do on it but I will try to tidy it up somewhat, such as tblk is a text block so it could be txtblk perhaps.

  • ErNaErNa Posts: 1,556
    edited 2021-03-14 14:47

    Hi Peter, I just collect remarks I have to make as I stumble through the code. Making all the mistakes over and over again, the knowledge slowly settles. That's what I see as a steep learning curve. You on the fly use so many tricks and now and then I realize how one of my tricks works in Forth, now and then I find and learn new ones. I also may encourage others to also learn. It's worth the effort. I thought about what [b] means and realized, I just have to type [b] return (or: enter) so have a bold (red) printout on my terminal... That's the funny thing with an interpreter. You just test it.
    And by the way: as I tried this out I realized, printing an empty stack shows an result, not an error. If there is a simple way to throw an exception whenever an obvious stack error occurs, that would be nice during debugging..

    If SED would not be Q&D I would have to look to another POC (piece of code) to learn. Please don't feel distracted from finishing P2D2, see this just as small talk

  • First baby steps with Taqoz.
    I define : TEST 10 0 DO I . LOOP ; which runs fine.
    But SEE TEST only shows the first two bytes, rather than showing the expected full definition.
    Is SEE broken?
    I'm running TAQOZ v2.7 'CHIP' Prop_Ver G 200MHz 201123-1000 on a P2EVAL

  • I am running the same version but SEE seems to do fine.

    Which version of EXTEND do you have ? Mine is EXTEND Primary kernel extensions for TAQOZ 210128-0830.

  • That version should be running fine but I could post the latest binary shortly anyway.
    ```
    TAQOZ# : TEST 10 0 DO I . LOOP ; --- ok
    TAQOZ# TEST --- 0 1 2 3 4 5 6 7 8 9 ok
    TAQOZ# SEE TEST

    1DA8E: pub TEST
    079CE: 180A 10
    079D0: 1800 0
    079D2: 10C4 DO
    079D4: 013B I
    079D6: 2B6E .
    079D8: 0143 LOOP
    079DA: 0060 EXIT
    ( 14 bytes )
    --- ok
    TAQOZ# .VER --- Parallax P2 TAQOZ RELOADED sIDE V2.8 'CHIP' Prop_Ver G 340MHz 210312-1900
    ok
    TAQOZ# 10 FOR I . NEXT --- 0 1 2 3 4 5 6 7 8 9 ok
    ```

Sign In or Register to comment.