Post Reply 
HP41C - workaround for the SIZE? missing
04-21-2016, 07:19 PM (This post was last modified: 04-22-2016 05:31 AM by Werner.)
Post: #17
RE: HP41C - workaround for the SIZE? missing
(04-21-2016 05:24 PM)Dieter Wrote:  
Code:
>LBL"SIZE?"
 255
 ENTER
 ISG X
>LBL 01
 SF 25
 ENTER
 CLX
 RCL IND Z
 RDN
 FC?C 25
 CHS
 2
 /
 ST+ Y
 ABS
 INT
 X>0?
 GTO 01
 X<> L
 +
 END

The CLX disables stack lift so that the RCL overwrites X if the register is available, otherwise it leaves a zero.

Otherwise I really like your code. It's short, fast and effective.

Dieter

The previous version at 37 bytes used almost exactly that trick. Almost, since ENTER itself also disables stack lift and so the CLX is not needed ;-))

And I tried out the VIEW/CLD on a real 41, the VIEWs do not show, that's why I thought it was acceptable.

Cheers, Werner
And now I'm going to read Gene's post ;-)

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP41C - workaround for the SIZE? missing - Werner - 04-21-2016 07:19 PM



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