How force 50g warmstart in User RPL?
|
10-23-2022, 11:41 PM
Post: #1
|
|||
|
|||
How force 50g warmstart in User RPL?
How can a User RPL program safely force a warmstart to occur, as if ON+C had been pressed? My old brain is forgetting everything. I used the Search facility here but found nothing. Thanks in advance!
<0|ɸ|0> -Joe- |
|||
10-23-2022, 11:55 PM
Post: #2
|
|||
|
|||
RE: How force 50g warmstart in User RPL?
"OFF" [Enter] followed by [ON].... ;-)
--Bob Prosperi |
|||
10-24-2022, 12:05 AM
Post: #3
|
|||
|
|||
RE: How force 50g warmstart in User RPL?
(10-23-2022 11:55 PM)rprosperi Wrote: "OFF" [Enter] followed by [ON].... ;-) Unfortunately, that performs a normal power-up, not an ON+C warmstart. <0|ɸ|0> -Joe- |
|||
10-24-2022, 12:57 AM
(This post was last modified: 10-24-2022 02:54 PM by DavidM.)
Post: #4
|
|||
|
|||
RE: How force 50g warmstart in User RPL?
(10-23-2022 11:41 PM)Joe Horn Wrote: How can a User RPL program safely force a warmstart to occur, as if ON+C had been pressed? That may depend on your definition of "safely". So long as nothing important is pending, you could simply use the "Warmstart" entry point (<edited: the suggested method could cause problems and shouldn't be used. See Joe's response below for a safer approach.>). Jumping to Warmstart is a one-way street, of course. Your program loses control and you would definitely not want to do that if something important were still in process. This is in essence the same thing as "On-C" being pressed, with all of the same resets occurring (including the stack being cleared and attached libraries being asked to reconfigure themselves). Is this what you were remembering? |
|||
10-24-2022, 12:58 PM
Post: #5
|
|||
|
|||
RE: How force 50g warmstart in User RPL?
(10-24-2022 12:57 AM)DavidM Wrote:(10-23-2022 11:41 PM)Joe Horn Wrote: How can a User RPL program safely force a warmstart to occur, as if ON+C had been pressed? As safe as pressing ON+C, which doesn't cause a Memory Lost (AKA "Coldstart"). (10-24-2022 12:57 AM)DavidM Wrote: So long as nothing important is pending, you could simply use the "Warmstart" entry point ("#01FBDh SYSEVAL" on a 48-series or "#267E5h SYSEVAL" on a 49-series). But the "Warmstart" entry point is a Saturn machine language entry point, not an RPL entry point. SYSEVAL expects as its argument the address of an RPL entry point. Is there a simple way for User RPL to jump to a Saturn code entry point? #267E5h SYSEVAL on the 50g does happen to perform a warmstart, but I don't think its a safe way to do it, because it's landing on RPL gibberish and essentially crashing, resulting in a warmstart, which Murphy's Law says will cause Memory Lost only when you really, really don't want it to. (10-24-2022 12:57 AM)DavidM Wrote: Jumping to Warmstart is a one-way street, of course. Your program loses control and you would definitely not want to do that if something important were still in process. This is in essence the same thing as "On-C" being pressed, with all of the same resets occurring (including the stack being cleared and attached libraries being asked to reconfigure themselves). Yes, that's exactly what I want to happen. I am exploring various ways of automatically running programs AFTER a warmstart. My current best solution is: "CCD20C00008D5E762" H→ which creates a Code object whose body is GOVLNG 267E5=Warmstart. It works, but it feels like a total kluge. (kludge? cluge? cludge?) <0|ɸ|0> -Joe- |
|||
10-24-2022, 02:37 PM
Post: #6
|
|||
|
|||
RE: How force 50g warmstart in User RPL?
(10-24-2022 12:58 PM)Joe Horn Wrote: My current best solution is: I actually use that same "CODEM GOVLNG =Warmstart ENDCODE" in a custom SysRPL command for a personal library, which is where I got the idea. I was under the impression that, while not a "normal" use of SYSEVAL, that it would end up accomplishing the same thing in this case by jumping straight to the routine that resets the environment. In other words, maintaining the RPL stream/return stack/etc. wouldn't matter here since it was all being reset. That's definitely not the case, though. As you pointed out, SYSEVAL doesn't quite do what I was thinking here [PC=(A) vs. PC=A]. My quick test showed the correct action, but not for the right reason. Personally, I don't consider your "kludge" to be a problem. I wouldn't hesitate to use that method for personal work, though it does of course imply that library 256 is attached. While I suspect you always have that available, others may not. (10-24-2022 12:58 PM)Joe Horn Wrote: Yes, that's exactly what I want to happen. I am exploring various ways of automatically running programs AFTER a warmstart. I use a STARTUP object that resets my user key definitions, sets display contrast to a customized value, sets my preferred flag settings, etc. It gets executed any time a Warmstart occurs. I've sometimes thought that a program could employ something like the following to perform a "one off" action after a warmstart:
This does require SysRPL coding, though. I'm not aware of a way to do the same with UserRPL. |
|||
10-24-2022, 03:51 PM
(This post was last modified: 10-24-2022 03:57 PM by Giuseppe Donnini.)
Post: #7
|
|||
|
|||
RE: How force 50g warmstart in User RPL?
The RPL, and hence SYSEVALable, entry you are looking for is called DOAPWL (DO A PoWer Lost sequence) and lives at #21B4Eh in all ROM revisions of the HP-48 (I don’t use the HP-50G, but a quick check revealed that the corresponding entry must have been moved to #2F237h.)
Far from being a kludge, your code does exactly the same thing as DOAPWL, the only difference being that the latter is a Primitive Code Object and hence executes faster: 21B4E =DOAPWL 21B4E 35B12 CON(5) (*)+5 21B53 8DDBF10 GOVLNG =Warmstart (=norecPWLseq) (The =Warmstart entry is also called =norecPWLseq (non-recordable PoWer Lost sequence) because it doesn’t record the time nor the cause of the system halt in the warmstart log.) The use of DOAPWL is in fact sanctioned by HP themselves, as they call it to implement the system halt inherent in the (User RPL) xRESTORE command. |
|||
10-24-2022, 05:15 PM
Post: #8
|
|||
|
|||
RE: How force 50g warmstart in User RPL? | |||
10-25-2022, 04:42 AM
Post: #9
|
|||
|
|||
RE: How force 50g warmstart in User RPL?
Awesome! Thanks, Giuseppe and David!
<0|ɸ|0> -Joe- |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)