GDMike Posted July 26 Author Share Posted July 26 I guess if I'm at my ends here I can start pulling out the turbo Pascal... Quote Link to comment Share on other sites More sharing options...
+TheBF Posted July 26 Share Posted July 26 Ok so if you want to be a real nerd... Here is a line editor that lets you enter text into a block. You can change text in a block, only replace it with the 'P' command. ( line editor 1st block ) DECIMAL : LINE ( n -- ) C/L * SCR @ BLOCK + ; : ROW ( l# -- l#') DUP LINE C/L -TRAILING TYPE 1+ ; : .LINE ( l# -- l#') DUP 2 .R ." | " ROW CR ; : 4LINES ( l# -- l#') .LINE .LINE .LINE .LINE ; : 16LINES ( -- ) 0 4LINES 4LINES 4LINES 4LINES DROP ; : LIST ( n -- ) SCR ! PAGE 0 0 AT ." SCR# " SCR ? CR 16LINES ; : L SCR @ LIST ; : >> ( -- ) 1 SCR +! L ; : << ( -- ) SCR @ 1- 0 MAX L ; : P ( l# -- ) 1 PARSE ROT LINE SWAP MOVE UPDATE L ; You type all this in at the console and you have a dead simple editor. make a new block file LINEDIT.BLK OPEN LINEDIT.BLK 1 LIST Then you type it all over again using the P command like this: 0 P ( line editor 1st block ) 1 P DECIMAL 2 P : LINE ( n -- ) C/L * SCR @ BLOCK + ; and so on. Then type FLUSH to write the block to disk. Congrats! you have save your editor in a file. Then on block 2 add these lines using the P command ( line editor 2nd block ) : DL ( l# -- ) LINE C/L BLANK UPDATE L ; : (CP) ( L1 L2 -- ) LINE SWAP LINE SWAP C/L MOVE ; : CP ( L1 L2 -- ) (CP) UPDATE L ; : EB ( blk --) BLOCK B/BUF BLANK UPDATE ; : MV ( L1 L2 -- ) OVER >R (CP) R> DL ; : UNDO ( -- ) EMPTY-BUFFERS L ; and flush. 2 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted July 26 Share Posted July 26 (edited) Oh here are the instructions \ Line editor commands \ LIST ( scr# -- ) list scr# and set SCR variable \ L ( -- ) Re-list currect block \ >> ( -- ) List next block \ << ( -- ) List previous block \ P ( l# -- <text>) Put <text> into line# ( 5 P This goes to line 5 ) \ DL ( l# -- ) Delete line# \ CP ( l1 l2 -- ) Copy line1 to line2 \ M ( l1 l2 -- ) Move line1 to line2. erase line1 \ EB ( blk# -- ) erase block Edited July 26 by TheBF RO command not applicable to F83 2 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted July 26 Share Posted July 26 6 minutes ago, GDMike said: I guess if I'm at my ends here I can start pulling out the turbo Pascal... If you can make a copy of the disk your could try regenerating the system like this: See the title regenerating f83 F83/README.MD at master · uho/F83 · GitHub Quote Link to comment Share on other sites More sharing options...
+TheBF Posted July 26 Share Posted July 26 The example is for 68000 Your command would be A:> F83 META86.BLK 1 LOAD 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 26 Author Share Posted July 26 7 minutes ago, TheBF said: If you can make a copy of the disk your could try regenerating the system like this: See the title regenerating f83 F83/README.MD at master · uho/F83 · GitHub I did this and it got to line 65 out of the 90 something and ends up locked with an error 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 26 Author Share Posted July 26 15 minutes ago, TheBF said: Ok so if you want to be a real nerd... Here is a line editor that lets you enter text into a block. You can change text in a block, only replace it with the 'P' command. ( line editor 1st block ) DECIMAL : LINE ( n -- ) C/L * SCR @ BLOCK + ; : ROW ( l# -- l#') DUP LINE C/L -TRAILING TYPE 1+ ; : .LINE ( l# -- l#') DUP 2 .R ." | " ROW CR ; : 4LINES ( l# -- l#') .LINE .LINE .LINE .LINE ; : 16LINES ( -- ) 0 4LINES 4LINES 4LINES 4LINES DROP ; : LIST ( n -- ) SCR ! PAGE 0 0 AT ." SCR# " SCR ? CR 16LINES ; : L SCR @ LIST ; : >> ( -- ) 1 SCR +! L ; : << ( -- ) SCR @ 1- 0 MAX L ; : P ( l# -- ) 1 PARSE ROT LINE SWAP MOVE UPDATE L ; You type all this in at the console and you have a dead simple editor. make a new block file LINEDIT.BLK OPEN LINEDIT.BLK 1 LIST Then you type it all over again using the P command like this: 0 P ( line editor 1st block ) 1 P DECIMAL 2 P : LINE ( n -- ) C/L * SCR @ BLOCK + ; and so on. Then type FLUSH to write the block to disk. Congrats! you have save your editor in a file. Then on block 2 add these lines using the P command ( line editor 2nd block ) : DL ( l# -- ) LINE C/L BLANK UPDATE L ; : (CP) ( L1 L2 -- ) LINE SWAP LINE SWAP C/L MOVE ; : CP ( L1 L2 -- ) (CP) UPDATE L ; : EB ( blk --) BLOCK B/BUF BLANK UPDATE ; : MV ( L1 L2 -- ) OVER >R (CP) R> DL ; : UNDO ( -- ) EMPTY-BUFFERS L ; and flush. Of course I'm going to try this.. 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 26 Author Share Posted July 26 (edited) I typed in the first part I opened my file I created called editor.blk instead of line edit And I did 1 list And the photo shows where it scrolled the screen after 1 list I think somewhere around 8 or 10 lines , and then I received an error I know I got the typo when I type swap in this photo but this is the second time that I've locked up with this error.. I think it's happening when it hits the word "AT" Edited July 26 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 26 Author Share Posted July 26 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 26 Author Share Posted July 26 I omitted the 0 0 AT Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 26 Author Share Posted July 26 (edited) Should It scroll each time I press enter? Yes I am thrilled!! Yes I corrected my word because I didn't have a separator between the colon and the word to be defined. But that was easy enough for me... Thank you!!! I have an Editor... Maybe now I can remove that get-id Or just keep this one.. I just don't like the it keeps scrolling when you enter a line... Id rather it scroll 2 lines then present the screen. Maybe I can fool around with it and make it do that I need to take out the page word. VID_20240726_163228370.mp4 Edited July 26 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 27 Author Share Posted July 27 (edited) all in all.. The word "AT" needs to be redefined. I noticed in the editor they mentioned IBM a couple of times. Maybe there trying to distinguish between modes. I'll research that a little further.. In the meantime I dressed up my editor a little bit It doesn't scroll like we had it. Removed page and added two cr's, carriage returns prior to reprinting the screen. And I added a help menu on exit of the load routine. Trust me I'll need it.. Thank you again Brian this is great It really helps me. Edited July 27 by GDMike 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted July 27 Share Posted July 27 Way to go. I just got back from my daughters place. It's a humble thing, but you can put stuff in blocks and load it. This is real old school Forth. It's great education to see how you can do this stuff will simple words. BTW notice that LIST does not have a loop. It's all unrolled as words. I stole that from a guy named Sam Falvo. 2 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted July 27 Share Posted July 27 4 hours ago, GDMike said: Should It scroll each time I press enter? Yes I am thrilled!! Yes I corrected my word because I didn't have a separator between the colon and the word to be defined. But that was easy enough for me... Thank you!!! I have an Editor... Maybe now I can remove that get-id Or just keep this one.. I just don't like the it keeps scrolling when you enter a line... Id rather it scroll 2 lines then present the screen. Maybe I can fool around with it and make it do that I need to take out the page word. VID_20240726_163228370.mp4 48.63 MB · 0 downloads So without using PAGE and 0 0 AT it is slow, but that's what it should do. With AT the screen writes in 1/2 a second after you "put" a line into the block. We need to make you an AT word that works. I think we can do it with some system variables. I will see what I can find. 1 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted July 27 Share Posted July 27 4 hours ago, GDMike said: That's the same one I found. it's weird code. I think we can make one that works with #LINE and OUT. 2 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 27 Author Share Posted July 27 Instead of at can you just make it gotoxy? 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 27 Author Share Posted July 27 (edited) I stumbled across this https://wiki.forth-ev.de/doku.php/projects:sample1.blk Screen 1 not modified 0 \ Load screen for HELP system 12:54JWB04/09/87 1 2 ONLY FORTH DEFINITIONS 3 4 \ These words require DEVICE=ANSI.SYS to be in you CONFIG.SYS 5 \ file and the the ANSI.SYS driver to be on your boot disk. 6 7 : ESC[ 27 EMIT ASCII [ EMIT ; 8 : CLS ESC[ ." 2J" ; 9 : BRIGHT ESC[ ." 1m" ; 10 : NORMAL ESC[ ." 0m" ; 11 : BLUE ESC[ ." 44m" ; 12 13 FROM HELP.BLK 1 LOAD ( loads the HELP system ) 14 15 Edited July 27 by GDMike 2 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted July 27 Share Posted July 27 9 hours ago, GDMike said: I stumbled across this https://wiki.forth-ev.de/doku.php/projects:sample1.blk Screen 1 not modified 0 \ Load screen for HELP system 12:54JWB04/09/87 1 2 ONLY FORTH DEFINITIONS 3 4 \ These words require DEVICE=ANSI.SYS to be in you CONFIG.SYS 5 \ file and the the ANSI.SYS driver to be on your boot disk. 6 7 : ESC[ 27 EMIT ASCII [ EMIT ; 8 : CLS ESC[ ." 2J" ; 9 : BRIGHT ESC[ ." 1m" ; 10 : NORMAL ESC[ ." 0m" ; 11 : BLUE ESC[ ." 44m" ; 12 13 FROM HELP.BLK 1 LOAD ( loads the HELP system ) 14 15 Cool. now you know the basis of controlling an ANSI computer terminal. Here is a full list of control codes including more colour codes. https://gist.github.com/ConnerWill/d4b6c776b509add763e17f9f113fd25b 2 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted July 27 Share Posted July 27 Do those colors work on your terminal? If so then you have the ANSI.SYS loaded in the computer. This might work using the terminal codes : GOTOXY ( x y --) SWAP ESC[ 1- . ." ;" 1- . ASCII H EMIT ; 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 27 Author Share Posted July 27 (edited) I'll be trying a few things after breakfast here in awhile. I've got to configure a config.sys,easy nuff.. Man, I sure hope Gotoxy works.. can't wait.thx Edited July 27 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 27 Author Share Posted July 27 (edited) 2 hours ago, TheBF said: Do those colors work on your terminal? If so then you have the ANSI.SYS loaded in the computer. This might work using the terminal codes : GOTOXY ( x y --) SWAP ESC[ 1- . ." ;" 1- . ASCII H EMIT ; ESC[ is not defined And ansi sys is not in this version of Dos. So I defined it as : ESC[ 27 emit ASCII [ EMIT ; And it didn't work as expected.. Just left a number on stack, this was one of the positions, and a letter H Edited July 27 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 27 Author Share Posted July 27 (edited) I found a predefined word in f-83 I can make something kinda outta backspace and the word spaces?? VID_20240727_165047162.mp4 Edited July 27 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 29 Author Share Posted July 29 Duh.... this makes sense.. Well I like using the BS or backspace word to solve my problem about moving around the screen but as long as I have a determined number to move to I'm okay with that. But I didn't like the word okay being presented at the end of the line, as the CR routine leaves the ok.. Which makes things kind of clumsy. I was looking for a way to make a clean backspace.. So I've been reading article after article on what I can find and I did find this which led me to the duh I never thought about 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted July 30 Share Posted July 30 On 7/27/2024 at 5:49 PM, GDMike said: I found a predefined word in f-83 I can make something kinda outta backspace and the word spaces?? VID_20240727_165047162.mp4 Not sure if you know this. You should not use (?DO) and (LOOP) in you own definitions. The brackets are "shorthand" for this word is for internal use only. The de-compiler shows them because (?DO) and (LOOP) are what is compiled when you use ?DO and LOOP in a definition. 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 30 Author Share Posted July 30 6 hours ago, TheBF said: Not sure if you know this. You should not use (?DO) and (LOOP) in you own definitions. The brackets are "shorthand" for this word is for internal use only. The de-compiler shows them because (?DO) and (LOOP) are what is compiled when you use ?DO and LOOP in a definition. Yes I saw that when I did the "see do" But realized later the "do loop leave" is proper. But neither resolved my issue of removing the"ok" when this particular loop is completed. I do notice a CR is happening but I couldn't find out where it was in a definition for the backspace. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.