Post Reply 
WP-34s Emulator v3.2
01-03-2014, 02:09 PM
Post: #9
RE: WP-34s Emulator v3.2
(01-03-2014 12:06 PM)Marcus von Cube Wrote:  In RPN, 10 ENTER^ * yields 100 (10^2). This makes some functions, such as x^2, expendable as keyboard functions for most manual calculations on the classic machines. To achieve the same in RPL, 10 DUP + is the correct way to go. This can be entered as 10 ENTER ENTER + in direct mode. In a program, you'll need the explicit stack manipulation command DUP.
Why +? Typo?

The equivalent of DUP in a FOCAL program is RCL X. But that takes 2 bytes and isn't available on all machines. So you use ENTER and hope the next command enables the stack lift. Otherwise a RCL 00 following directly the ENTER will just overwrite X instead of inserting the value.
In this situation I often used some command like CLA that was needed somewhere else but didn't make much sense at that specific line:

ENTER
CLA
RCL 00


This little hack makes it difficult to understand and maintain the code later. I often would have preferred to just use:

DUP
RCL 00


A similar thing is with CLX. In a program you generally don't want to disable the stack lift. I see that as the biggest drawbacks of ENTER in FOCAL programs.

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
WP-34s Emulator v3.2 - Bernhard - 01-02-2014, 11:59 AM
RE: WP-34s Emulator v3.2 - Paul Dale - 01-02-2014, 12:10 PM
RE: WP-34s Emulator v3.2 - Bernhard - 01-02-2014, 12:14 PM
RE: WP-34s Emulator v3.2 - Thomas Klemm - 01-02-2014, 09:45 PM
RE: WP-34s Emulator v3.2 - Paul Dale - 01-03-2014, 06:03 AM
RE: WP-34s Emulator v3.2 - Marcus von Cube - 01-03-2014, 12:06 PM
RE: WP-34s Emulator v3.2 - Thomas Klemm - 01-03-2014 02:09 PM
RE: WP-34s Emulator v3.2 - Didier Lachieze - 01-04-2014, 12:05 AM
RE: WP-34s Emulator v3.2 - Thomas Klemm - 01-04-2014, 12:27 AM
RE: WP-34s Emulator v3.2 - Marcus von Cube - 01-03-2014, 06:38 PM
RE: WP-34s Emulator v3.2 - Thomas Klemm - 01-04-2014, 12:04 AM
RE: WP-34s Emulator v3.2 - Marcus von Cube - 01-04-2014, 07:53 PM
RE: WP-34s Emulator v3.2 - Thomas Klemm - 01-04-2014, 10:04 PM



User(s) browsing this thread: 2 Guest(s)