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

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: R.N
PostPosted: Sat Jul 24, 2021 10:39 am 
Offline

Joined: Thu May 13, 2021 8:56 am
Posts: 31
Location: Hellevoetsluis-NL
I found in the FD-V05N1.PDF an intersting article “Add a Breapoint Tool”. (Leo Brodie)
There was one word I could not find back.

“N.R”

What is the meaning of this word?

Cheers,

Jan


Top
 Profile  
Reply with quote  
 Post subject: Re: R.N
PostPosted: Sat Jul 24, 2021 12:06 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Wild guess: non-reentrant (??) :roll: But can you link us to that PDF, please? Also clarify -- is it RN or NR? You topic title is different from what's in the text. :wink:

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
 Post subject: Re: R.N
PostPosted: Sat Jul 24, 2021 12:35 pm 
Offline

Joined: Thu May 13, 2021 8:56 am
Posts: 31
Location: Hellevoetsluis-NL
It’s came from:

Forth Dimensions
Volume 5
Number 1
Page 19

“Add a Break Point Tool”
Autor: Leo Brodie


Top
 Profile  
Reply with quote  
 Post subject: Re: R.N
PostPosted: Sat Jul 24, 2021 12:42 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Here we are:
https://archive.org/details/Forth_Dimen ... 8/mode/1up

Attachment:
Screen60-Forth-R.N.png
Screen60-Forth-R.N.png [ 101.46 KiB | Viewed 1894 times ]


(Looks to me like code rather than an annotation but perhaps I can't parse what I see!)


Top
 Profile  
Reply with quote  
 Post subject: Re: R.N
PostPosted: Sat Jul 24, 2021 1:15 pm 
Offline

Joined: Thu May 13, 2021 8:56 am
Posts: 31
Location: Hellevoetsluis-NL
Could this be a word printing the return stack, because first is printing the stack contence!


Top
 Profile  
Reply with quote  
 Post subject: Re: R.N
PostPosted: Sat Jul 24, 2021 3:02 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Powersoft wrote:
Could this be a word printing the return stack
I suspect you're right. There's a ." that tells the user to expect S to be printed; then the word S. apparently prints S. And there's a ." that tells the user to expect R to be printed, and the word R.N apparently prints R.

But I don't know why the word that prints S is called S. whereas the word that prints R is called S.N. <shrug> :roll:

-- Jeff

ps- thx, Ed!

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
 Post subject: Re: R.N
PostPosted: Sun Jul 25, 2021 8:06 pm 
Offline

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

After reading the article, I agree that it is most likely the word BREAK displays the contents of the data and return stacks before going into a custom QUIT loop. It is possible R.N only displays some of the return stack, but that doesn't really matter.
As for the odd names, the article is from the Summer of 1983. Leo Brodie states that this technique was invented by Frank Seuberling , adapted by Kim Harris and brought to his attention by John Clark. I'm not sure when the name .S became widely used for the word which displays the contents of the data stack and I don't even know if there is a standard name for a word which displays the contents of the return stack. In Fleet Forth, I use the name .RS for that.

Here is a version of this tool which is smaller. It eliminates the return stack check by using a technique from Scott Ballantyne's Blazin' Forth for the Commodore 64.
BREAK switches off the variable CON before entering the loop. To exit the loop, use the word CONT to switch CON on.
Code:
VARIABLE CON
: CONT   CON ON ;  ( CONTINUE)
: BREAK  ( -- ) ( COMPILE BREAK INTO : DEF)
   CR ." BREAK S= " .S CR ." R= " .RS
   BLK OFF CON OFF
   BEGIN
      QUERY INTERPRET ." AOK" CR
      CON @
   UNTIL ;



Top
 Profile  
Reply with quote  
 Post subject: Re: R.N
PostPosted: Mon Jul 26, 2021 1:43 pm 
Offline

Joined: Sun May 13, 2018 5:49 pm
Posts: 255
The accompanying text for that article says:
Quote:
Another pleasant addition has been the stack dumps — both data stack and return stack — on line 6. BREAK will run fine without either of these if you haven't got them yet.
That confirms that R.N prints the return stack. My guess is that R.N is "Print Return Stack with Names". Articles in other issues of Forth Dimensions were discussing how to turn stack addresses into names, with this mention that seems pretty close in Volume 17,Number 3, page 15 talking about debugging:
Quote:
I added checks to INTERPRET, and used to add ?STACK in misbehaving definitions. The word R. that prints the trace of return addresses (using the R@ 2- @ >NAME .NAME principle) turned out to be very useful in ABORT diagnostics.
This shows a word named R. that is doing something similar. I didn't find a code listing for R.N directly.


Top
 Profile  
Reply with quote  
 Post subject: Re: R.N
PostPosted: Mon Jul 26, 2021 2:16 pm 
Offline

Joined: Sun Apr 26, 2020 3:08 am
Posts: 357
My extremely limited educated guess is that "S." is already defined in a lot of Forth's to print the data stack and was just used, whereas "R.N' is newly defined. Since ".R" and "D.R" and ">R, R>, R" are already used in FigForth, it seems to me that "R." can become confusing. If I saw "R.", I would take it as printing the top Return Stack value since "R" and "R>" already put the top address on the data stack, whereas "R.N" would print all the values on the Return Stack.


Top
 Profile  
Reply with quote  
 Post subject: Re: R.N
PostPosted: Thu Jul 29, 2021 1:02 am 
Offline

Joined: Fri May 05, 2017 9:27 pm
Posts: 895
SamCoVT wrote:
The accompanying text for that article says:
Quote:
Another pleasant addition has been the stack dumps — both data stack and return stack — on line 6. BREAK will run fine without either of these if you haven't got them yet.
That confirms that R.N prints the return stack. My guess is that R.N is "Print Return Stack with Names". Articles in other issues of Forth Dimensions were discussing how to turn stack addresses into names, with this mention that seems pretty close in Volume 17,Number 3, page 15 talking about debugging:
Quote:
I added checks to INTERPRET, and used to add ?STACK in misbehaving definitions. The word R. that prints the trace of return addresses (using the R@ 2- @ >NAME .NAME principle) turned out to be very useful in ABORT diagnostics.
This shows a word named R. that is doing something similar. I didn't find a code listing for R.N directly.


Fleet Forth's word .RS displays the addresses on the return stack as well as the associated names. I thought it was the norm for a word which displays the return stack contents to display both addresses and associated names.
Using R@ 2- @ >NAME .NAME to display the names works well enough for a stack trace in most cases, but the name QUIT does not appear in the display of the return stack trace. This technique does not display the name of the word containing a given address, but the name of the word which caused that address to be placed on the return stack when it was executed. As I said, this works well for troubleshooting in most cases. I mentioned here that I needed a more accurate version of .RS for some experiments I was running in Fleet Forth.


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

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: