Quoting Bill Wickes:
Quote:
The fundamental definition of the HP 48 operation ENTER is:
Take the text in the command line, check it for correct syntax, then treat it as a program and execute the objects defined there.
With RPL, when you're typing in source code (for a number, other object, series of objects, whatever), you're inputting it to an "editor" (command line, equation writer, matrix writer, etc.), which could be considered a "buffer"; it has no effect on the stack until an ENTER operation is invoked. In the case of the command line editor in particular, when you press ENTER, ordinarily the source code is parsed and checked for syntax errors, and assuming no errors, all objects from the command line are combined into a compiled "secondary" (SysRPL program) which is placed on the stack and executed, and when finished, the display is updated.
In "immediate entry" mode (neither PRG nor ALG displayed in the status area), pressing an immediate entry key effectively appends the key object to the command line and then invokes an "implicit ENTER".
In the case of just a data class object such as a number, the effect of pressing ENTER is to put the object (or actually, a pointer to the object in temporary memory) on stack level 1 (moving anything already on the stack up one level), and then update the display.
But suppose that you open the command line with RightShift ENTRY (over the ALPHA key) to invoke PRM entry mode, then type in 1 2 +, and then press ENTER. In this case the number 3 is placed on the stack before the display is updated.
Or if you type 1 2 into the command line and then press + (which invokes an implicit ENTER), 3 is also placed on the stack.
Or if you already have 1 on the stack, then type in 2 and then press +, the 1 is replaced by a 3 before the display is updated.
In general, the command line could be considered source code for a program to be executed immediately.
Note that when in the standard stack display (no command line or other "special environment" active), pressing the ENTER key doesn't invoke the ENTER operation; it invokes a DUP command instead.
For more details, see section 4.3 (pages 83-90) of HP 48 Insights Part I: Principles and Programming HP48G/GX Edition, available on the current MoHPC CD-ROM set / DVD-ROM.
Regards,
James
Edited: 23 Feb 2007, 10:20 p.m.