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 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)