Post Reply 
Trying to emulate some functions.
08-31-2019, 12:49 PM (This post was last modified: 08-31-2019 01:32 PM by Gerson W. Barbosa.)
Post: #2
RE: Trying to emulate some functions.
(08-31-2019 11:27 AM) Wrote:  May be you give me advertising, help or optimising.
Here it is work good, especially LASTx.

Your program preserves both original X and Y stack registers, but Y will contain the remainder (or an approximation thereof). If just keeping the original X register is ok, I would suggest the following:

02 RCL Y
03 X<>Y
04 MOD
05 ST- Y
06 X<> L
07 /
08 END


PS: Your program doesn’t work when one argument is negative.

Notice 7 \ -2 = -7 \ 2 = -4, not -3.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Trying to emulate some functions. - Gerson W. Barbosa - 08-31-2019 12:49 PM

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