6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 11:51 am

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: The coolest words
PostPosted: Thu Aug 29, 2024 12:05 am 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895
In my humble opinion, another cool word is FH , from here, in Leo Brodie's "Thinking Forth."
Code:
: FH  \  ( offset -- offset-block )  "from here" 
   BLK @  ?DUP 0= IF  SCR @  THEN  + ;

When used in a block which is loading, FH will add the block number in BLK to the number on the data stack. This allows relative loading.
Here is an example from my system loader.
Code:
SCR# 2
// LOAD BLOCK
DECIMAL
CR .( DONE?      )         2 FH LOAD
CR .( THRU --> <-- ;S )    3 FH LOAD
CR .( ASSEMBLER  )   4 FH 16 FH THRU
CR .( UTILITIES  )  17 FH 25 FH THRU
CR .( SF EDITOR  )  26 FH 38 FH THRU
CR .( SCREEN ED  )        39 FH LOAD
CR .( AUX STACK  )  45 FH 48 FH THRU
CR .( MORE UTILITIES AND EXTENSIONS)
CR                  49 FH 80 FH THRU
CR .( VIRTUAL MEM ) 81 FH 86 FH THRU
CR .( CONDITIONAL COMP )  91 FH LOAD
CR .( AFIND       ) 92 FH 93 FH THRU
CR .( FILES (ERR)   94 FH 95 FH THRU
CR .( MULTITASKER) 96 FH 100 FH THRU

This screen of source is on block 2. When the phrase 2 FH LOAD is interpreted, the screen on block 4 is loaded.
When not loading (BLK is zero), FH adds the screen number in SCR to the number on the stack. When editing this same screen on block 2, typing 3 FH LIST will list the screen with the source for THRU , --> , <-- and ;S on block 5.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

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