Jump to content
IGNORED

Foxit - in progress


GDMike

Recommended Posts

18 hours ago, Lee Stewart said:

 

Here it is for TurboForth:

 

I have not tested it, but it should work.

 

...lee

I've entered it into TF and it compiles successfully, but how do I run it? When I execute RKEY it just leaves 13 on the stack (enter key). Any example calling code?

Link to comment
Share on other sites

1 minute ago, Willsy said:

I've entered it into TF and it compiles successfully, but how do I run it? When I execute RKEY it just leaves 13 on the stack (enter key). Any example calling code?

 

It is typically part of an infinite key-in loop. RKEY was initially part of the block text editor in TI Forth. You use something very similar in TurboForth, as do I in fbForth. Both of the latter are in ALC.

 

...lee

Link to comment
Share on other sites

56 minutes ago, Willsy said:

I've entered it into TF and it compiles successfully, but how do I run it? When I execute RKEY it just leaves 13 on the stack (enter key). Any example calling code?

: TEST   BEGIN  RKEY DUP  EMIT  90 = UNTIL ;

 

Is what I do.

  • Like 4
Link to comment
Share on other sites

Three observations:

 

1) You're not using stack comments. In a month, you won't remember how the more complex words work and you'll have to decode them again!

2) The word DISP is misleading. It implies that it displays something, but it doesn't. It just pushed ROW and COL to the stack - consider renaming it.

3) Nice use of LEAVE in the word DEL1 :thumbsup:

 

It's much easier for us if you can post your code into Atariage, rather than read it from a video. You know you can export your blocks to Windows, right? Then you can just paste your code directly in to Atariage. See BLK>FILE on block 20. Boot from the standard TF boot disk, and type FILES - it will show you the files utilities. BLK>FILE is on block 20.

image.png.da563a656927d39c3a0f24bfb3aac48f.png

75 80 BLK>FILE CLIP

 

That will export blocks 75 to 80 to the Windows clipboard, and you can simply paste the text into Atariage or notepad or whatever. Works in Linux too if you're running Classic99 under wine.

  • Like 3
Link to comment
Share on other sites

Oh, right about using clipboard, I totally forgot that you mentioned that earlier. Gotcha.

On the same Note, honestly, I was in a hurry because as soon as my last hour was up, bam! The code came together.

But yes, I'll practice clipping some code tonight, my last night on my Forth weekend. 

Comments, I actually have written notes in my TF booklet that takes me step by step, because there's just no room to make adequate comments, unless I dedicate more screen blocks for that sole purpose. I hear you regarding comments. BTW, that was sorta a mad dash as well as I'd be embarrassed if I show code with no comments at all.

Thx, I really appreciate the feedback. Tonight ought to be interesting, as I get to fine tune this, and hopefully not frankenforth my code at the same time.

 

 

Edited by GDMike
  • Like 1
Link to comment
Share on other sites

2 hours ago, GDMike said:

Comments, I actually have written notes in my TF booklet that takes me step by step, because there's just no room to make adequate comments, unless I dedicate more screen blocks for that sole purpose. I hear you regarding comments. BTW, that was sorta a mad dash as well as I'd be embarrassed if I show code with no comments at all.

 

Though commenting the code is, indeed, important, @Willsy was talking specifically about ALWAYS including stack effects, which are inline comments to show what is expected on the stack before execution (represented by ‘--’) and what is left on the stack, with the most accessible item (top of stack) on the right on either side of ‘--’:

 

 Here are examples from the code I posted earlier plus an extra one to show stack before execution, with only the stack effect comments:

: ?KEY   ( -- key|0 )                <<---expects nothing..leaves ASCII key value or 0
   KEY?   DUP 0< IF DROP 0 THEN  ;
: CURPOS   ( -- pos )                <<---expects nothing..leaves screen position of cursor
   $A02A @  $A02C @ *  $A028 @ +  ;
: GCH  ( -- )                        <<---expects nothing..leaves nothing [usually safe to omit empty stack effects, but still useful]
   CURPOS   V@ CURCHR !  ;
: MYADD  ( n1 n2 -- sum )            <<---expects two 16-bit numbers..leaves 16-bit sum
   +   ;

Of course, it is always good to include as much descriptive commenting as you can afford to make sense of your code down the road. But, the most important comments are the stack effects! You should always include them.

 

...lee

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

43 minutes ago, GDMike said:

My brain has to capture this meaning, after I wake up a bit.. bwhhaha...ok...thx lee for this.

You're both absolutely correct. I need to figure this out.

Some might say the stack diagram tells you the "gazintas and gazouttas" :)  of a word.

( what 'goes into" and what "goes out of")

  • Like 1
Link to comment
Share on other sites

2 minutes ago, TheBF said:

Some might say the stack diagram tells you the "gazintas and gazouttas" :)  of a word.

( what 'goes into" and what "goes out of")

Yes sir, thx.

Was just looking at the"snake" comments over on another POST..it's starting to come together for me.

Edited by GDMike
  • Like 1
Link to comment
Share on other sites

40 minutes ago, GDMike said:

My brain has to capture this meaning, after I wake up a bit.. bwhhaha...ok...thx lee for this.

You're both absolutely correct. I need to figure this out.

 

Stack effects:

  • ‘--’ represents the execution of the word being defined.
  • Elements to the left of ‘--’ are relevant stack contents before execution.
  • Elements to the right of ‘--’ are relevant stack contents after execution.
  • On either side of ‘--’, the rightmost element is the top of the stack.
  • The vertical bar ‘|’ means ‘or’. It is separating two possible outcomes.

...lee

  • Like 3
Link to comment
Share on other sites

11 minutes ago, Lee Stewart said:

 

Stack effects:

  • ‘--’ represents the execution of the word being defined.
  • Elements to the left of ‘--’ are relevant stack contents before execution.
  • Elements to the right of ‘--’ are relevant stack contents after execution.
  • On either side of ‘--’, the rightmost element is the top of the stack.
  • The vertical bar ‘|’ means ‘or’. It is separating two possible outcomes.

...lee

Ok.. this is something I tried finding in Forth books, and it wasn't this clear to me from what I remember reading..I do have another book coming in though, and not much in those books as far as what they expect the user to know about the hardware. I'm finding myself having to learn both at the same time, I mean, it's understandable that you need to know the hardware, but look at basic for example, I can say print to the screen, and know nothing about the hardware except for the rules of the command.  I Know much more hardware than I used to from doing assembly, but still, it's knowing, well, all the hardware for programming in Forth.. and it mean this in a good way, it's just, if someone wanted to learn Forth and is coming from BASIC, then they really need to know this.

Edited by GDMike
Link to comment
Share on other sites

53 minutes ago, GDMike said:

Ok.. this is something I tried finding in Forth books, and it wasn't this clear to me from what I remember reading . . .

 

Stack effects (also stack signature or stack comments—see @Willsy’s posts above) are discussed in pretty much every Forth book out there, among them Leo Brodie’s Starting FORTH, pp. 39 – 41 and my fbForth 2.0: A File-Based Cartridge Implementation of TI Forth, p. 10.

 

...lee

  • Like 2
Link to comment
Share on other sites

1 hour ago, Lee Stewart said:

 

Stack effects (also stack signature or stack comments—see @Willsy’s posts above) are discussed in pretty much every Forth book out there, among them Leo Brodie’s Starting FORTH, pp. 39 – 41 and my fbForth 2.0: A File-Based Cartridge Implementation of TI Forth, p. 10.

 

...lee

Yes, I found in Leo Brodie's book, in the first few pages, but I couldn't make sense out of it at the time. And I think it was only a couple pages or just 1 Page..I'll have to go back and review it..I can't remember it now...

Link to comment
Share on other sites

Hmm I loaded block 20, received message.. e.g. 1 21 BLK>FILE DSK2.BLKDUMP

 

I tried, 79 80 BLK>FILE DSK4.TEST and received a file in my DSK4 directory, but couldn't read it with notepad.

I tried this a couple more times.. with Same results. 

AHh.... it was notepad itself...

Figured it out...

 

IMG_20220206_194344788.jpg

Edited by GDMike
Link to comment
Share on other sites

Took care of some reading and then I went back to my work on the Foxit command window where I was able to finish adding the directional left,right keys and adding the ENTER key along with the boundary honks.

Everything is looking really good in my tests. 

I guess next week will start to work on the command line string lookup comparison things.

At the same time I'll need to do some screen builder stuff... not quite ready for heavy stuff, but I'm making a dent.

I know TF already has string handling, so I suppose I'll need to read up on that.

Edited by GDMike
  • Like 1
Link to comment
Share on other sites

7 hours ago, GDMike said:

Hmm I loaded block 20, received message.. e.g. 1 21 BLK>FILE DSK2.BLKDUMP

 

I tried, 79 80 BLK>FILE DSK4.TEST and received a file in my DSK4 directory, but couldn't read it with notepad.

I tried this a couple more times.. with Same results. 

AHh.... it was notepad itself...

Figured it out...

 

IMG_20220206_194344788.jpg

Don't send it to a disk file - if you do that, Classic99 will create the file as a DV80 file and it will have a bunch of crap at the top and also the line endings and stuff will all be wrong. Use CLIP.

 

CLIP is a special feature in Classic99 that allows a TI program to write to the Windows copy & paste buffer. So, try this:

 

  • Load block 20 (the BLK>FILE program)
  • type 10 20 BLK.FILE CLIP
  • Open notepad or notepad++
  • Right click in the notepad document and select PASTE
  • Voila.
  • Thanks 1
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...