HP Forums
Term for feature that abstracts RPN program location? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Term for feature that abstracts RPN program location? (/thread-14980.html)



Term for feature that abstracts RPN program location? - Orome - 05-12-2020 04:33 PM

What is the technical term that describes a programming language that abstracts (or at least largely abstracts) the machine location of programs?

I’m thinking here specifically of the evolution of HP keystroke languages, from early (and some late) models where each instruction exists in a single linear space (e.g., before the 41 series), to (some) later models such as the 41 series and the 42S, where each program exists in its own space.

Is there a formal term for this difference?

(Note that I’m thinking here exclusively of cases like the examples given, where the languages used are otherwise the same, and not of more comprehensive changes in system architecture, for which this change comes as part of the package — e.g., RPL.)


Bonus question: What other (non-RPL) models have this feature, aside from the 41 family and the 42S?

EDIT1: The original question above got some way off base examples, so maybe this helps: I'm talking specifically about the difference between, for example how a new program is "started" in the 34C vs. the 42S. The key difference is that while in both, steps can either be appended to or inserted among existing ones, in the former a new "program" is just started by inserting or appending a new global label step, while in the latter new programs can be started without any relationship to any existing steps , e.g., with [GTO] .. (not strictly true as you discover if you delete the `END`, but true in practice).

EDIT2: See (hopefully) less confusing reframing below.


RE: Term for language that abstracts program location? - cdmackay - 05-12-2020 05:12 PM

A modern use is PIC == position-independent code, but that's more for machine code that can be loaded at any location in memory.


RE: Term for language that abstracts program location? - Artur - Brasil - 05-12-2020 05:28 PM

About the term that abstracts the program location, I can't realize anything else than partitioning.
About other calculators that have this ability, I presume the 48 series and 50 do this memory partitioning.
The actual scientific programmable calculators from HP are really a shame. Just simple letter named programms, actually a step down on their scalate, for not saying something worst.
I tried one Casio FX-5800P, but it's facilities and "applicatives" are disconnected. Really bad implementation in an excellent calculator.


RE: Term for language that abstracts program location? - J-F Garnier - 05-12-2020 06:22 PM

(05-12-2020 04:33 PM)Orome Wrote:  What is the technical term that describes a programming language that abstracts (or at least largely abstracts) the machine location of programs?

I’m thinking here specifically of the evolution of HP keystroke languages, from early (and some late) models where each instruction exists in a single linear space (e.g., before the 41 series), to (some) later models such as the 41 series and the 42S, where each program exists in its own space.

Interesting question, in my opinion the key here is not the fact that the program space is global to all programs (e.g. 15C) or in separated areas (e.g. 41C) but the use of absolute line references for jumps and calls.
Without line references but labels for jumps and calls (15C, 41C), the program is relocatable in the sense that it is keyed in exactly in the same way regardless of its position in memory. This is not true for machines that use line references (e.g. 12C).

For the right term describing this, I just used 'relocatable' above, but in the HP calculator world the usual term may better be label-referenced vs line-referenced goto/gosub.

J-F


RE: Term for language that abstracts program location? - HP67 - 05-12-2020 06:36 PM

(05-12-2020 04:33 PM)Orome Wrote:  What is the technical term that describes a programming language that abstracts (or at least largely abstracts) the machine location of programs?

I’m thinking here specifically of the evolution of HP keystroke languages, from early (and some late) models where each instruction exists in a single linear space (e.g., before the 41 series), to (some) later models such as the 41 series and the 42S, where each program exists in its own space.

Is there a formal term for this difference?

(Note that I’m thinking here exclusively of cases like the examples given, where the languages used are otherwise the same, and not of more comprehensive changes in system architecture, for which this change comes as part of the package — e.g., RPL.)

Bonus question: What other (non-RPL) models have this feature, aside from the 41 family and the 42S?

I think high level language" was widely used for the languages that came after assemblers. But that doesn't seem like the distinction you're talking about.

Of the languages I know, APL seems the earliest (1967) "language" which had sense of workspaces and functions.


RE: Term for language that abstracts program location? - Orome - 05-12-2020 06:39 PM

(05-12-2020 06:22 PM)J-F Garnier Wrote:  For the right term describing this, I just used 'relocatable' above, but in the HP calculator world the usual term may better be label-referenced vs line-referenced goto/gosub.

No, label referencing is independent of this feature, though it generally comes along for the ride.

The key difference is that while in both, steps can either be appended to or inserted among existing ones, in the latter new programs can be started without any relationship to any existing steps (e.g., with [GTO] ..).


RE: Term for language that abstracts program location? - mfleming - 05-13-2020 01:39 AM

I suppose in the high level language world you'd refer to the latter style as Procedural or Functional. Compare BASIC with a GOSUB 20000 vs. SQRT(X) in something like Fortran. You could define the square root function separately, move it around in the card deck, put it in a separate library and still use it in your program.

A rough analogy...


RE: Term for language that abstracts program location? - ttw - 05-13-2020 03:03 AM

The term "relocatability" was used back in the 1960s, maybe earlier. It seems to capture the idea.


RE: Term for language that abstracts program location? - hth - 05-13-2020 05:21 AM

(05-12-2020 04:33 PM)Orome Wrote:  What is the technical term that describes a programming language that abstracts (or at least largely abstracts) the machine location of programs?

I’m thinking here specifically of the evolution of HP keystroke languages, from early (and some late) models where each instruction exists in a single linear space (e.g., before the 41 series), to (some) later models such as the 41 series and the 42S, where each program exists in its own space.

Is there a formal term for this difference?

I think you are mixing two concepts up.

Essentially all programming languages has a concept of abstracting away the location of a program. The only one that I can think of that does not is what is called an absolute assembler. Languages that expose real locations are usually relocatable through some loader mechanism, or use a fixed location but are separated from other programs by different OS processes. Many languages have no concept of a visible location.

Then you talk about that we can have one or multiple program spaces. This is kind of partitioning or separation (of code slices, or programs).

That we can keep things separate is called a "file" when saved to some storage. I do not know of about a proper term for that concept when it is loaded as a program in a calculator. I think one would say that the program memory can be shared by more than one program that are separate from each other. I do not know of any technical or formal term for it, one would need to describe it with some words.


RE: Term for language that abstracts program location? - cyrille de brébisson - 05-13-2020 06:12 AM

Hello,

Early CPU had few instructions to run through, one program loaded at a time, and jumps where absolute. You would say: jump to instruction N.
It worked fine at the beginning... and was super simple to implement (just change the Program Counter to N)...

But then, CPU started running some sort of OS (of unknown size), gained more memory (which meant that "jump to address N" took more room to encode)...

This made programs/system that were using absolute addressing hard to use/create...
So entered relative jumps. They have 2 advantages: 1: you do not need to know where your program is loaded in memory. 2: when you jump short distances, you can have a compact instruction to say: jump + or - 32 bytes (for example). The Saturn CPU has short: +/-64bytes, normal (1K) and long (16K) jumps (if I remember well, unless I have it off by a factor of 2).
Such were called "relocable" (at least in my neck of the wood)...
Note that an absolute positionned program could still use relocable code!!!!

Now programming languages could follow, or not, similar concepts...
Basic (10 A=1; 20 print(A); 30 A=A+1 40 GOTO 20) is absolute... So are, to some extend (and in my opinion) some numbered labels languages where the labels HAVE to be in order... the other are not...
12C type languages which jump to an instruction number are absolute..

anyhow, my 2c :-)

Cyrille


RE: Term for language that abstracts program location? - Orome - 05-13-2020 07:17 PM

Sorry, I keep getting answers that really aren't addressing the question I mean to ask. But it's my fault for not asking it right.

An example will, I hope, help. Here's some code as it exists in memory on a 42S:

00 { 56-Byte Prgm }
01▸LBL "AAA"
02 1111
03 RTN
04▸LBL A
05 -111
06 END
07▸LBL "BBB"
08 2222 @ This is what CCC does if ENDs are removed
09 RTN
10▸LBL B
11 -222
12 END
13▸LBL "CCC"
14 GTO A @ An error unless ENDs are removed
15 .END.


While this is how the code is actually organized in memory, it's not how it is presented to users. Instead each block defined by LBL <string> ... END is presented at as a separate program, viewed and edited individually, without concern for the others:

00 { 20-Byte Prgm }
01▸LBL "AAA"
02 1111
03 RTN
04▸LBL A
05 -111
06 END


00 { 20-Byte Prgm }
01▸LBL "BBB"
02 222
03 RTN
04▸LBL B
05 -222
06 END


00 { 10-Byte Prgm }
01▸LBL "CCC"
02 GTO A
03 .END.


And when a new program is started with GTO .., it starts empty and on its own

00 { 0-Byte Prgm }
01 .END.


and can be edited without concern for the others

00 { 7-Byte Prgm }
01▸LBL "DDD"
02 .END.


even though in fact it has been added to the end of the others, following an automatically inserted END:

...
11 -222
12 END
13▸LBL "CCC"
14 GTO A
15 END @ This was magically inserted
16▸LBL "DDD"
17 .END.


My question is simply: What is the name for the feature that creates the illusion that programs have no storage-spatial relationship to one another, specifically in the context of moving from say the 34C to the 41 series (e.g., "the 41 series adds ??? which previous HP calculators lacked").

(I'm not asking about the definition of blocks with LBL <string> ... END, nor the local scoping to those blocks of labels of the form LBL <char> or LBL ###, nor about the fact that the all three "programs" are in fact in single linear space, as one discovers if one deletes the ENDs, as noted in the comments.)


RE: Term for language that abstracts program location? - Artur - Brasil - 05-13-2020 07:42 PM

Weel, the only answer that occurs to me is: OPERATIONAL SYSTEM!
I don't remember a particular name of this segentation and abstraction to user. All computers work like this PROCESSOR <-> RAM (and some other parts), but who cares where anything is in machine, is the OS.
Be it in a calculator, in a computer, in my watch, it doesn't matter.
Also, one simple name that occurs to me is: Von Newmann architeture... data and instructions share the same space. Who knows what is one and what is another? SO.
But all of this you already know...


RE: Term for feature that abstracts RPN program location? - Massimo Gnerucci - 05-13-2020 08:29 PM

(05-13-2020 07:17 PM)Orome Wrote:  moving from say the 34E to the 41 series

Oh, and there never was a 34E sold by HP. ;)


RE: Term for feature that abstracts RPN program location? - Orome - 05-13-2020 08:44 PM

(05-13-2020 08:29 PM)Massimo Gnerucci Wrote:  Oh, and there never was a 34E sold by HP. ;)

Yeah, too many ABCs in this thread, I guess my fingers wanted some Es.


RE: Term for feature that abstracts RPN program location? - Didier Lachieze - 05-13-2020 10:12 PM

(05-13-2020 07:17 PM)Orome Wrote:  My question is simply: What is the name for the feature that creates the illusion that programs have no storage-spatial relationship to one another, specifically in the context of moving from say the 34C to the 41 series (e.g., "the 41 series adds ??? which previous HP calculators lacked").

As already mentioned by hth above, the closest I can think of to answer your question is "independent program spaces", and btw this is how the designers of the 41C described it in the HEWLETT-PACKARD JOURNAL - MARCH 1980 Volume 31 - Number 3, page 10 (emphasis is mine):

Quote:Local versus Global Labels

In the HP-67, each time a user label is referenced by a GTO or GSB instruction, a linear search is made through the entire user program memory to find the label. The time spent searching for labels often represents a significant fraction of the execution time for HP-67 programs. On the HP-41C, several techniques have been used to minimize label search time. The HP-41C has two classes of labels: global alpha labels and local numeric labels. The END function on the HP-41C is used to divide user program memory into independent program spaces. When a reference is made to a local label, the search for the label is conducted only in the current program space, thereby shortening the search time. Once the target label is found, its location is stored with the GTO that referenced it; in other words, the GTO is "compiled." The search is eliminated altogether on subsequent executions of the GTO function if the program has not been edited in the meantime. Global alpha labels are used for references across program space boundaries. The alpha label chain described above serves to speed up the search for global alpha labels.

The concepts of global versus local labels and separate program spaces, although not new to computer programmers, are important advances for a programmable calculator. A user can always write a new program without worrying about what numeric labels have been used in programs already in the machine, simply by creating a new program space. Users can similarly exchange and use each others' subroutines without regard for conflicting numeric labels. Moreover, the global alpha labels used to name programs can be up to seven characters in length, long enough to be meaningful and memorable.



RE: Term for feature that abstracts RPN program location? - Orome - 05-13-2020 10:24 PM

(05-13-2020 10:12 PM)Didier Lachieze Wrote:  ... the closest I can think of to answer your question is "independent program spaces", and btw this is how the designers of the 41C described it in the HEWLETT-PACKARD JOURNAL - MARCH 1980 Volume 31 - Number 3, page 10

Excellent! Best to have a term from the designers themselves. I'll go with that.


RE: Term for feature that abstracts RPN program location? - Jonathan Busby - 05-14-2020 08:09 PM

(05-12-2020 05:28 PM)Artur - Brasil Wrote:  About the term that abstracts the program location, I can't realize anything else than partitioning.
About other calculators that have this ability, I presume the 48 series and 50 do this memory partitioning.
The actual scientific programmable calculators from HP are really a shame. Just simple letter named programms, actually a step down on their scalate, for not saying something worst.
I tried one Casio FX-5800P, but it's facilities and "applicatives" are disconnected. Really bad implementation in an excellent calculator.

AFAIK, the HP Saturn CPU doesn't natively support "memory partitioning", although I don't know exactly what the OP is asking about and what "memory partitioning" in this case is supposed to refer to.

The Saturn CPU does support "memory controllers" which abstract the physical location of a nibble-addressed memory space which is connected to a physical memory device ( ie. The starting address and size of a memory region associated with a certain "memory controller" can be set to a custom, user-determined value ), but it's all the same to the Saturn CPU.

The Saturn CPU doesn't really support PIC or "Position Independent Code" as the "GOLONG" and "GOSUBL" instructions only have enough space for an offset that is ± 32767 / 0x7FFF nibbles ( relative to the PC ). This can be gotten around though by using a "linker" or "loader" ( which is tricky due to garbage collection ) but the usual practice, in User and System RPL land, is to just use a library to abstract the memory locations of custom commands.

Regards,

Jonathan


RE: Term for feature that abstracts RPN program location? - Orome - 05-14-2020 08:25 PM

(05-14-2020 08:09 PM)Jonathan Busby Wrote:  
(05-12-2020 05:28 PM)Artur - Brasil Wrote:  About the term that abstracts the program location, I can't realize anything else than partitioning...

AFAIK, the HP Saturn CPU doesn't natively support "memory partitioning", although I don't know exactly what the OP is asking about and what "memory partitioning" in this case is supposed to refer to.

That answer has nothing to do with the question. (This answer addresses it though.)