6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 12:22 am

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Wed Nov 24, 2021 5:04 am 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
I actually enjoy using screens more and more all the time.
Setting up a file structure is easier than I thought it would be.
With 16384 screens available per virtual file on a hard drive gives lots of room to be creative.

My first screen is set up as a directory and looks something like this:

SCRN #1
: MAIN 1 LIST ;
: GRAPHICS C00 LIST ;
: GAMES D00 LIST ;
: APPLICATIONS A00 LIST ;
: OSCMDS B00 LIST ;
: HELP E00 LIST ;
: QUICKREFCARDS F00 INDEX ;
: EDITOR 18 1F THRU ;


The go-to screens list the file names and the screens to load.

SCRN #C00
( GRAPHICS )
: TURTLEGR C01 C08 THRU ;
: KALEIDOSCOPE C09 C0B THRU ;
: PICTURES C10 INDEX ;

SCRN #D00
( GAMES )
: CHECKERS C01 C09 THRU ;
: CHESS C10 C30 THRU ;
: OTHELLO C40 C50 THRU ;
etc ...


SCRN #A00
( APPLICATIONS )
: ASSEMBLER A01 A0F THRU ;
: FILE2DISK A10 A1F THRU ;
: WORDPROC A20 A40 THRU ;
etc …


SCRN #B00
( OPERATING SYSTEM COMMANDS )
: TLOAD
: TTYPE
: BLOAD
: BSAVE
: BLK2TFILE
etc …


And the list goes on.


Last edited by IamRob on Wed Nov 24, 2021 11:30 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 24, 2021 5:51 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
Have you experimented with, or given any more thought to, the idea of screens or blocks being bigger, as we talked about in your topic at viewtopic.php?f=9&t=6503 ?

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 24, 2021 12:29 pm 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
I did. The biggest drawback is the screen would have to scroll left to view the rest of the line if set at 128 characters, or scroll up if more lines are allowed. There are a couple of text editors out there that do that, and I have to say, that annoys the heck out of me. I probably wouldn't use the screens method on any computer other than an 8-bit machine. Larger machines tend to have more screen real-estate and would greatly benefit from having multiple text files open instead.

And the 64 character limit is not actually a limit that has to be enforced. Each line is only viewed with the 64 character limit as a guideline to give the total of 1024 characters but is only for viewing purposes. It is the best fit for a screen that can only view 80 columns by 24 lines. All 16 lines are actually contiguous in memory, and code can overlap the end of the 64 character limit from one line to the next line and still compile properly.

The only real thing a person has to watch is if using the 64 character limit as a stopping point, that if the last character of a word is in the 64th position, then the first position of the next line must be a space. Words can be split across the end of one line and onto the next (without a space at the beginning of the next line) and still be recognized as a complete word.

Defining words in a horizontal fashion instead of a vertical one (with a comment after each word) can save a lot of space. Once a person gains more experience and really begins to understand Forth, then it becomes beneficial to remove all the clutter and focus on efficiency and compaction. A comment at the beginning of a word definition is all that is needed to understand what the word does. There are a few complex words that benefit from having a comment after each word, to help a person follow along to see what the definition does. But I believe that is why it is recommended to keep each definition as short as possible and give each word a very simple task.

I created a slightly better version of the LIST definition that shows where each line would end and the next one begins. And as you can see, some lines extend onto the next line, but for readability I try not to break any words at the end of a line.


Attachments:
Forth Screen Shot.png
Forth Screen Shot.png [ 86.02 KiB | Viewed 7051 times ]
Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 26, 2021 1:46 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
IamRob wrote:
I did. The biggest drawback is the screen would have to scroll left to view the rest of the line if set at 128 characters, or scroll up if more lines are allowed.

Yes; the left-right scrolling is a pain. Up/down scrolling is a necessity (except in an extremely short program), whether it goes a line at a time or a screen at a time, and is not nearly as painful as left-right scrolling, since you can read many entire lines at a time without any vertical scrolling. My DOS machine's motherboard recently went out, where I had the plug-in video board which gave me 132 columns. I got another DOS PC up and running (with the needed RS-232 and LPT ports) for the project I'm working on, but it lacks the ISA bus slots for the hi-res video card and my EPROM programmer. It's a pain to have only 80 columns again. Someone gave me another computer with ISA slots, and I'll move the disc drives over soon. Hopefully it works.

Quote:
Larger machines tend to have more screen real-estate and would greatly benefit from having multiple text files open instead.

I've had dozens open at once in my DOS-based MultiEdit editor, tiled and windowed different ways. It sure is nice; but I would like to eventually have my home-made computer to be independent of a commercially made PC; hence my interest in your file structure and screens.

Quote:
And the 64-character limit is not actually a limit that has to be enforced. Each line is only viewed with the 64-character limit as a guideline to give the total of 1024 characters but is only for viewing purposes. It is the best fit for a screen that can only view 80 columns by 24 lines.

After I wrote what I did, I realized there would be a compatibility problem with the \ for commenting-out the rest of the line, as that might make it ignore the next line too. You'd have to use ( and ) for comments, taking another character space. At least it doesn't take any more memory or storage with the screen method though, since the spaces at the end of the line take memory regardless.

Quote:
All 16 lines are actually contiguous in memory, and code can overlap the end of the 64-character limit from one line to the next line and still compile properly.

That part definitely has a value when you need to have string literals that might be too long to fit on a single 64-character line. I'm working on something now that has a few long ones like that.

Quote:
The only real thing a person has to watch is if using the 64-character limit as a stopping point, that if the last character of a word is in the 64th position, then the first position of the next line must be a space. Words can be split across the end of one line and onto the next (without a space at the beginning of the next line) and still be recognized as a complete word.

I once saw a contest where the point was to get the source code for the most full-featured Forth editor possible in a single screen. Results were impressive, but quite unreadable, with as much packed into each line as possible, no gaps, meaning that very few of the words started at the beginning of a line, etc., and of course no comments. But again, the fact that it could be done at all in a single 1K screen was impressive.

Quote:
Defining words in a horizontal fashion instead of a vertical one (with a comment after each word) can save a lot of space. Once a person gains more experience and really begins to understand Forth, then it becomes beneficial to remove all the clutter and focus on efficiency and compaction. A comment at the beginning of a word definition is all that is needed to understand what the word does. There are a few complex words that benefit from having a comment after each word, to help a person follow along to see what the definition does. But I believe that is why it is recommended to keep each definition as short as possible and give each word a very simple task.

These are from my 6502 primer:

    Comment your programs profusely. Explain what you're doing. Even after a routine appears to be working, adding more explanation in the comments sometimes makes you catch bugs that had not shown up yet but later would have. I comment as if trying to explain it to someone else who hasn't been following my train of though on it. If I come back to change it a year or more later, I'll need the comments anyway.

and

    Comment, comment, comment!! "Self-documenting code" does not mean you don't have to comment. It just helps. Even if the code is very clear about what it's doing, it does not tell why you chose to do it that way. The comments are not optional. There have been times that I looked at something and thought, "Wow, there's a better way to do that!" and then after wasting a lot of time on it, came full circle because I re-discovered why it had to be done the way it was and not the way I thought was better. Comments would have saved the time. I mentioned liking the DOS/ANSI [Edit: that should say IBM437] character set earlier. It's great for drawing smooth diagrams to illustrate your keypad's key numbers, a data structure in memory, etc. in your source code.

In a situation yesterday, I added comments about a feature in the interfacing hardware being the reason I did something in the code the way I did. Other times, I've added comments at each line line of code regarding details in data structures being manipulated, data-structure details that could be hard to keep track of mentally. These are examples of comments being for something other than to tell what the code is doing.

An hour-long video about the Oberon language has a couple of quotes I really liked (at around 36 minutes into in, give or take):
  • Programs must not be regarded as code for computers, but as literature for humans.
  • Reducing size and complexity is the triumph.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 26, 2021 5:09 am 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
Quote:
And the 64-character limit is not actually a limit that has to be enforced. Each line is only viewed with the 64-character limit as a guideline to give the total of 1024 characters but is only for viewing purposes. It is the best fit for a screen that can only view 80 columns by 24 lines.


Quote:
After I wrote what I did, I realized there would be a compatibility problem with the \ for commenting-out the rest of the line, as that might make it ignore the next line too. You'd have to use ( and ) for comments, taking another character space. At least it doesn't take any more memory or storage with the screen method though, since the spaces at the end of the line take memory regardless.


There should be no compatibility issue if \ is defined correctly using the C/L definition as it still should only skip comments up to the end of the current line since the line length is defined by C/L. I take it to mean there are no word definitions after the \ on the current line.

If comments carry over to the next line, then that line too should begin with a \. I guess that is one good reason to see where one line ends and the next one begins.

Another idea I started programming into some of my words is to, check for the RETURN char. Although I don't, as of yet, insert any RETURN characters in my screens, I am playing with the idea of viewing more lines, but still use the 1 kb screen block, to save space at the end of some word definitions, so it doesn't go to waste.

The \ definition could also do this. Check what comes first. The end of a line or a RETURN character.


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 28, 2021 9:29 pm 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895
GARTHWILSON wrote:
Have you experimented with, or given any more thought to, the idea of screens or blocks being bigger, as we talked about in your topic at viewtopic.php?f=9&t=6503 ?


As I've mentioned before, If someone wishes to have bigger screens (4k perhaps), it would be best to not alter the underlying block/buffer system. Let the editor treat each block as eight lines of 128 columns. The editor could group 4 blocks together for a quadruple sized screen.
If the underlying blocks are 1k then the buffers are also 1k. If the underlying blocks are 4k then the buffers are 4k as well. When editing a quadruple sized screen, all four of the blocks used may not need updated, maybe just one. I have found that when I change something in a screen, sometimes it doesn't affect the source in the following screens but a few scattered screens further down. Those are the times when I find having four block buffers available is really handy, especially given the lack of speed of some of the Commodore disk drives. With really fast access to storage, such as I have when using the C64 REU (ram expansion unit) for temporary block storage, one buffer may be sufficient. Even so, with a larger underlying block size, larger buffers are needed, resulting in fewer buffers available or less free RAM available.
Even if the storage speed is fast enough that one block buffer is sufficient, with 4k blocks an extra 3k is needed for the buffer. Modifying the editor to use 4 blocks per screen would surely use less memory.


Top
 Profile  
Reply with quote  
PostPosted: Sun Nov 28, 2021 10:44 pm 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895
IamRob wrote:
There should be no compatibility issue if \ is defined correctly using the C/L definition as it still should only skip comments up to the end of the current line since the line length is defined by C/L. I take it to mean there are no word definitions after the \ on the current line.


The Commodore 64 does not have a backslash '\' key so I use '//' for comments. This is the same thing Blazin' Forth did. Here is the source for Fleet Forth's //
Code:
: //  ( -- )
   'STREAM  BLK @
   IF  C/L MOD  THEN
   NIP >IN +! ; IMMEDIATE

'STREAM ( address of stream) returns the address of the current position in the text stream and how much of it remains.
The BLK test means that if // is used in a screen, it will skip the rest of the line. If used anywhere else, such as the text input buffer or an evaluated string, it will skip the rest of the string. This is handy since I added the ability to INCLUDE C64 sequential files (Commodore's version of text files).

Quote:
If comments carry over to the next line, then that line too should begin with a \. I guess that is one good reason to see where one line ends and the next one begins.


Depending on your editor, it should be possible to define a word COMMENT: for multi line comments. It would use some words from the editor but be defined in the Forth vocabulary so it is available.
I think I'll define this when I get home to test it's feasibility.
The general idea is to place the string ';COMMENT' in the editors find buffer and use SEEK , a component of F , the editor find word, to seek to that point. It would then copy the editors edit pointer R# to >IN
It should work like this:
Code:
0: // TEST OF COMMENT:
1: : SOMEWORD
2:    <SOME FORTH STUFF>  COMMENT:  THIS IS THE START OF A MULTI-LINE COMMENT
3: AND IT CONTINUES TO THIS LINE
4: AND THIS ONE
5: AND EVEN THIS ONE ;COMMENT
6:    <REST OF DEFINITION> ;
7:

Of course, the commenting really should be formatted better. This is just to show that COMMENT: wouldn't care about being on a certain line or where it found the string ';COMMENT'.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 30, 2021 6:18 am 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
JimBoyd wrote:
I think I'll define this when I get home to test it's feasibility.
The general idea is to place the string ';COMMENT' in the editors find buffer and use SEEK , a component of F , the editor find word, to seek to that point. It would then copy the editors edit pointer R# to >IN
It should work like this:
Code:
0: // TEST OF COMMENT:
1: : SOMEWORD
2:    <SOME FORTH STUFF>  COMMENT:  THIS IS THE START OF A MULTI-LINE COMMENT
3: AND IT CONTINUES TO THIS LINE
4: AND THIS ONE
5: AND EVEN THIS ONE ;COMMENT
6:    <REST OF DEFINITION> ;
7:

Of course, the commenting really should be formatted better. This is just to show that COMMENT: wouldn't care about being on a certain line or where it found the string ';COMMENT'.


I don't know if that would work, as how would the interpreter know if ;COMMENT itself is not part of the comment, since commented words are skipped over and not interpreted.

How about this instead. The same as the parenthesis works, the interpreter searches for the ending parenthesis to signal the end of a comment, one can use the backslash or dbl-forward-slash to signify the end of the comment as well. But there would be no need to use an ending back-slash as that is the same as using the parenthesis.

Some computers have the ability to use the backslash character, so a backslash can signify to ignore all text to the end of the line and a dbl-forward-slash can signify to ignore all comments until another dbl-forward-slash is encountered, even across multiple lines.


Top
 Profile  
Reply with quote  
PostPosted: Thu Dec 02, 2021 12:32 am 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895
JimBoyd wrote:

The general idea is to place the string ';COMMENT' in the editors find buffer and use SEEK , a component of F , the editor find word, to seek to that point. It would then copy the editors edit pointer R# to >IN
It should work like this:
Code:
0: // TEST OF COMMENT:
1: : SOMEWORD
2:    <SOME FORTH STUFF>  COMMENT:  THIS IS THE START OF A MULTI-LINE COMMENT
3: AND IT CONTINUES TO THIS LINE
4: AND THIS ONE
5: AND EVEN THIS ONE ;COMMENT
6:    <REST OF DEFINITION> ;
7:




I had not given this further thought as something had come up. I was just fleshing out an idea here.
Using SEEK from the editor vocabulary is not the best way to go. Using MATCH is the way to go. MATCH takes the address and length of a string, the main string, and the address and length of a sub-string to find in the main string. The non-standard word 'STREAM , address of stream, will provide the main string. This word returns the address of the current position in the text stream and the length of the stream remaining. It can be defined in Ans Forth like this:
Code:
: 'STREAM  ( ADR CNT -- )
   SOURCE >IN @ /STRING ;

Here is the definition for COMMENT:
Code:
: COMMENT:  ( -- )
   'STREAM " ;COMMENT" COUNT MATCH
   0= ABORT" NO ;COMMENT"
   >IN +! ; IMMEDIATE

and what it compiles to:
Code:
SEE COMMENT:
COMMENT: IMMEDIATE
 31486  6915 'STREAM
 31488  6746 (") ;COMMENT
 31499  5139 COUNT
 31501 13960 MATCH
 31503  4348 0=
 31505  7734 (ABORT") NO ;COMMENT
 31519  2113 >IN
 31521  4859 +!
 31523  2930 EXIT
39
 OK

The word " , when compiling, will compile the word (") and an inline counted string. If the string ';COMMENT' is not found, COMMENT: aborts with an error message. If the string is found, the text position pointer, >IN is adjusted to point to the first character after the string.
Note that ';COMMENT' does not need to be defined. It is just a text string to be sought.
Here is an example of using COMMENT:
Code:
// TEST OF MULTI LINE COMMENTS
: POINTLESS
   CR .S
COMMENT:
   THIS DEFINITION IS, AS IT'S NAME
   INDICATES, QUITE POINTLESS.
   IT ONLY EXISTS TO DEMONSTRATE
   MULTI LINE COMMENTS.
;COMMENT
   CR .AS ;

and what POINTLESS compiles to:
Code:
SEE POINTLESS
POINTLESS
 31558  7024 CR
 31560 16278 .S
 31562  7024 CR
 31564 16349 .AS
 31566  2930 EXIT
10
 OK

I said that ';COMMENT' did not need to be defined. It can be defined as a no-op for convenience. Here is an example of a multi-line comment keeping a word from being defined.
Code:
SCR# 8473  2 281
0: // ANOTHER MULTI LINE COMMENT TEST
1: // COMMENT OUT THE FOLLOWING WORD
2: COMMENT:
3: CODE NUTATE  ( N1 N2 N3 -- N3 N2 N1 )
4:    0 ,X LDA  4 ,X LDY
5:    0 ,X STY  4 ,X STA
6:    1 ,X LDA  5 ,X LDY
7:    1 ,X STY  5 ,X STA
8:    NEXT JMP  END-CODE
9: ;COMMENT
A:
B:
C:
D:
E:
F:

Suppose I want to compile NUTATE and test it. Since I defined the word ;COMMENT as a no-op and Fleet Forth has LINELOAD , I can.
Code:
0 FH LOAD  OK
LATEST ID. POINTLESS OK
3 0 FH LINELOAD  OK
LATEST ID. NUTATE OK

3 0 FH LINELOAD begins loading the current screen at line 3. This skips over COMMENT: .

IamRob wrote:
I don't know if that would work, as how would the interpreter know if ;COMMENT itself is not part of the comment, since commented words are skipped over and not interpreted.


The string ';COMMENT' is not interpreted. The interpreter does not care because the interpreter takes no part in this except for finding and executing the immediate word COMMENT: . It is COMMENT: which searches for the string ';COMMENT' in the text stream and repositions the text stream pointer >IN . After COMMENT: executes, the interpreter resumes with the current position in the text stream pointing just past the string ';COMMENT' . Any string could have been used. I could have made the search string 'MANTICORE' in the definition of COMMENT: and that is the string it would have used for the end of a multi-line comment.

Quote:
How about this instead. The same as the parenthesis works, the interpreter searches for the ending parenthesis to signal the end of a comment, one can use the backslash or dbl-forward-slash to signify the end of the comment as well. But there would be no need to use an ending back-slash as that is the same as using the parenthesis.


In the Forth-83 standard, and possibly others, the words which parse the text stream take a single ASCII character as a delimiter. WORD usually takes a blank (ASCII code $20), the word " takes the ASCII character " , and the words ( and .( take the ASCII character ) for their delimiters.
If you are going to use more than one character for your delimiter, that still involves a string search.

Quote:
Some computers have the ability to use the backslash character, so a backslash can signify to ignore all text to the end of the line and a dbl-forward-slash can signify to ignore all comments until another dbl-forward-slash is encountered, even across multiple lines.


Some computers, but not all. My Fleet Forth for the Commodore 64 is not the only Forth for the Commodore 64 to use the double forward slash // for end of line comments. Scott Ballantyne's Blazin' Forth for the Commodore 64 released in 1985 also used the double forward slash for an end of line comment.
Since the double forward slash is used in some Forths as an alias for the backslash, how about using a different double character for multi-line comments, such as the double carat '^^'?
Having said that, I think that having the same token for the start of a multi-line comment as the end of a multi-line comment is problematic. They are not visually distinct. If there is only one multi-line comment in a screen, this would not be a problem. With the possibility of larger screens (32 lines? maybe more?) there is the possibility of more than one multi-line comment. If the same tokens were used for multi-line comments in source in plain old text files, the problem could be worse. There would be no block boundaries and the file size could be large enough that there may be several multi-line comments.


Top
 Profile  
Reply with quote  
PostPosted: Tue Dec 07, 2021 12:57 am 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895

I should mention two caveats with my definition for COMMENT: .
Although Fleet Forth is case insensitive, that only applies to the interpreter. String handling words, such as MATCH are case sensitive. The case used when the string ';COMMENT' is compiled into COMMENT: needs to be used when using ';COMMENT' to mark the end of a multi-line comment.
Fleet Forth's MATCH returns the flag on top of the offset. The version of MATCH from the fig-FORTH Installation Manual returns the offset on top.


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 8:46 am 
Offline

Joined: Wed Aug 21, 2019 6:10 pm
Posts: 217
One approach used for extensive comments are shadow blocks. A shadow screen is based on a set of blocks for source and an equal number for comments, so that a single offset value allows you to "flip" between the source and the shadow block. In the day, this would often be tied to a function key, where the block display function would have the offset built in and the function key would XOR the value of the offset with the stored value, so toggle between an offset of 0 and the shadow screen offset.

A useful word in that context is \\ which is "end of source in file" when interpreting a file, and and "end of source in block" when interpreting a block. Starting the index line of a shadow block with \\ rather than \ (or in a C64th, /// rather than //) ensures that the comments are never accidentally interpreted.

When I was working on the "no function key text file editor" BMW (Bruce McFarling's Writer), I would put the \\ at the start of a decorative line:

\\ // \\ // \\ // \\ // \\ // \\ // \\ // \\ //

... where everything but the first pair of character is just decoration, since the \\ ends interpretation of the file.

I very much like the 64 character wide block versus a 128 character or (to fit a C64 display) a 40 or 32 character wide block, and adopted 63 character plus a return key as the width of my text files, for easier porting of individual sets of words to blocks if need be. As far as the "problem" of losing useful space when indenting, I would indent by three spaces, which worked for me.

However, my C64 Forth back in the day used 40 wide blocks, and for 64 wide blocks, I would want a bitmapped text display with a 5 bit wide font.

However, I could see using a 32 character wide block in a context where of using a small enough LCD display for a target board that 32x8 is substantially easier to read than anything more ... to avoid left-write scrolling. If you use the bottom line for entering commands, scroll up at the second line except when at the top of the block, and down at the sixth line except when at the bottom of the block, it is reasonably easy to have a feel for where you are in the block, and the command prompt can be X> where "X" is the base 32 of the row number.


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 01, 2022 12:40 am 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895

My Forth for the Commodore 64, Fleet Forth, uses the traditional source screen formatting of 64 characters per line and 16 lines. This is mostly for compatibility with other Forths for the C64 which have source in screens.
As for shadow screens, With the 1541 drive I have 166 blocks available ( counting block zero). With a dual disk unit compatible with the 1541, I have 332 blocks available. With the 1571 drive in double sided mode, I also have 332 blocks available. If there is a dual disk unit compatible with the 1571, I would have 664 blocks available. Fleet Forth also has support for blocks in a 1581 drive with 799 blocks available. What should the offset for shadow screens be?
Each drive is allotted 4096 blocks because the different C64 drives have different capacities, so I could make the offset for shadow screens 4096 ( $1000) but then how would I copy blocks from one drive to another if one drive is for source screens and another is for shadow screens?
One more thing to consider is Fleet Forth has the capability to load source from screens in blocks with LOAD and friends; however, it also has the ability to load source from C64 sequential files ( C64 version of text files) with INCLUDE . I do not mean blocks in a source file. I mean plain free formatted source in a sequential file where each line is stored in the file with a terminating carriage return character.
I wrote // (double slash, Fleet Forth's name for \ (backslash)) so that when used in a screen it increments >IN to a the next higher multiple of 64; however, when interpreting from the text input buffer or evaluating a string it increments >IN to the end of the text stream. Since Fleet Forth loads a sequential file one line at a time, this allows // to skip to the end of a line.
Likewise, COMMENT: and ;COMMENT work equally well when loading screens or loading source from a sequential file.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 02, 2022 12:13 am 
Offline

Joined: Wed Aug 21, 2019 6:10 pm
Posts: 217
JimBoyd wrote:
[color=#000000] ...
As for shadow screens, With the 1541 drive I have 166 blocks available ( counting block zero). With a dual disk unit compatible with the 1541, I have 332 blocks available. With the 1571 drive in double sided mode, I also have 332 blocks available. If there is a dual disk unit compatible with the 1571, I would have 664 blocks available. Fleet Forth also has support for blocks in a 1581 drive with 799 blocks available. What should the offset for shadow screens be?


In that context, if I was using shadow screens, I would have a load screen that loads the offset into a variable. However, IIRC, shadow screens really became popular when hard drives and their "massive" 10MB or 20MB capacity came into use ... IOW, my guess is they tended to be from a slightly later vintage than the pure floppy disk based systems. I am not sure I would try them with anything smaller than a 1581 (or SD2IEC with 1581 images), so I'd go with an offset of 400.

Quote:
One more thing to consider is Fleet Forth has the capability to load source from screens in blocks with LOAD and friends; however, it also has the ability to load source from C64 sequential files ( C64 version of text files) with INCLUDE . I do not mean blocks in a source file. I mean plain free formatted source in a sequential file where each line is stored in the file with a terminating carriage return character. ...


Yes, that is also an objective of xForth ... indeed, until I got so busy with the new job, I was planning to tackle the INCLUDE system first.

But I do now intend to have // as a synonym of \ and /// as a synonym of \\


Top
 Profile  
Reply with quote  
PostPosted: Mon Jul 25, 2022 1:19 am 
Offline

Joined: Mon Jun 24, 2019 1:13 pm
Posts: 34
I've have been reading some of these posts and found some of the comments interesting as I had written a screen editor a couple of years ago that used the ANSI terminal. More recently however I enhanced it greatly to allow full ANSI key operation, highlighting, and multiple file tabs etc. At present this version operates with my Tachyon extensions including the filesystem running on top of Mecrisp on the RP2040 chip. I am using this editor to develop a full suite of dev tools to run on any Forth system that has maybe about 8k of RAM or more (the RP2040 has 264kB internally). Power to the Forth!

The editor has become more of an IDE since I can compile and run code and invoke the logic analyzer module etc. I still need to finish a multipass macroassembler which will produce a clean and flat listing and output file. While this is geared for the RP2040 I see no reason why I can't backport it to some of my older 65xx systems including the M37702 etc where I had lots of RAM.

BTW, rather than raw blocks, I handle a standard FAT32 file in pages of 32 lines of 128 characters and terminate each line with a CR. This makes the file compatible with PC text editors but makes it possible to edit the file in 4k pages although the page length can be adjusted up to 64 lines. The clipboard is in RAM but I may make it hybrid with a file to allow for systems to use less RAM. ^F10 will compile code from the clipboard or if empty then from the current page rather than F10 which compiles the whole file. A null terminator(s) marks the logical end of a file.

Normally I use VScode but I am loving the ease of use of this editor with intuitive controls. Plug my board in, type ED and it restores the last multi-tab session complete with cursor position and theme etc.


Attachments:
HELP.TXT [9.46 KiB]
Downloaded 62 times
FRED 2022-07-25 10-21-13.png
FRED 2022-07-25 10-21-13.png [ 194.86 KiB | Viewed 6469 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: