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
R.N
Re: R.N
Wild guess: non-reentrant (??)
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.
-- Jeff
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: R.N
Here we are:
https://archive.org/details/Forth_Dimen ... 8/mode/1up
(Looks to me like code rather than an annotation but perhaps I can't parse what I see!)
https://archive.org/details/Forth_Dimen ... 8/mode/1up
(Looks to me like code rather than an annotation but perhaps I can't parse what I see!)
Re: R.N
Powersoft wrote:
Could this be a word printing the return stack
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>
-- Jeff
ps- thx, Ed!
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: R.N
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: Select all
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 ;
Re: R.N
The accompanying text for that article says:
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:
This shows a word named R. that is doing something similar. I didn't find a code listing for R.N directly.
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.
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.
Re: R.N
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.
Re: R.N
SamCoVT wrote:
The accompanying text for that article says:
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:
This shows a word named R. that is doing something similar. I didn't find a code listing for R.N directly.
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.
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.
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.