6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 5:16 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Crazy LISTings
PostPosted: Wed Mar 03, 2021 6:58 pm 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
Q. How many different ways does one need to LIST the dictionary anyways?
A. As many as needed.

List - displays screen of a given number
DList - lists all files from HERE to FENCE
$List - lists all files from FENCE down to beginning that are part of the Forth system
BList - lists words Beginning with a letter
AList - list words Alphabetically
Wlist - list any words that contain a certain word (Wildcard)
PList - list all words that are primitives
IList - list all immediate words
VList - list all variables
CLIst - list all constants
UList - list all User variables
SList - list all words with Smudge bit on
FList - List words that follow the FIG standard
83List - List words that follow 83 standard
AnsList - List words that follow Ansi standard

Criminy! Memory can be filled with words that just LIST words in the dictionary. Any more LIST's anyone want to add?


Top
 Profile  
Reply with quote  
 Post subject: Re: Crazy LISTings
PostPosted: Wed Mar 03, 2021 7:33 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
Wow, where did you find that list? I looked in my printout of the ANS standard, and none of them are there. How about just a single word that takes a parameter on the stack to tell which list you want, and ending with a message and no action (but no abort) if the parameter is not one of the things the word can do?

_________________
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  
 Post subject: Re: Crazy LISTings
PostPosted: Wed Mar 03, 2021 7:51 pm 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
Didn't find them. I made them. All are done except the last three, and they are not done yet due to not yet finished compiling the differences between the three standards. And don't really know how to differentiate words supported by each standard yet. May add a .8 or .A suffix to those words.

I did them up as a learning exercise, and quickly realized if they were available from the start, I could have picked up on Forth a lot quicker. Experienced Forth programmers probably won't need them, but they are really good for learning Forth. I will post the word descriptions shortly if anyone wants them.


Top
 Profile  
Reply with quote  
 Post subject: Re: Crazy LISTings
PostPosted: Thu Mar 04, 2021 6:09 am 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
Here are a few of the easier definitions.

( all values are in hex )
: nxtwrd pfa lfa @ dup 0= ;
: prntwrd dup count 1F and type ." " ;
: (BAL) dup 5F > if 5F and then latest begin over over 1+ c@ = if prntwrd then nxtwrd until drop drop ;
: BList ( c -- ) bl word here 1+ c@ (BAL) cr ; ( Byte - single letter )
: AList 60 20 do I (BAL) loop cr ; ( alphabetical ) ( single letter words are not listed due to their hi-bit being set)

: IList latest begin dup c@ 40 and if prntwrd then nxtwrd until drop cr ; ( immediates )
: PList latest begin dup pfa dup 2- @ = if prntwrd then nxtwrd until drop cr ; ( primitives )

: (VCU) latest begin over over pfa 2- @ = if prntwrd then nxtwrd until drop drop cr ;
: VList ' use @ (VCU) ; ( variables )
: CList ' bl @ (VCU) ; ( constants )
: UList ' dp @ (VCU) ; ( user variables )


Top
 Profile  
Reply with quote  
 Post subject: Re: Crazy LISTings
PostPosted: Sat Mar 06, 2021 12:40 am 
Offline

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

Back when I wrote my metacompiler, I wrote a word called SMUDGE-TEST similar to your SLIST . It lists words in the context vocabulary with the smudge bit set and is one of the tests run when the metacompiler finishes.


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

All times are UTC


Who is online

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