Jump to content
Sign in to follow this  
Heaven/TQA

USR command

Recommended Posts

maybe I am getting old but I wanted to check my distance calc routine in basic... but please refresh my memories

 

a=usr(adr,px,py,mx,my,dist)

 

first I would need to pull the vars from stack

 

pla ; amount of arguments

pla ;dist

sta dist

pla ;my

sta my

...

 

 

so... actually

 

are the vars pushed on stack 16 bit? or 8 bit?

 

and the content of the accumulator when switching back to basic with RTS is then stored in the a var?

Share this post


Link to post
Share on other sites

8 bit value with # of parameters. 16 bit values for parameters. High byte of parm1, low byte parm1 etc.

 

And to pass anything back to BASIC, you store it in $D4,$D5.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...