Post Reply 
Simple programming help with the Prime
06-09-2014, 09:46 PM (This post was last modified: 06-09-2014 09:51 PM by Didier Lachieze.)
Post: #11
RE: Simple programming help with the Prime
(06-09-2014 09:22 PM)John R. Graham Wrote:  Not sure exactly what you mean, but let's assume that your add program wants to take two arguments from the stack, add them together, leaving the sum on the stack, then the code woule look like this:
Code:
EXPORT ADD(X,Y)
BEGIN
  RETURN X+Y;
END;
and would be invoked as
Code:
ADD(2)
Does that make sense?

- John

It seems there has been some changes with the latest firmware update because now in RPN mode you don't need anymore to specify the number of arguments when calling a User program, with your program example:
Code:
2 ENTER 3 ADD() ENTER
returns 5.

However in algebraic mode you still need to call your program with:
Code:
ADD(2,3) ENTER
to get 5.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Simple programming help with the Prime - Didier Lachieze - 06-09-2014 09:46 PM



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