Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Threaded code
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===RPL=== [[Hewlett-Packard|HP]]'s [[RPL (programming language)|RPL]], first introduced in the [[HP-18C]] calculator in 1986, is a type of proprietary hybrid (direct-threaded and indirect-threaded) ''threaded interpretive language'' (TIL)<ref name="Loelinger_1981"/> that, unlike other TILs, allows embedding of RPL "objects" into the "runstream", i.e. the stream of addresses through which the interpreter pointer advances. An RPL "object" can be thought of as a special data type whose in-memory structure contains an address to an "object prolog" at the start of the object, and then data or executable code follows. The object prolog determines how the object's body should be executed or processed. Using the "RPL inner loop",<ref name="Busby_2018"/> which was invented and patented<ref name="Wickes_1986"/> by William C. Wickes in 1986 and published in 1988, execution follows like so:<ref name="Wickes_1988"/> # Dereference the IP (instruction pointer) and store it into O (current object pointer) # Increment the IP by the length of one address pointer # Dereference O and store its address in O_1 (this is the second level of indirection) # Transfer control to next pointer or embedded object by setting the PC (program counter) to O_1 plus one address pointer # Go back to step 1 This can be represented more precisely by: <pre> O = [I] I = I + Ξ PC = [O] + Ξ </pre> Where above, O is the current object pointer, I is the interpreter pointer, Ξ is the length of one address word and the "[]" operator stands for "dereference". When control is transferred to an object pointer or an embedded object, execution continues as follows: <pre> PROLOG -> PROLOG (The prolog address at the start of the prolog code points to itself) IF O + Ξ =/= PC THEN GOTO INDIRECT (Test for direct execution) O = I - Ξ (Correct O to point to start of embedded object) I = I + Ξ± (Correct I to point after embedded object where Ξ± is the length of the object) INDIRECT (Rest of prolog) </pre> On HP's [[HP Saturn|Saturn]] microprocessors that use RPL, there is a third level of indirection made possible by an architectural / programming trick which allows faster execution.<ref name="Busby_2018"/>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)