6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 10:35 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Thu Dec 29, 2022 11:28 pm 
Offline

Joined: Thu May 13, 2021 12:53 pm
Posts: 16
Location: Fargo, North Dakota
Happy Holidays everyone!

I am looking for information on how to have FORTH start execution with a certain word.
This would be to have a user application start up automatically.

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 30, 2022 3:09 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
In QUIT, replace ?INTERPRET with the name of your application.  Pretty simple.  I have both, and then just comment-out the line I don't want at the time, meaning I comment-out the name of the application when I'm developing, or comment-out ?INTERPRET for the production model.  QUIT is called by ABORT, and ABORT is called by COLD.  I'm sure there are several ways to do it, but this is the way I've done it.

_________________
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 Dec 30, 2022 2:55 pm 
Offline

Joined: Thu May 13, 2021 12:53 pm
Posts: 16
Location: Fargo, North Dakota
Thanks for the tip Garth, I'll give that a try.


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 31, 2022 5:56 am 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
Maybe instead of putting the name of your application in QUIT, make QUIT do a RUN instead, which always runs the last word defined in the dictionary. This just has the benefit of not having to give a name to the Application.


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 31, 2022 8:46 pm 
Offline

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

This is the end of the high level portion of my Forth's cold start routine.
Code:
   INITIAL QUIT -;

INITIAL is a deferred word which is set to execute NOOP , a no-op.
If I want a version of my Forth to run extra initialization (or an application), I set INITIAL to the word to execute and save the system as a new Forth.
If I had a word, BACKGROUND for example, to switch on multitasking and initialize some background tasks.
Code:
' BACKGROUND IS INITIAL
FSAVE MULTIFORTH

When MULTIFORTH is loaded, multitasking will be switched on (it's off by default) and certain background tasks initialized. BACKGROUND will exit back to the coldstart routine which then executes QUIT .


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 01, 2023 1:31 am 
Offline

Joined: Thu May 13, 2021 12:53 pm
Posts: 16
Location: Fargo, North Dakota
More great ideas, thanks!

I tried modifying QUIT, but QUERY is called before QUIT in INTERPRET, so it ended up waiting for a CR before my WORD would run.
I ended up modifying QUERY. It checks an AUTOSTART flag and runs either the normal QUERY or my WORD.
Seems to do what I was looking for at this point.

**** Happy New Year ****


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 03, 2023 1:11 am 
Offline

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

What Forth are you using?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 11, 2023 6:27 pm 
Offline

Joined: Thu May 13, 2021 12:53 pm
Posts: 16
Location: Fargo, North Dakota
Fig-FORTH, translated from the FIG model by W.F. Ragsdale.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 11, 2023 8:52 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
Rooster wrote:
Fig-FORTH, translated from the FIG model by W.F. Ragsdale.

This didn't sound quite right, so I went on a search.  See https://www.forth.com/resources/forth-p ... rest_Group . Ragsdale got Army Maj. Robert Selzer to port a version of microForth to the 6502.It goes on to say,

    Selzer and Ragsdale subsequently made substantial modifications and improvements to the model, including exploitation of page zero and stack-implicit addressing architectural features in the 6502.  Many of the enhancements that characterized the later public-domain versions were made during this period, including variable-length name fields and modifications to the dictionary linked-list threading.  A metacompiler on the Jolt could target a significantly changed kernel to a higher address in memory.  A replacement bootable image would then be recompiled by the new kernel into the lower boot address, which could then be written out to disk.  At this point, Ragsdale had a system with which to meet his professional needs for embedded security systems.

    During this period the Forth Interest Group (FIG) was started by Ragsdale, Kim Harris, John James, David Boulton, Dave Bengel, Tom Olsen and Dave Wyland [FIG 1978].  They introduced the concept of a “FIG Forth Model,” a publicly available Forth system that could be implemented on popular computer architectures.

    The FIG Forth Model was derived from Ragsdale’s 6502 system.

_________________
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: Thu Jan 12, 2023 6:20 pm 
Offline

Joined: Thu May 13, 2021 12:53 pm
Posts: 16
Location: Fargo, North Dakota
Yes, looks like I worded it incorrectly. This is in the source file I used:

Code:
                Through the courtesy of
//
//                         FORTH INTEREST GROUP
//                            P.O. BOX  2154
//                         OAKLAND, CALIFORNIA
//                                94621
//
//
//                             Release 1.k0010
//
//                        with compiler security
//                                  and
//                        variable length names
//
//    Further distribution need not include this notice.
//    The FIG installation Manual is required as it contains
//    the model of FORTH and glossary of the system.
//    Might be available from FIG at the above address for $95.00 postpaid.
//
//    Translated from the FIG model by W.F. Ragsdale with input-
//    output given for the Rockwell System-65. Transportation to
//    other systems requires only the alteration of :
//                 XEMIT, XKEY, XQTER, XCR, AND RSLW


Sorry for the confusion.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 15, 2023 6:32 pm 
Offline

Joined: Wed Jan 01, 2003 6:32 pm
Posts: 32
I use FIG-FORTH 1.1 and following Garth's lead implemented in my FORTH core an AUTOEXEC word

Code:
: autoexec -find drop drop cfa
  ' QUIT cfa 0E + ! save-system ;


Usage: AUTOEXEC word filename.com
where: word is the FORTH word to be called on startup and
filename.com ist the complete Forth system - Kernel + application as a standalone application

Makes my life easier

Dietrich

_________________
My system: Elektor Junior Computer, GitHub https://github.com/Dietrich-L


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 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: